// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var clockID = 0;

function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

   var tDate = new Date();

   document.theClock.theTime.value = "" 
                                   + Pad(tDate.getHours()) + ":" 
                                   + Pad(tDate.getMinutes()) + ":" 
                                   + Pad(tDate.getSeconds());
   
   clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}

function Pad(numToCheck) {
   if(numToCheck < 10) {
      numToCheck = "0" + numToCheck;
   }
   return numToCheck;
}

function toggleStyle(objElement)
{
  if (objElement.id=='forminput')
    objElement.id='forminputfocus';
  else
    objElement.id='forminput';
}
