// holiday closing notice

document.write ('<!-- START of holiday_note.js -->');

var d = new Date();
var localhour = d.getHours(); // get Universal Time.
var utchour = d.getUTCHours(); // get Universal Time.
var ipl2hour = utchour - 5; // figure ipl2 time (Eastern Standard Time. Eastern Daylight Time is UTC - 4)
var utcyear = d.getUTCFullYear();
var utcmonth = d.getUTCMonth();
var utcdate = d.getUTCDate();

//debugging
/*
document.write('Local time: '+localhour+'<br />'); // Differs depending on time zones
document.write('UTC time: '+utchour+'<br />'); // Should be the same in all time zones
document.write('ipl2 (Eastern) time: '+ipl2hour+'<br />'); // Should the same time (Eastern) in all time zones
*/

var showclosenote = 0; // show closing notice toggle

// show close notice...
// if in 2010
if (utcyear == 2010) { showclosenote = 1; } 
// if before January 2 in 2011
if (utcyear == 2011) { if (utcmonth == 0) { if (utcdate < 3) { showclosenote = 1;} } }
// if before 12 on January 3 in 2011
if (utcyear == 2011) { if (utcmonth == 0) { if (utcdate == 3) { if (ipl2hour < 12) { showclosenote = 1;} } } }

if ( showclosenote == 1) 
{
document.write('<p class="close_note">The Ask an ipl2 Librarian service, ipl2\'s Contact Us form, and other ipl2 forms will be unavailable for the winter holiday break beginning 12 p.m. (noon) EST, December 23, 2011. We will reopen at 12 p.m. (noon) EST, January 3, 2012.<br /><br />Happy Holidays from all of us at ipl2!</p>');
}

document.write ('<!-- END of holiday_note.js -->');


