// Time-stamp: <current.js, 2007-05-01 19:19:49 MDT, rhayes>

var now = new Date();
var month = now.getMonth() + 1;
var day = now.getDate();
var year = now.getYear();
year = fixY2K(year);

if (10 > month) month = "0" + month;
if (10 > day) day = "0" + day;

var date_string = month + "/" + day + "/" + year ;

document.write("The current date is " + date_string)

function fixY2K(number) {
  if (number < 1000) {
    number = number + 1900;
  }
  return number;
}

/////////////////////////////////////////////////////////////////////////
// For countdown since last update
// Put your event date in the head of the HTML file calling this function
// var eventdate= new Date("May 1, 2007 16:37:00 MDT"); 
// set to 0 to turn clock off or set to 1 to turn clock on
var clock_on = 1;

function toSt(n) {
  s = ""
  if(n<10) s += "0"
    return s+n.toString();
}

function countdown() {
  if (clock_on) {
    cl = document.clock;
    d = new Date();
    count = Math.floor((d.getTime()-eventdate.getTime())/1000);
    if(count <= 0) 
    {
      cl.days.value = "----";
      cl.hours.value = "--";
      cl.mins.value = "--";
      cl.secs.value = "--";
      return;
    }
    cl.secs.value=toSt(count%60);
    count=Math.floor(count/60);
    cl.mins.value=toSt(count%60);
    count=Math.floor(count/60);
    cl.hours.value=toSt(count%24);
    count=Math.floor(count/24);
    cl.days.value=count;
    setTimeout("countdown()",500);
  }
}
/////////////////////////////////////////////////////////////
