// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com
// hice algunos ajustes para que trabaje con un texto fijo y que tenga siempre 2 digitos.
var clockID = 0;

function UpdateClock() {
	if(clockID) {
		clearTimeout(clockID);
		clockID  = 0;
	}

	var tDate = new Date();

   /*document.theClock.theTime.value = "" 
                                   + tDate.getHours() + ":" 
                                   + tDate.getMinutes() + ":" 
                                   + tDate.getSeconds();*/
	var clock = document.getElementById('theTime');

	currentHours = tDate.getHours();
	currentHours = ( currentHours < 10 ? "0" : "" ) + currentHours;
	currentMinutes = tDate.getMinutes();
	currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
	currentSeconds = tDate.getSeconds();
	currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
	
	clock.innerHTML = "" + currentHours + ":" + currentMinutes + ":" + currentSeconds;
	clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}