<!--
//Functions in this file:
//
//ShowDate
//ShowGreeting
//ShowNewIcon
//ShowPrinterFriendly
//ShowSearch
//ShowCountdown (not used)


function ShowDate(format){
	if(format==1){
		//Friday
		getDay="";
		getMonth="";
		today = new Date();
		weekday = today.getDay();
		if (weekday == 0) getDay='Sunday';
		if (weekday == 1) getDay='Monday';
		if (weekday == 2) getDay='Tuesday';
		if (weekday == 3) getDay='Wednesday';
		if (weekday == 4) getDay='Thursday';
		if (weekday == 5) getDay='Friday';
		if (weekday == 6) getDay='Saturday';
		document.write (getDay);
		
	}else if (format==2){
		//November 5, 2004 
		getMonth="";
		today = new Date();
		weekday = today.getDay();
		month = today.getMonth();
		if (month == 0) getMonth='January';
		if (month == 1) getMonth='Febuary';
		if (month == 2) getMonth='March';
		if (month == 3) getMonth='April';
		if (month == 4) getMonth='May';
		if (month == 5) getMonth='June';
		if (month == 6) getMonth='July';
		if (month == 7) getMonth='August';
		if (month == 8) getMonth='September';
		if (month == 9) getMonth='October';
		if (month == 10) getMonth='November';
		if (month == 11) getMonth='December';
		date = today.getDate();
		year=today.getFullYear();
		document.write (getMonth,' ',date,', ',year);
		
	}else if (format==3){
		//Friday, November 5, 2004
		getDay="";
		getMonth="";
		today = new Date();
		weekday = today.getDay();
		if (weekday == 0) getDay='Sunday';
		if (weekday == 1) getDay='Monday';
		if (weekday == 2) getDay='Tuesday';
		if (weekday == 3) getDay='Wednesday';
		if (weekday == 4) getDay='Thursday';
		if (weekday == 5) getDay='Friday';
		if (weekday == 6) getDay='Saturday';
		month = today.getMonth();
		if (month == 0) getMonth='January';
		if (month == 1) getMonth='Febuary';
		if (month == 2) getMonth='March';
		if (month == 3) getMonth='April';
		if (month == 4) getMonth='May';
		if (month == 5) getMonth='June';
		if (month == 6) getMonth='July';
		if (month == 7) getMonth='August';
		if (month == 8) getMonth='September';
		if (month == 9) getMonth='October';
		if (month == 10) getMonth='November';
		if (month == 11) getMonth='December';
		date = today.getDate();
		year=today.getFullYear();
		document.write (getDay,', ',getMonth,' ',date,', ',year);

	}else if (format==4){
		//11/5/2004
		Stamp = new Date();
		year = Stamp.getYear();
		if (year < 2000) year = 1900 + year;
		document.write((Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+ year + ' ');

	}else if (format==5){
		//11/5/2004 12:36 P.M.
		Stamp = new Date();
		year = Stamp.getYear();
		if (year < 2000) year = 1900 + year;
		document.write((Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+ year + ' ');
		var Hours;
		var Mins;
		var Time;
		Hours = Stamp.getHours();
		if (Hours >= 12) {
		Time = " P.M.";
		}
		else {
		Time = " A.M.";
		}
		if (Hours > 12) {
		Hours -= 12;
		}
		if (Hours == 0) {
		Hours = 12;
		}
		Mins = Stamp.getMinutes();
		if (Mins < 10) {
		Mins = "0" + Mins;
		}	
		document.write(Hours + ":" + Mins + Time);	

	}else if (format==6){
		//2004
		Stamp = new Date();
		year = Stamp.getYear();
		if (year < 2000) year = 1900 + year;
		document.write(year);
	}
	
}


function ShowGreeting(){

	//Good afternoon
	
	datetoday = new Date();
	timenow=datetoday.getTime();
	datetoday.setTime(timenow);
	thehour = datetoday.getHours();
	if (thehour >= 18) display = "evening";
	else if (thehour >=12) display = "afternoon";
	else display = "morning";
	var greeting = ("Good " + display );
	
	document.write(greeting); 		
}


function ShowNewIcon(newIcon,showUntilDate){

	//alert("newIcon = " + newIcon);
	//alert("showUntilDate = " + showUntilDate);
	
	expdate = new Date(showUntilDate);
	curdate = new Date();
	
	//alert("expdate = " + expdate);
	//alert("curdate = " + curdate);
	
	if (expdate.getTime() > curdate.getTime())
	document.write("<img src=" + newIcon + ">&nbsp;");
}


function ShowPrinterFriendly(format,PFicon,PFText,PageName,txtColor){

	//alert("format = " + format);
	//alert("PFicon = " + PFicon);
	//alert("PFText = " + PFText);
	//alert("PageName = " + PageName);
	
	if(PFicon != "")
		document.write("<a href=default.asp?page=" + PageName + "&Printable=true target=_blank><img src=" + PFicon + " border=0></a>");
	if (PFicon != "" && PFText != "")
		document.write(" ");
	if(PFText != "" && format == 1)
		document.write("<a href=default.asp?page=" + PageName + "&Printable=true onMouseOver=\" window.status='" + PFText + "'; return true\" onMouseOut=\"window.status=' '; return true\" target=_blank>" + PFText + "</a>");
		//document.write("<a href=default.asp?page=" + PageName + "&Printable=true style=\"color:#" + txtColor + "\" onMouseOver=\" window.status='" + PFText + "'; return true\" onMouseOut=\"window.status=' '; return true\" target=_blank>" + PFText + "</a>");
	if(PFText != "" && format == 2)
		document.write("<a href=default.asp?page=" + PageName + "&Printable=true style=\"text-decoration:none\" onMouseOver=\" window.status='" + PFText + "'; return true\" onMouseOut=\"window.status=' '; return true\" target=_blank>" + PFText + "</a>");
		//document.write("<a href=default.asp?page=" + PageName + "&Printable=true style=\"text-decoration:none;color:#" + txtColor + "\" onMouseOver=\" window.status='" + PFText + "'; return true\" onMouseOut=\"window.status=' '; return true\" target=_blank>" + PFText + "</a>");
}


function ShowSearch(format,blurb){

	if(format==1 && blurb==0){
		//small search input box
		document.write("<input type=text size=10 name=SearchField index=0> <input type=button value=Go name='btnSearch' onclick=\"javascript:window.location='default.asp?Page=Search&SearchField=' + document.main.SearchField.value;\">");
	}else if (format==2 && blurb==0){
		//large search input box
		document.write("<input type=text size=40 name=SearchField1 index=0> <input type=button value=Search name='btnSearch' onclick=\"javascript:window.location='default.asp?Page=Search&SearchField=' + document.main.SearchField.value;\">"); 
	}else if (format==1 && blurb==1){
		//small search input box for Blurbs
		document.write("<input type=text size=10 name=SearchField index=0> <input type=button value=Go name='btnSearch' onclick=\"javascript:window.location='default.asp?Page=Search&SearchField=' + document.main.SearchField1.value;\">"); 
	}else if (format==2 && blurb==1){
		//large search input box for Blurbs
		document.write("<input type=text size=40 name=SearchField1 index=0> <input type=button value=Search name='btnSearch' onclick=\"javascript:window.location='default.asp?Page=Search&SearchField=' + document.main.SearchField1.value;\">"); 
	}else{
		//alert("ShowSearch Else");
	}
	if(format==1){document.main.SearchField.focus()}
	if(format==2){document.main.SearchField1.focus()}
}





function ShowCountdown(TheMonth,TheDay,TheYear,BeforeText,AfterText,DisplayNextYear){

	//	ShowCountdown(1,2,3,4,5,6) 
	//	1. Countdown month(1-12).
	//	2. Countdown day  (1-31).
	//	3. Countdown year (9999).
	//	4. Message to go after the countdown words ___ days ("left until Christmas"). Put in quotes.
	//	5. Message to be displayed when the day is reached ("Happy Holidays!"). Put in quotes.
	//	6. After the date is reached, should the year be calculated for the next year? (true or false, no quotes).
	//	   This would work for occasions that are on the same date every year, such as Christmas or birthdays.
	//     If false, the days and text would not display after the countdown date.
	
	var today=new Date()
	var theoccasion=new Date(TheYear, TheMonth, TheDay)
	var beforeOccasionText = BeforeText;
	var onOccasiontext = AfterText;

	var monthtext=new Array("Jan","Feb","Mar","April","May","June","July","Aug","Sep","Oct","Nov","Dec")
	theoccasion.setMonth(theoccasion.getMonth()-1) //change to 0-11 month format

	var one_day=1000*60*60*24
	var calculatediff=""

	calculatediff=Math.ceil((theoccasion.getTime()-today.getTime())/(one_day))
	
	if(DisplayNextYear==true){
		if (calculatediff<0){ //if bday already passed
			var nextyeartoday=new Date()
			nextyeartoday.setFullYear(today.getFullYear()+1)
			calculatediff=Math.ceil((nextyeartoday.getTime()-today.getTime())/(one_day)+calculatediff)
		}
	}

	//Display message accordingly
	var pluraldayornot=(calculatediff==1)? "day" : "days"
	if (calculatediff>0)
		document.write(calculatediff+" "+pluraldayornot+" "+beforeOccasionText)
	else if (calculatediff==0)
		document.write(onOccasiontext)

}


// -->
