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