//Made by David Mazza
//Some code provided by: 
//The JavaScript Source :: http://javascript.internet.com
//and Nate Baldwin :: http://www.mindpalette.com

var Today=new Date();
var ThisDay=Today.getDay()+1;
var ThisDate=Today.getDate();
var ThisMonth=Today.getMonth()+1;
var ThisYear=Today.getFullYear();  //included if you wish to insert the year
function DayTxt (DayNumber) {
var Day=new Array();
Day[1]="Sunday";
Day[2]="Monday";
Day[3]="Tuesday";
Day[4]="Wednesday";
Day[5]="Thursday";
Day[6]="Friday";
Day[7]="Saturday";
return Day[DayNumber];
}
var DayName=DayTxt(ThisDay);
function MonthTxt (MonthNumber) {
var Month=new Array();
Month[1]="January";
Month[2]="February";
Month[3]="March";
Month[4]="April";
Month[5]="May";
Month[6]="June";
Month[7]="July";
Month[8]="August";
Month[9]="September";
Month[10]="October";
Month[11]="November";
Month[12]="December";
return Month[MonthNumber];
}
var MonthName=MonthTxt(ThisMonth);
var d = new Date();
var h = d.getHours();
var m = d.getMinutes();
var t = (h*100)+m;

document.write("<b>"+DayName+" "+MonthName+" "+ThisDate+", "+ThisYear+" - </b>");

/* end day, begin greeting */

/*check week or weekend*/
if (ThisDay > 1 && ThisDay < 7 ) week ();
else if (t < 200) document.write("<b>"+"Good morning! Yes, it's way past midnight."+"</b>"+"</P>");
else if (t < 300) document.write("<b>"+"Good morning!"+"</b>"+"</P>");
else if (t < 700) document.write("<b>"+"Good morning! Up bright and early!"+"</b>"+"</P>");
else if (t < 1200) document.write("<b>"+"Good morning!"+"</b>"+"</P>");
else if (t < 1700) document.write("<b>"+"Good afternoon!"+"</b>"+"</P>");
else if (t < 2359) document.write("<b>"+"Good evening!"+"</b>"+"</P>");
else document.write("<P ALIGN=center>"+"<b>"+"Hello! It is 11:59pm."+"<br>"+"Please <a  href=mailto:sbeecher@longwoodcsd.com?subject=Bug%20(GR33T1NG)%20found%20on%20the%20LHS%20Site&body=Please%20press%20send!%20You%20may%20put%20comments%20below:>click here</a> to notify the webmaster if it is not."+"</b>"+"</P>");
//  End 

function week ()
{
if (t < 200) document.write("<b>"+"Good evening!"+"</b>"+"</P>");
else if (t < 300) document.write("<b>"+"Good morning!"+"</b>"+"</P>");
else if (t < 630) document.write("<b>"+"Good morning! Up bright and early!"+"</b>"+"</P>");
/*school day*/
else if (t < 710) document.write("<b>"+"Good Morning!"+"<br>"+"1st period begins soon"+"</b>"+"</P>");
else if (t < 749) document.write("<b>"+"Good Morning!"+"<br>"+"Period 1"+"</b>"+"</P>");
else if (t < 837) document.write("<b>"+"Good Morning!"+"<br>"+"Period 2"+"</b>"+"</P>");
else if (t < 920) document.write("<b>"+"Good Morning!"+"<br>"+"Period 3"+"</b>"+"</P>");
else if (t < 1003) document.write("<b>"+"Good Morning!"+"<br>"+"Period 4"+"</b>"+"</P>");
else if (t < 1046) document.write("<b>"+"Good Morning!"+"<br>"+"Period 5"+"</b>"+"</P>");
else if (t < 1129) document.write("<b>"+"Good Morning!"+"<br>"+"Period 6"+"</b>"+"</P>");
else if (t < 1200) document.write("<b>"+"Good Morning!"+"<br>"+"Period 7"+"</b>"+"</P>");
else if (t < 1212) document.write("<b>"+"Good Afternoon!"+"<br>"+"Period 7"+"</b>"+"</P>");
else if (t < 1255) document.write("<b>"+"Good Afternoon!"+"<br>"+"Period 8"+"</b>"+"</P>");
else if (t < 1338) document.write("<b>"+"Good Afternoon!"+"<br>"+"Period 9"+"</b>"+"</P>");
/*else if (t < ) document.write("<P ALIGN=center>"+"<b>"+" "+"<br>"+" "+"</b>"+"</P>");*/
/*evening*/
else if (t < 1700) document.write("<b>"+"Good afternoon!"+"<br>"+"The period is displayed here during school hours."+"</b>"+"</P>");
else if (t < 2359) document.write("<b>"+"Good evening!"+"</b>"+"</P>");
else document.write("<P ALIGN=center>"+"<b>"+"Hello! Unless it is 11:59pm, you should not be getting this message."+"<br>"+"Please <a href=mailto:sbeecher@longwoodcsd.com?subject=Bug%20(GR33T1NG)%20found%20on%20the%20LHS%20Site&body=Please%20press%20send!%20You%20may%20put%20comments%20below:>click here</a> to notify the webmaster"+"</b>"+"</P>");
return 0;
}

