function doDate(x)
{
  for (i=0;i<num;i++) {
    dt = new Date();
  
    if (offsetA[i] != 0) {
      gt = dt.getTime();
      gt = gt + offsetA[i];
      dt.setTime(gt);
      }
  
    clockA[i].date.value = dt.toGMTString();
    }

  tid=window.setTimeout("doDate()",speed);
}

function start() {
  clockA[num] = document.forms["form"+num];
  //offsetA[num] = 0;
//window.alert( (new Date()).getTimezoneOffset());
d = new Date();
  if (navigator.appVersion.substring(0,3) == "2.0")
    offsetA[num] = (d.getTimezoneOffset()*60*1000);
  else
    offsetA[num] = -(d.getTimezoneOffset()*60*1000);
  if (num == 0)  
    tid=window.setTimeout("doDate()",speed);
  num++;
}

function startLong(diff) {
//window.alert("hay" + (new Date()).toGMTString());
  clockA[num] = document.forms["form"+num];
  //offsetA[num] = (diff - dd.getTimezoneOffset())*60*1000;
  offsetA[num] = (diff)*60*1000;
  //offsetA[num] = (-diff)* 60*1000;
  if (num == 0)  
    tid=window.setTimeout("doDate()",speed);
  num++;
}

function cleartid() {
  window.clearTimeout(tid);
}
 
// for some reason on some pages this crashes netscape
function Clock()
{
  document.write('<FORM name=form'+num+'><input name=date size=')
  document.write(len)
  document.write(' value="Clock: Requires Javascript"></FORM>')
  start();
}
 
// for some reason on some pages this crashes netscape
function ServerClock(diff)
{
  document.write('<FORM name=form'+num+'><input name=date size=')
  // we chop the end, because it would be the wrong timezone
  document.write(35);
  //document.write(19)
  document.write(' value="Clock: Javascript"  style="border:none;background-color:transparent;"></FORM>')
  startLong(diff*60);
}
// end-->

