function ButtonClock() {
   // This gets the current date and time.
   var dt = new Date();
   // The next three lines extract the appropriate
   // components.
   var hr = dt.getHours();
   var min = dt.getMinutes();
   var sec = dt.getSeconds();
 
   // Add leading 0's if necessary  
   if (min < 10) min = "0" + min;
   if (sec < 10) sec = "0" + sec;

   // This updates the button
   document.stuff.clock.value = "" + hr + ":" + min + ":" + sec;

   // This says "Do it all again in 1 second"
   setTimeout("ButtonClock()", 1000);
}

