// JavaScript Document

<!--
//[created by shelly mcconnell for OCC Library Web site redesign ON AUGUST 3, 2009]
 
//this script will write date to page
var rightnow= new Date();
var weekday= rightnow.getDay();
var themonth= rightnow.getMonth();
var thedate= rightnow.getDate();
var theyear= rightnow.getFullYear();
//Script for Regular Monday - Thursday Hours: 8:00 a.m.-9:00 p.m.
var regHours="8:00am - 9:00pm";
//Script for Regular Monday - Thursday Hours: 8:00 a.m.-8:00 p.m.
var sumHours="8:00am - 8:00pm";
//Script for Friday Hours: 8:00 a.m-4:30 p.m.
var friHours="8:00am - 4:30pm";
//Script for Saturday Hours: Closed
var satHours=" - Closed";
//Script for Sunday & Additional Weekend Hours: Noon-4:00 p.m.
var sunHours="Noon - 4:00pm";
//Set the Days of the Week
var someday= new Array(7)
someday[0]="Sunday";
someday[1]="Monday";
someday[2]="Tuesday";
someday[3]="Wednesday";
someday[4]="Thursday";
someday[5]="Friday";
someday[6]="Saturday";
 
//Set Month Name
var month= new Array(12)
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";
 
//Set month numbers to be Recognizable
themonth+=1;

document.write(month[themonth]+" "+thedate+","+" "+theyear);
document.write("<br>");
document.write("<a href=\"http://library.sunyocc.edu/about/hours/index.php\" target=\"_blank\">Today's Hours</a>");

 
/*SOME INSTRUCTIONS AND CLARIFICATIONS -- 
 
If you want to create a particular date that the library is closed or the hours are different, fill in the date at "if(thedate==00). Otherwise leave the zero's where you aren't using any special dates.
 
If you want to fill in a weeks worth of dates for Winter/Spring break, go to the dates in the parenthesis "else if ((thedate>=00) && (thedate<==00))" and fill in at the "greater than" section the first day of the break and then less "than for the last day of the break. Otherwise, keep those numbers as zero's if you're not using those dates.*/
 
//For the Month of January
if(themonth==1) 											
{ 
	if(thedate==00)			         //for a special Date 0/00/2009 that the library is closed	                             	                                                                     
	{										                    
	  document.write(" "+satHours);	        //Closed
	}
  else if((thedate>=00) && (thedate<=00))    //During a Break
	{																			     // January 00 - January 00
    document.write(" "+friHours);       //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Friday")            //for Friday's
	{				 
		document.write (" "+friHours);            //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Saturday")       //for Saturday's
	{
   	document.write(" "+satHours);           //Library Hours Closed
	}
	else if(someday[weekday]=="Sunday")        //for Sunday's
	{
 		document.write(" "+sunHours);          //Library Hours Noon - 4:00pm
	}
	else if(someday[weekday]=="Monday")       //for Monday's-Thursday's                          
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if(someday[weekday]=="Tuesday")                                 
	{
		document.write(" "+regHours);          
	}
	else if (someday[weekday]=="Wednesday")                                 
	{
		document.write(" "+regHours);              
	}
	else if(someday[weekday]=="Thursday")                                  
	{
		document.write(" "+regHours);          
	}
}
//For the Month of February
if(themonth==2) 											
{ 
	if(thedate==00)			           //For a Special Date that the Library is closed
	{										              //x/x/200x(Saturday) - Closed 
	  document.write(" "+satHours);	 //Closed
	}
  else if((thedate==00) || (thedate<=00))  //for more special days (change Hours if nec.)
	{																			    // Month xx - Month xx
    document.write(" "+friHours);        //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Friday")      //for Friday's
	{				 
		document.write(" "+friHours);          //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Saturday")   //for Saturday's 
	{
   	document.write(" "+satHours);           //Library Hours Closed
	}
	else if(someday[weekday]=="Sunday")        //for Sunday's
	{
 		document.write(" "+sunHours);          //Library Hours Noon - 4:00pm
	}
	else if(someday[weekday]=="Monday")       //for Monday's-Thursday's                          
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if(someday[weekday]=="Tuesday")                                 
	{
		document.write(" "+regHours);         
	}
	else if(someday[weekday]=="Wednesday")                                 
	{
		document.write(" "+regHours);            
	}
	else if(someday[weekday]=="Thursday")                                
	{
		document.write(" "+regHours);         
	}
}
//For the Month of March																			 
else if(themonth==3) 											
{ 
	if(thedate==00)			                 //Special Date 3/15/2009(Saturday) - Closed
	{										               
	  document.write("<br />"+satHours);	     //Closed
	}
  else if((thedate>=00) && (thedate<=00))  //During Spring Break
	{																			     //March xx - March xx
    document.write (" "+friHours);          //Open: 8:00 a.m.-4:30 p.m.
	}
	else if(someday[weekday]=="Friday")     //For Friday's
	{				 
		document.write (" "+friHours);         //Library Hours 8:00am - 4:30pm
	}
	else if (someday[weekday]=="Saturday")  //For Saturday's
	{
   	document.write(" "+satHours);         //Library Hours Closed
	}
	else if (someday[weekday]=="Sunday")   //For Sunday's
	{
 		document.write(" "+sunHours);        //Library Hours Noon-4:00pm
	}
	else if (someday[weekday]=="Monday")   //for Monday's-Thursday's in March                          
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if (someday[weekday]=="Tuesday")                                 
	{
		document.write(" "+regHours);         
	}
	else if (someday[weekday]=="Wednesday")                                
	{
		document.write(" "+regHours);             
	}
	else if (someday[weekday]=="Thursday")                                
	{
		document.write(" "+regHours);         
	}
}
//For The Month of April
if(themonth==4)									
{
	if(thedate==12)											//if date is 4/12/2009
	{														
  	document.write(" "+satHours);		//Library Hours Closed			
  }
 	else if ((thedate==18) || (thedate==25))//Special Days Sat. 4/18/2009 or 4/25/2009
	{
    document.write(" "+sunHours);			 //Library Hours Noon - 4:00pm
  }
	else if(someday[weekday]=="Friday")     //for Friday's
	{				 
		document.write (" "+friHours);         //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Saturday")   //for Saturday's
	{
   	document.write(" "+satHours);            //Library Hours Closed
	}
	else if (someday[weekday]=="Sunday")    //for Sunday's
	{
 		document.write(" "+sunHours);          //Library Hours Noon - 4:00pm
	}
	else if (someday[weekday]=="Monday")       //for Monday's-Thursday's                          
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if (someday[weekday]=="Tuesday")                                 
	{
		document.write(" "+regHours);         
	}
	else if (someday[weekday]=="Wednesday")                                 
	{
		document.write(" "+regHours);             
	}
	else if (someday[weekday]=="Thursday")                                 
	{
		document.write(" "+regHours);         
	}
}
//For The Month of May
if(themonth==5) 											
{ 
	if(thedate==00)			                //For a Special Date that the Library is closed
	{										                    //x/x/200x(Saturday) - Closed 
	  document.write(" "+satHours);	      //Library Hours Closed
	}
  else if((thedate==00) || (thedate==00))    //For Special Days
	{																			      // Day xx and Day xx
    document.write (" "+friHours);       //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Friday")         //for Friday's
	{				 
		document.write (" "+friHours);          //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Saturday")       //for Saturday's 
	{
   	document.write(" "+satHours);          //Library Hours Closed
	}
	else if(someday[weekday]=="Sunday")        //for Sunday's
	{
 		document.write(" "+sunHours);        //Library Hours Noon - 4:00pm
	}
	else if(someday[weekday]=="Monday")       //for Monday's-Thursday's                          
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if(someday[weekday]=="Tuesday")                                 
	{
		document.write(" "+regHours);         
	}
	else if (someday[weekday]=="Wednesday")                               
	{
		document.write(" "+regHours);             
	}
	else if (someday[weekday]=="Thursday")                               
	{
		document.write(" "+regHours);         
	}
}
//The Month of June
if(themonth==6) 											
{ 
	if(thedate==00)			              //For a Special Date that the Library is closed
	{										              //x/x/200x(Saturday) - Closed 
	  document.write("<br />"+satHours);	 //Library Hours Closed
	}
  else if((thedate>=00) && (thedate<=00)) //During a week or a Break
	{																			 // Month xx - Month xx
    document.write (" "+friHours);     //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Friday")    //for Friday's
	{				 
		document.write (" "+friHours);     //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Saturday")  //for Saturday's 
	{
   	document.write(" "+satHours);       //Library Hours Closed
	}
	else if(someday[weekday]=="Sunday")   //for Sunday's
	{
 		document.write(" "+sunHours);     //Library Hours Noon - 4:00pm
	}
	else if(someday[weekday]=="Monday")       //for Monday's-Thursday's                          
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if(someday[weekday]=="Tuesday")                                
	{
		document.write(" "+regHours);         
	}
	else if(someday[weekday]=="Wednesday")                                 
	{
		document.write(" "+regHours);             
	}
	else if(someday[weekday]=="Thursday")                                
	{
		document.write(" "+regHours);         
	}
}
//The Month of July
if(themonth==7) 											
{ 
	if(thedate==00)			                //For a Special Date that the Library is closed
	{										                 //x/x/200x(Saturday) - Closed 
	  document.write(" "+satHours);	    //Library Hours Closed
	}
  else if((thedate>=00) && (thedate<=00))      //During a Break
	{																			        // Month xx - Month xx
    document.write (" "+friHours);            //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Friday")       //for Friday's
	{				 
		document.write (" "+friHours);          //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Saturday")   //for Saturday's 
	{
   	document.write(" "+satHours);          //Library Hours Closed
	}
	else if (someday[weekday]=="Sunday")    //for Sunday's
	{
 		document.write(" "+sunHours);        //Library Hours Noon - 4:00pm
	}
  else if (someday[weekday]=="Monday")       //for Monday's-Thursday's                          
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if (someday[weekday]=="Tuesday")                                 
	{
		document.write(" "+regHours);         
	}
	else if (someday[weekday]=="Wednesday")                                 
	{
		document.write(" "+regHours);             
	}
	else if (someday[weekday]=="Thursday")                                
	{
		document.write(" "+regHours);        
	}  
}
//The Month of August
if(themonth==8) 											
{ 
	if(thedate==00)			               //For a Special Date that the Library is 
	{										                //x/x/200x(Saturday) - Closed 
	  document.write(" "+satHours);	   //Library Hours Closed
	}
  else if((thedate>=03) && (thedate<=06))   //During summer hours
	{																			   // August 3 - 6
    document.write (" "+sumHours);        //Library Hours 8:00 a.m. - 8:00p.m.
	}
   else if((thedate>=10) && (thedate<=14))   //During intercession hours
	{																			   // August 10 - 14
    document.write (" "+friHours);        //Library Hours 8:00 a.m. - 4:30p.m.
	}
   else if((thedate>=17) && (thedate<=21))   //During intercession hours
	{																			   // August 17 - 21
    document.write (" "+friHours);        //Library Hours 8:00 a.m. - 4:30p.m.
	}	
   else if((thedate>=24) && (thedate<=27))   //During intercession hours
	{																			   // August 24 - 28
    document.write (" "+friHours);        //Library Hours 8:00 a.m. - 4:30p.m.
	}	
   else if((thedate>=31) && (thedate<=31))   //During intercession hours
	{																			   // August 31
    document.write (" "+friHours);        //Library Hours 8:00 a.m. - 4:30p.m.
	}	
else if(someday[weekday]=="Friday")       //for Friday's
	{				 
		document.write (" "+friHours);           //Open: 8:00 a.m - 4:30 p.m.
	}
	else if(someday[weekday]=="Saturday")   //for Saturday's 
	{
   	document.write(" "+satHours);           //Library Hours Closed
	}
	else if(someday[weekday]=="Sunday")    //for Sunday's
	{
 		document.write(" "+satHours);         //Library Hours Closed
	}
  else if(someday[weekday]=="Monday")       //for Monday's-Thursday's                          
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if(someday[weekday]=="Tuesday")                               
	{
		document.write(" "+regHours);        
	}
	else if(someday[weekday]=="Wednesday")                                 
	{
		document.write(" "+regHours);             
	}
	else if(someday[weekday]=="Thursday")                                
	{
		document.write(" "+regHours);         
	}                                          
}
//The Month of September
if(themonth==9) 											
{ 
	if(thedate==00)			               //For a Special Date that the Library is closed
	{										                //x/x/200x(Saturday) - Closed 
	  document.write(" "+satHours);	  //Library Hours Closed
	}
  else if((thedate>=01) && (thedate<=04))
	{																			// Sept 01 - sept 04 intercession hours
    document.write (" "+friHours);     //Library Hours 8:00am - 4:30pm
	}
else if((thedate>=06) && (thedate<=07))   //Labor Day and day before
	{																			   // September 07 Labor Day and day before
    document.write (" "+satHours);        //Library Hours Closed
	}	
	else if(someday[weekday]=="Friday")        //for Friday's
	{				 
		document.write (" "+friHours);           //Library Hours 8:00am - 4:30pm
	}
	else if (someday[weekday]=="Saturday")   //for Saturday's 
	{
   	document.write(" "+satHours);          //Library Hours Closed
	}
	else if (someday[weekday]=="Sunday")   //for Sunday's
	{
 		document.write(" "+sunHours);       //Library Hours Noon - 4:00pm
	}
	else if (someday[weekday]=="Monday")          //for Monday's-Thursday's
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if (someday[weekday]=="Tuesday")
	{
		document.write(" "+regHours);
	}
	else if (someday[weekday]=="Wednesday")
	{
		document.write(" "+regHours);
	}
	else if(someday[weekday]=="Thursday")
	{
		document.write(" "+regHours);
	}
}
//The Month of October
if(themonth==10) 											
{ 
	if(thedate==00)			              //For a Special Date that the Library is closed
	{										                //x/x/200x(Saturday"s Hours) - Closed 
	  document.write(" "+satHours);	  //Library Hours Closed
	}
  else if((thedate>=00) && (thedate<=00))  //During a Week or a Break
	{																			  //Month xx - Month xx
    document.write (" "+friHours);      //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Friday")      //for Friday's
	{				 
		document.write (" "+friHours);         //Library Hours 8:00am - 4:30pm
	}
	else if(someday[weekday]=="Saturday")   //for Saturday's 
	{
   	document.write(" "+satHours);         //Library Hours Closed
	}
	else if(someday[weekday]=="Sunday")     //for Sunday's
	{
 		document.write(" "+sunHours);         //Library Hours Noon - 4:00pm
	}
	else if(someday[weekday]=="Monday")       //for Monday's-Thursday's                          
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if (someday[weekday]=="Tuesday")                                
	{
		document.write(" "+regHours);         
	}
	else if(someday[weekday]=="Wednesday")                                 
	{
		document.write(" "+regHours);            
	}
	else if(someday[weekday]=="Thursday")                               
	{
		document.write(" "+regHours);         
	} 
}
//The Month of November
if(themonth==11) 											
{ 
	if(thedate==00)			             //For a Special Date that the Library is closed
	{										               //Library Hours Closed
	  document.write(" "+satHours);	 
	}
  else if((thedate>=25) && (thedate<=27))   //For November 25 - 27 - Closed
	{																			  
    document.write (" "+satHours);        
	}
	else if(someday[weekday]=="Friday")    //for all other Friday's
	{				 
		document.write (" "+friHours);        //Library Hours 8:00am - 4:30pm
	}
	else if (someday[weekday]=="Saturday") //for Saturday's 
	{
   	document.write(" "+satHours);         //Library Hours Closed
	}
	else if (someday[weekday]=="Sunday")   //for Sunday's
	{
 		document.write(" "+sunHours);         //Library Hours Noon - 4:00pm
	}
	else if (someday[weekday]=="Monday")       //for Monday's-Thursday's                          
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if (someday[weekday]=="Tuesday")                                 
	{
		document.write(" "+regHours);          
	}
	else if (someday[weekday]=="Wednesday")                                 
	{
		document.write(" "+regHours);              
	}
	else if (someday[weekday]=="Thursday")                            
	{
		document.write(" "+regHours);          
	} 
}
//The Month of December
if(themonth==12) 											
{ 
	if((thedate==05) || (thedate==12))		                     //For December 5 - Sunday Hours
	{										                       //Library Hours Noon - 4:00pm
	  document.write(" "+sunHours);	 
	}
    else if((thedate==29) || (thedate==30)) //For December 29th and 30th
	{																			 
    	document.write(" "+friHours);   //Library Hours 8:00 - 4:30 (Fri Hours) 
	}
	  else if(thedate==19)	 //For December 19 - Sunday Hours
	{
	    document.write(" "+sunHours);     //Library Hours Noon - 4:00pm
	}
	else if ((thedate>=24) && (thedate<=28))  //For December 24-28 - CLOSED
	{
		document.write(" "+satHours); 
	}	
	else if (thedate==31)                   //Library Hours Closed
	{
		document.write(""+satHours);       //Library Closed
	}
	else if(someday[weekday]=="Friday")      //for Friday's
	{				 
		document.write(" "+friHours);     //Library Hours 8:00am - 4:30pm
	}
	else if (someday[weekday]=="Saturday")   //for Saturday's 
	{
   		document.write(" "+satHours);       //Library Hours Closed
	}
	else if (someday[weekday]=="Sunday")     //for Sunday's
	{
 		document.write(" "+sunHours);      //Library Hours Noon - 4:00pm
	}
	else if (someday[weekday]=="Monday")          //for Monday's-Thursday's
	{
		document.write(" "+regHours);         //Library Hours 8:00am - 9:00pm
	}
	else if (someday[weekday]=="Tuesday")
	{
		document.write(" "+regHours);
	}
	else if (someday[weekday]=="Wednesday")
	{
		document.write(" "+regHours);
	}
	else if (someday[weekday]=="Thursday")
	{
		document.write(" "+regHours);
	}
}
 
//-->																					 
