speed=1000;
//len=28;
len=25;
tid = 0;
num=0;
clockA = new Array();
offsetA = new Array();
dd = new Date();
day = new Array();
day[0]='Sun';
day[1]='Mon';
day[2]='Tue';
day[3]='Wed';
day[4]='Thu';
day[5]='Fri';
day[6]='Sat';
function doDate(x)
{
  for (i=0;i<num;i++) {
    dt_1 = new Date();
        gmt_offset = dt_1.getTimezoneOffset();
    dt = new Date();
        if (gmt_offset != 0) {
      gt = dt.getTime();
      gt = gt + (gmt_offset*60*1000);
      dt.setTime(gt);
      }
    if (offsetA[i] != 0) {
      gt = dt.getTime();
      gt = gt + offsetA[i];
      dt.setTime(gt);
      }
     todate1 = new Date(dt);
   // clockA[i].date.value = dt.toGMTString();
        if (todate1.getHours()<=9) {
         hours = '0' + todate1.getHours();
        } else {
		 hours = todate1.getHours();
        }
        if (todate1.getMinutes()<=9) {
         minutes = '0' + todate1.getMinutes();
        } else {
		 minutes = todate1.getMinutes();
        }
clockA[i].date.value = day[todate1.getDay()]+'   ' + hours + ': ' + minutes;
   //alert('date is '+ dt.toGMTString()+ ' ' +clockA[i].date.value+ ' ' + todate1.getHours() );
    }
  tid=window.setTimeout("doDate()",speed);
}
function startLong(diff) {
  clockA[num] = document.forms["form"+num];
  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 ServerClock(diff)
{
  document.write('<form name=form'+num+'><input type="text" name=date size=')
  // we chop the end, because it would be the wrong timezone
  document.write(10);
  //document.write(19)
  //document.write(' value="Clock: JavaScript"> ')
  document.write(' value=" Clock: "> ')
  document.write(' </form>')
  startLong(diff);
}

