<!-- Hide from old browsers
/* Because this is a function you need to have in the <body> tag <body onLoad="timedate()"> , and
   the following lines of code located at the display area of the page.
<span id="timedate">
  <script language="JavaScript" src="scripts/time-date.js" type="text/javascript">
  </script>
</span>
*/
function timedate() {
var time = new Date();
var day = time.getDay();
var days = time.getDate();
var mon = time.getMonth();
var year = time.getYear();
var hour = time.getHours();
var mins = time.getMinutes();
var secs = time.getSeconds();
var apm = "am"; /* am or pm, am is the default. */
var ending; /* st, nd, rd, etc. */
var wkd; /* The weekday. */
var dn = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");  /* Create an array of the days */
wkd = dn[day];  /* The weekday is the array of days at the numerical day, giving us the alphabetical day of the week */
if (hour > 11) { apm = "pm"; }  /* If it is less than 11 'o clock, it is pm */
if (secs <= 9) { secs = "0" + secs; } /* Adding a 0 in front so it looks nicer */
if (mins <= 9) { mins = "0" + mins; } /* Adding a 0 in front so it looks nicer */
if (hour > 12) { hour = hour - 12; } /* 24/12 hour adjustment */
if (hour == 0) { hour = 12; } /* Because we subtracted 12 we need to make it visibly 12 */
if (year < 1000) {year += 1900;} /* corrects potential display error in non IE browsers*/

var mon_array= new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");  /* Our array of Months */

mon=mon_array[mon]; /* Sets the name of the month to our mon_array at the numerical month */

if (days == 1 || days == 21 || days == 31) { ending = "st"; }  /* Made less if statements */
if (days == 2 || days == 22) { ending = "nd"; }                /* here. */
if (days == 3 || days == 23) { ending = "rd"; }                /**/
if (days >= 4 && days <= 20) { ending = "th"; }                /**/
if (days >= 24 && days <= 30) { ending = "th"; }               /**/
document.getElementById('timedate').innerHTML=(hour + ":" + mins + ":" + secs + "&nbsp;" + apm + "&nbsp;" + wkd + "&nbsp;" + days + ending + "&nbsp;" + mon + "&nbsp;" + year);  /* Combines the variables into one text and puts in the HTML of the <span> called timedate */

setTimeout("timedate()", 1000);  /* Refreshes the time every 1000 millisecons (1 sec.), so that when the minute/hour etc. changes the clock updates on the page. */
}
// -->