// JavaScript Document

function getNiceDate()
{ 
  var now = new Date();
  var day = now.getDate();
  var dayofweek = now.getDay();
  var mymonth = now.getMonth();
  var year = now.getYear();
  var fixed_year = y2k(year);

var weekday = new Array(6);
weekday[1]="Sunday";
weekday[2]="Monday";
weekday[3]="Tuesday";
weekday[4]="Wednesday";
weekday[5]="Thursday";
weekday[6]="Friday";
weekday[7]="Saturday";
myweekday = weekday[dayofweek+1];

if(mymonth == 0)
               month = "January "
      else if(mymonth ==1)
               month = "February "
      else if(mymonth ==2)
              month = "March "
      else if(mymonth ==3)
             month = "April "
      else if(mymonth ==4)
               month = "May "
      else if(mymonth ==5)
               month = "June "
      else if(mymonth ==6)
               month = "July "
      else if(mymonth ==7)
             month = "August "
      else if(mymonth ==8)
            month = "September "
      else if(mymonth ==9)
           month = "October "
      else if(mymonth ==10)
           month = "November "
      else if(mymonth ==11)
           month = "December"
  
  var nice_date = myweekday + ", " + month + " " + day + ", " + fixed_year;  

  //This bit selects the PNG image for IE7+ and others, and the gif for IE6-
  //Detect IE5.5+
version=0
if (navigator.appVersion.indexOf("MSIE")!=-1){
temp=navigator.appVersion.split("MSIE")
version=parseFloat(temp[1])
if (version<7) {
document.getElementById('topleft').src="http://library.geneseo.edu/images/logo_header.gif";
}else{
document.getElementById('topleft').src="http://library.geneseo.edu/images/logoPNG24.png";
}
}else{
document.getElementById('topleft').src="http://library.geneseo.edu/images/logoPNG24.png";
}

  
  return nice_date;
}  


function getFallHours()
{
	var new_dayofweek = new Date();
	var day = new_dayofweek.getDay();
	var month = new_dayofweek.getMonth();
	var real_month = month + 1;
	var date = new_dayofweek.getDate();
	var month_date = real_month + "/" + date
	
	if ((month_date == "8/27") || (month_date == "8/28") || (month_date == "11/25") || (month_date == "12/23") || (month_date == "12/24"))
		{libhours = "8:00am to 4:00pm";}
		
		else if ((month_date == "8/29") || (month_date == "8/30") || (month_date == "11/26") || (month_date == "11/27") || (month_date == "11/28") || (month_date == "12/25") || (month_date == "12/26") || (month_date == "12/27"))
			{libhours = "Closed.";}
		
		else if (month_date == "9/4")
			{libhours = "7:30am to 6:00pm";}
		
		else if ((month_date == "9/5") || (month_date == "9/6") || (month_date == "10/10") || (month_date == "10/11"))
			{libhours = "12:00pm to 6:00pm";}

		else if (month_date == "9/7")
			{libhours = "12:00pm to 1:00am";}
			
		else if (month_date == "10/9")
			{libhours = "7:30am to 4:00pm";}
		
		else if (month_date == "10/12")
			{libhours = "8:00am to 9:00pm";}
		
		else if (month_date == "11/24")
			{libhours = "7:30am to 8:00pm";}
		
		else if (month_date == "11/29")
			{libhours = "6:00pm to 1:00am";}

		else if (month_date == "12/18")
			{libhours = "7:30am to 12:00am";}
		
		else if (month_date == "12/19")
			{libhours = "10:00am to 12:00am";}
		
		else if (month_date == "12/22")
			{libhours = "7:30am to 7:00pm";}
			
			
		//Sundays 
		else if (day == 0)
			{libhours = "10:00am to 1:00am";}
		
			
		//Saturday 
		else if (day == 6)
			{libhours = "10:00am to 9:00pm";}
		
		//Friday
		else if (day == 5)
			{libhours = "7:30am to 9:00pm";}
		
		//Monday - Thursday regular hours	
		else
			{libhours = "7:30am to 1:00am";}
	return libhours;

}

function y2k(the_date)
{
   if (the_date < 1000)
   { the_date = the_date + 1900; }
   
   return the_date;
}

