document.write("<div id='dt_div'>Getting date......</div>");
setInterval('showDate()', 1000);

//SET SOME STYE PARAMETERS FOR THE DT DISPLAY
var dtObj = document.getElementById('dt_div')
dtObj.style.fontFamily = 'verdana';
dtObj.style.color = '#ffffff';
dtObj.style.fontSize = '8pt';
dtObj.style.fontWeight = 'bold';

function showDate()
{
  //ARRAYS, OBJECTS & ELEMENTS
  var theDay = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  var theMonth = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  var time = document.getElementById("time");

  //DATE
  var today = new Date();
  var day = today.getDay();
  var daydate = today.getDate();
  var month = today.getMonth();
  var year = today.getFullYear();

  //TIME
  var hh = today.getHours();
  var mm = today.getMinutes();
  var ss = today.getSeconds();
  hh = (hh < 10) ? '0' + hh : hh;
  mm = (mm < 10) ? '0' + mm : mm;
  ss = (ss < 10) ? '0' + ss : ss;

  //SETUP VARIOUS DATE/TIME DISPLAY OPTIONS
  //DATE EXT
  var Ldaydate = daydate
  if (daydate == 1 || daydate == 21 || daydate == 31)
  {
  	 Ldaydate = daydate + "st";
  }
  else if (daydate == 2 || daydate == 22)
  {
  	 Ldaydate = daydate + "nd";
  }
  else if (daydate == 3 || daydate == 23)
  {
  	 Ldaydate = daydate + "rd";
  }
  else
  {
  	 Ldaydate = daydate + "th";
  }
  //LONG DATE
  var longDate = theDay[day] + " " + Ldaydate + " " + theMonth[month] + " " + year;
  //SHORT DATE
  var shortDate = theDay[day].substring(0,3) + " " +
                  daydate + " " + theMonth[month].substring(0,3) + " " +
                  String(year).substring(2,4);
  //TIME
  var theTime = hh + ":" + mm;
  //TIME WITH SECONDS
  var theTime_ss = hh + ":" + mm + ":" + ss;

  //SET ELEMENT VALUE ON WEB PAGE TO BE DISPLAYED
  dt_div.innerHTML = longDate + "<BR>" + theTime_ss;
  //dt_div.innerHTML = longDate + " " + theTime_ss;
  
  //SET MESSAGE - OPTIONAL
  var showmsg = "";
  if (theDay[day] == "Monday")
  {
  	 showmsg = "Jeeeeeeeeeeeeeeeesus! another week ahead...."
  }
  else if (theDay[day] == "Wednesday")
  {
  	 showmsg = "Grrrrrrrrrrreat! half the week has gone...."
  }
  else if (theDay[day] == "Friday")
  {
  	 showmsg = "Yeeeeeeea-Haaaa! It's nearly the weekend...."
  }
}
