/* //:::::::::::   digitalTime & digitalDate   :::::::::::\\
                  by Micah Goulart

	This script can be used as long as this
	disclaimer is left untouched.
	For bug reports or custom scripts, email me at:
	micahgoulart@mailbr.com.br

   //:::::::::::   copyright 1999   :::::::::::\\	*/


var week = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]

var month = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]

function digitalDate(layer)
{	var today = new Date()
	year = today.getYear()
	month_i = today.getMonth()
	week_i = today.getDay()
	day = today.getDate()
	
	day += ""; /* |mg| */ digit = day;
	
	suffix = "th";
	if (digit == 1 || digit == 21 || digit == 31) suffix = "st";
	if (digit == 2 || digit == 22) suffix = "nd";
	if (digit == 3 || digit == 23) suffix = "rd";
	
//	date_str = "<FONT CLASS=digDate><FONT CLASS=digText>Current Date:&nbsp;</FONT>" + week[week_i] + ", " + day + suffix + " of " + month[month_i] + " 19" + year + "</FONT>"
	date_str = "<FONT CLASS=digDate><FONT CLASS=digText></FONT>" + month[month_i] + " " + day + ", " + year + "</FONT>"
	
	if (document.layers)
	{	document.layers.digDate.document.write(date_str)
		document.layers.digDate.document.close()	}		
	if (document.all) digDate.innerHTML = date_str;

	digitalTime()	}

function digitalTime()
{	if (!document.layers && !document.all) return
	var today = new Date()
	hour = today.getHours()
	minutes = today.getMinutes()
	seconds = today.getSeconds()
 	var dn = "am";

	if (hour > 12)
	{	dn = "pm";
		hour = hour - 12;	}
	if (hour == 0) hour = 12
	if (minutes <= 9) minutes = "0" + minutes
	if (seconds <= 9)	seconds = "0" + seconds

//	clock_str = "<FONT CLASS=digTime><FONT CLASS=digText>Current Time:&nbsp;</FONT>" + hour + ":" +	minutes + ":" + seconds + " " + dn + "</FONT>";
	clock_str = "<FONT CLASS=digTime><FONT CLASS=digText></FONT>" + hour + ":" +	minutes + ":" + seconds + " " + dn + "</FONT>";

	if (document.layers)
	{	document.layers.digTime.document.write(clock_str)
		document.layers.digTime.document.close()	}		
	else if (document.all) digTime.innerHTML = clock_str;
			
	setTimeout("digitalTime()", 1000)	}

window.onload = digitalDate;
