var clockID = 0;

function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

   var tDate = new Date();
	 hh = tDate.getHours();
	 mm = tDate.getMinutes();
	 ss = tDate.getSeconds();
	 if (hh < 10){hh = "0" + hh};
	 if (mm < 10){mm = "0" + mm};
	 if (ss < 10){ss = "0" + ss};
	  
   document.theClock.theTime.value = "" + hh + ":" + mm + ":" + ss;
   
   clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}
