// Time Stuff
var aDays	= new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var aMonths	= new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var cGreeting 	= "Hello"

function FormatDateTime() {
	var dDate		= new Date()
	var nYear		= dDate.getYear()
	if (nYear < 1000) {
		nYear+=1900
	}
	var nMonth		= dDate.getMonth()
	var nDay		= dDate.getDay()
	var nHours		= dDate.getHours()
	var nMins		= dDate.getMinutes()
	var nSecs		= dDate.getSeconds()
	var cAmPm		= "am"
	var nDaysMonth	= dDate.getDate()
	switch (nDay){
		case 1 :
			var cSuffix = "st"
			break
		case 21 :
			var cSuffix = "st"
			break
		case 31 :
			var cSuffix = "st"
			break
		case 2 :
			var cSuffix = "nd"
			break
		case 22 :
			var cSuffix = "nd"
			break
		case 3 :
			var cSuffix = "rd"
			break
		case 23 :
			var cSuffix = "rd"
			break
		default:
			var cSuffix = "th"
	}
	cSuffix=""

	if (nDaysMonth < 10) {
		nDaysMonth = "0" + nDaysMonth
	}
	if (nHours >= 0 && nHours < 12) {
		cGreeting = "Good morning"
	}
	if (nHours >= 12 && nHours < 18) {
		cGreeting = "Good afternoon"
	}
	if (nHours >= 18 && nHours < 23) {
		cGreeting = "Good evening"
	}
	if (nHours >= 12) {
		cAmPm = "pm"
	}
	if (nHours > 12) {
		nHours = nHours - 12
	}
	if (nHours == 0) {
		nHours = 12
	}
	if (nMins <= 9) {
		nMins = "0" + nMins
	}
	if (nSecs <= 9) {
		nSecs = "0" + nSecs
	}
	//change font size here
	return aDays[nDay] + " " + nDaysMonth + "<sup>" + cSuffix + "</sup> " + aMonths[nMonth] + " " + nYear+" " + nHours + ":" + nMins + ":" + nSecs + " " + cAmPm

}

function GetTheDateTime() {
	var cDate = FormatDateTime()
	document.all.datetime.innerHTML = cDate
}

function SetClock(){
	if (document.all||document.getElementById) {
		GetTheDateTime()
		setInterval("GetTheDateTime()",1000)
	}
}


function SearchIt() {
window.location.href='search.asp?ferretthis='+document.frmSearch.search.value+'&where=0&submit=Go&onwhat=all&andor=allwords'
}

function StatusBar(cMessage) {
window.status=cMessage
}

// Set Clock!!!!
SetClock()
