
// ****  Time Zone Count Down Javascript  **** //
/*
Visit http://rainbow.arch.scriptmania.com/scripts/
 for this script and many more
*/

////////// CONFIGURE THE COUNTDOWN SCRIPT HERE //////////////////

var month2 = '11';     //  '*' for next month, '0' for this month or 1 through 12 for the month 
var day2 = '20';        //  Offset for day of month day or + day  
var hour2 = 9;        //  0 through 23 for the hours of the day
var tz2 = -5;          //  Offset for your timezone in hours from UTC
var lab2 = 'tzcd2';      //  The id of the page entry where the timezone countdown is to show

function start2() {displayTZCountDown2(setTZCountDown2(month2,day2,hour2,tz2),lab2);}

    // **    The start function can be changed if required   **
	// Add Load Events
	addLoadEvent(start2);
	
////////// DO NOT EDIT PAST THIS LINE //////////////////

function setTZCountDown2(month2,day2,hour2,tz2) 
{
var toDate2 = new Date();
if (month2 == '*')toDate2.setMonth(toDate2.getMonth() + 1);
else if (month2 > 0) 
{ 
if (month2 <= toDate2.getMonth())toDate2.setYear(toDate2.getYear() + 1);
toDate2.setMonth(month2-1);
}
if (day2.substr(0,1) == '+') 
{ var day12 = parseInt(day2.substr(1));
toDate2.setDate(toDate2.getDate()+day12);
} 
else{toDate2.setDate(day2);
}
toDate2.setHours(hour2);
toDate2.setMinutes(0-(tz2*60));
toDate2.setSeconds(0);
var fromDate2 = new Date();
fromDate2.setMinutes(fromDate2.getMinutes() + fromDate2.getTimezoneOffset());
var diffDate2 = new Date(0);
diffDate2.setMilliseconds(toDate2 - fromDate2);
return Math.floor(diffDate2.valueOf()/1000);
}
function displayTZCountDown2(countdown2,tzcd2) 
{
if (countdown2 < 0) document.getElementById(tzcd2).innerHTML = "00 00 00 00!"; 
else {var secs2 = countdown2 % 60; 
if (secs2 < 10) secs2 = '0'+secs2;
var countdown12 = (countdown2 - secs2) / 60;
var mins2 = countdown12 % 60; 
if (mins2 < 10) mins2 = '0'+mins2;
countdown12 = (countdown12 - mins2) / 60;
var hours2 = countdown12 % 24;
var days2 = (countdown12 - hours2) / 24;
document.getElementById(tzcd2).innerHTML = days2 + '<span> days</span> ' +hours2+ '<span> hrs</span> ' +mins2+ '<span> mins</span> '+secs2+'<span class="seconds"> s</span>';
setTimeout('displayTZCountDown2('+(countdown2-1)+',\''+tzcd2+'\');',999);
}
}