// display current time at author location
// =======================================
// copyright Stephen Chapman, Felgall Pty Ltd, 11 July 2001, 25th November 2004
// http://www.felgall.com/ and http://javascript.about.com/
// permission is given to use this script
// provided that all comment lines in the script are retained

function myTime() {
var dst = 0;       // set to 1 for daylight savings time
                   // update this as you go on and off daylight saving time

var loc = ''; // set to your location
var mtz = -5;      // set to your local timezone (hours ahead of UTC, negative if behind)
var stdz = 'EST'; // standard time indicator

var d=new Date()
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new Array("Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sep.","Oct.","Nov.","Dec.")
document.write(monthname[d.getMonth()] + " ")
document.write(d.getDate() + ", ")
document.write(d.getFullYear() + "&nbsp;&nbsp;")

// do not alter anything below this line
document.writeln(' <span id="time">' + setDsp(mtz,dst,stdz,Date) + '<\/span>');
if (DOMsupported) setTimeout('updDsp('+mtz+','+dst+',"'+stdz+'")',5000);
}

var DOMsupported = 0;var standardDOMsupported = 0;var ieDOMsupported = 0;
if (document.getElementById) {standardDOMsupported = 1; DOMsupported = 1;}
else { if (document.all) {ieDOMsupported = 1; DOMsupported = 1;}
}
function findDOM(objectId) {
if (standardDOMsupported) {return (document.getElementById(objectId));}
if (ieDOMsupported) {return (document.all[objectId]);}
}

function updDsp(mtz,dst,stdz) {
var obj = findDOM('time');
obj.innerHTML = setDsp(mtz,dst,stdz);
setTimeout('updDsp('+mtz+','+dst+',"'+stdz+'")',5000);
}
function setDsp(mtz,dst,stdz) {
var dayname = new Array ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');
var now = new Date;
now.setUTCMinutes(now.getUTCMinutes() + (mtz + dst)*60);
var dow = now.getUTCDay();
var minute = now.getUTCMinutes();
var hour = now.getUTCHours();
if (hour > 11) {ampm = 'PM'; hour -= 12;} else {ampm = 'AM'}
if (hour == 0) {hour = 12;} if (minute < 10) {pad = ':0';} else {pad = ':';}
var txt = hour + pad + minute + ' ' + ampm;

return (txt);
}


function todaysDate() {

	var tDate = new Date();
	var tMonth;

	switch (tDate.getMonth()) {
		case 0 : tMonth = 'January '; break;
		case 1 : tMonth = 'February '; break;
		case 2 : tMonth = 'March '; break;
		case 3 : tMonth = 'April '; break;
		case 4 : tMonth = 'May '; break;
		case 5 : tMonth = 'June '; break;
		case 6 : tMonth = 'July '; break;
		case 7 : tMonth = 'August '; break;
		case 8 : tMonth = 'September '; break;
		case 9 : tMonth = 'October '; break;
		case 10 : tMonth = 'November '; break;
		case 11 : tMonth = 'December '; break;
	}

	var tDay = tDate.getDate();
	var tYear = tDate.getFullYear();

	return (tMonth + tDay + ', ' + tYear);
}
