
	var cont=0;
	var reset=0;

	function Right(str, n)
	{
			if (n <= 0)     // Invalid bound, return blank string
			   return "";
			else if (n > String(str).length)   // Invalid bound, return
			   return str;                     // entire string
			else { // Valid bound, return appropriate substring
			   var iLen = String(str).length;
			   return String(str).substring(iLen, iLen - n);
			}
	}

	function secs2hms(secs) {
		var iHours = Math.floor(secs/3600);
		var iMinutes = Math.floor((secs/60) - (iHours*60));
		var iSeconds = Math.floor(secs % 60);
		var sZeros = '00';

		if (iSeconds == 60) { iMinutes++; iSeconds = 0; }
		if (iMinutes == 60) { iHours++; iMinutes = 0; }

		iHours = Right(sZeros+iHours,2);
		iMinutes = Right(sZeros+iMinutes,2);
		iSeconds = Right(sZeros+iSeconds,2);
		
		
		return(iHours+':'+iMinutes+':'+iSeconds);
	}

	function init ( )
	{
	  timeDisplay = document.createTextNode ( "" );
	  document.getElementById("clock").appendChild ( timeDisplay );
	}

