// =====================================================
// All contents copyright © 2001. All rights reserved.
// Adapted form Kris Klimaszewski's personal web site.
// =====================================================
// time.js

var dayName_g = new Array ("SUN","MON","TUE",
                           "WED","THU",
                           "FRI","SAT");
var monName_g = new Array ("JAN","FEB","MAR","APR","MAY","JUN",
                           "JUL","AUG","SEP","OCT","NOV","DEC");


function CreateTimeString(){
  if (!document.layers && !document.all && !document.getElementById) { return }
  var now = new Date();
  var hours = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds();
  var ampm = "AM";

  if (hours > 12){ ampm = "PM"; hours = hours - 12; }
  if (hours == 0) { hours = 12; }
  if (minutes <= 9) { minutes = "0" + minutes; }
  if (seconds <= 9) { seconds = "0" + seconds; }
  month = monName_g[now.getMonth()];
  dayofweek = dayName_g[now.getDay()];
  dayofmonth = now.getDate();
  if ((year = now.getYear()) < 1900) { year += 1900; }

  //change font size here to your desire
  timestr = ""
    + "<span class='sparseHead'"
    + "'>"
    + dayofweek + ",&nbsp;"
    + month + "&nbsp;"
    + dayofmonth + ",&nbsp;"
    + year + "&nbsp;"
    + hours + ":"
    + minutes + ":"
    + seconds + "&nbsp;"
    + ampm + "</span>"

  return timestr;
}

function FIND(item) {
  if (document.all) return(document.all[item]);
  if (document.getElementById) return(document.getElementById(item)); // For NS6
  return(false);
}

function ShowTime() {
  timestr = CreateTimeString();
  lt = FIND("liveTime");
  if (document.getElementById) {	// *** NS6 & MS5
    lt.style.left = time_x;		// global to enable local control
    lt.style.top = time_y;
    lt.innerHTML = timestr;
  } else if (document.layers){	// *** NS4
    document.liveTime.left = time_x;
    document.liveTime.top = time_y;
    document.layers.liveTime.document.write(timestr)
    document.layers.liveTime.document.close()
  } 

  setTimeout("ShowTime()",1000)
}


// eof
