/*
Live Date Script- 
*/

var nd= new Array()
nd[0] = new Date("January 1, 2010")
nd[1] = new Date("February 14, 2010")
nd[2] = new Date("March 17, 2010")
nd[3] = new Date("April 4, 2010")
nd[4] = new Date("April 15, 2010")
nd[5] = new Date("May 9, 2010")
nd[6] = new Date("May 31, 2010")
nd[7] = new Date("June 20, 2010")
nd[8] = new Date("July 4, 2010")
nd[9] = new Date("September 6, 2010")
nd[10] = new Date("October 31, 2010")
nd[11] = new Date("November 11, 2010")
nd[12] = new Date("November 25, 2010")
nd[13] = new Date("December 25, 2010")

var hn = new Array()
hn[0] = "New Year's Day"
hn[1] = "Valentine's Day"
hn[2] = "St. Patrick's Day"
hn[3] = "Easter"
hn[4] = "Tax Day"
hn[5] = "Mother's Day"
hn[6] = "Memorial Day"
hn[7] = "Father's Day"
hn[8] = "Independence Day"
hn[9] = "Labor Day"
hn[10] = "Halloween"
hn[11] = "Veterans Day" 
hn[12] = "Thanksgiving"
hn[13] = "Christmas"


var nxt=0
function countdown(){

var TimezoneOffset = -5  // adjust for time zone
 var localTime = new Date()
  var ms = localTime.getTime() 
             + (localTime.getTimezoneOffset() * 60000)
             + TimezoneOffset * 3600000
 	var mydate =  new Date(ms) 
	var year=mydate.getYear()
if (year < 1000)
year+=1900

var today =  new Date(ms) 
var month = today.getMonth()
var day = today.getDate()
var year=today.getYear()
if (year < 1000)
year+=1900
BigDay = nd[nxt]
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
e_minsLeft = (e_hrsLeft - hrsLeft)*60;
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
secsLeft = Math.floor((e_minsLeft - minsLeft)*60);
if (secsLeft==60) secsLeft=0
if (minsLeft < 10) minsLeft="0"+minsLeft
if (secsLeft < 10) secsLeft="0"+secsLeft
if (hrsLeft < 10) hrsLeft="0"+hrsLeft

holidayName = hn[nxt]
 
if  ( holidayName == "New Year's Day") {
    year = year+1
}
cDown = daysLeft+" days " +hrsLeft+ " hours " +  minsLeft + " minutes " + secsLeft +" seconds till "+holidayName+" " + year 
if (daysLeft > -2 && timeLeft < 0) {cDown = "<b>" + holidayName +" " + year +"</b>" }
else
if (daysLeft <= -2 && timeLeft < 0 ){
nxt++
countdown()
}

if (document.all)
document.all.cd.innerHTML=cDown
else if (document.getElementById)
document.getElementById("cd").innerHTML=cDown
else
document.write(cDown)
}


if (!document.all&&!document.getElementById){
countdown()
} 

function goforit(){
if (document.all||document.getElementById)
setInterval("countdown()",1000)
}



