<HEAD>
<TITLE>Clock Test Script</TITLE>
<SCRIPT>
<!--  hide the script
 
var timer_id   = 0;               // reference to timer 
var form_name  = 0;               // Instance label for form
var delay      = 1000;            // Delay between updates (1 sec)
  
function updater(){ 
                                  // Initialize timer interrupt
                                  // to re-call clock_updater()
                                  // after 'delay' milliseconds
                                  // Then calculate new time/date,
                                  // and put results in the VALUE
                                  // attribute of the FORM
                                  // field with NAME="result". 
                                  // Then copy time/date into the
                                  // form field with NAME="result2"
                                  // and NAME="result3" 
    timer_id=window.setTimeout("updater()", delay);
    form_name.result.value  = new Date();
    form_name.result2.value = form_name.result.value;
    form_name.result3.value = form_name.result.value;
}
function start(element_id) { 
    form_name = element_id;       // Attach time_field to 
                                  // form element named as argument.
    updater();                    // Then call clock_updater()
                                  // to start the clock
}
function stop() {
   window.clearTimeout(timer_id); // Remove Timer reference
}
 
// End script -- end of comment that hides the script -->

</SCRIPT></HEAD>

<!--       ONLOAD   triggers   start(), passing the named form
           ONUNLOAD triggers   stop (), which deletes the timer
-->
<BODY ONLOAD="start(document.forms.clock)" 
      ONUNLOAD="stop()">
 
<H2 ALIGN="center">Dynamic Clock Script</H2>

<FORM NAME="clock">
  <CENTER>
  <B>Clock Output</B> (updates every second)<BR>
  <BR>
  <INPUT TYPE="text" NAME="result"  SIZE=18>  <BR><BR>
  <INPUT TYPE="text" NAME="result2" SIZE=39>  <BR><BR>
  <INPUT TYPE="text" NAME="result3" SIZE=50>
  </CENTER>
</FORM>
</HTML>

