// 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 == "3/15") || (month_date == "3/16") || (month_date == "3/17") || (month_date == "3/18") || (month_date == "3/19") || (month_date == "5/13") || (month_date == "5/14"))
		{libhours = "8:00am to 4:00pm";}
		
		else if ((month_date == "3/13") || (month_date == "3/14") || (month_date == "3/20") || (month_date == "5/15") || (month_date == "5/16"))
			{libhours = "Closed.";}
		
		else if (month_date == "3/12")
			{libhours = "7:30am to 4:00pm";}

		else if (month_date == "3/21")
			{libhours = "6:00pm to 1:00am";}

		else if (month_date == "5/7")
			{libhours = "7:30am to 12:00am";}
			
		else if (month_date == "5/8")
			{libhours = "10:00am to 12:00am";}
			
		else if (month_date == "3/21")
			{libhours = "7:30am to 10: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;
}

