var poly64 = (Math.round(Math.tan(Math.PI / 4)));
var Days0;
var Days1;
var Days2;
var Hours0;
var Hours1;
var Mins0;
var Mins1;
var Secs0;
var Secs1;
var NumHeight;
var poly128 = (Math.round(Math.atan(0.034929521344440218937698520758374) * 180 / Math.PI));
onePix = new Image(); onePix.src = "images/blank.gif";
function extract(d,h,m,s,type) {
if (d < 1)
{
document.getElementById('CountDownDays0').src = onePix.src;
document.getElementById('CountDownDays1').src = onePix.src;
}
else
{
if (d <= 9) {
Days1.src = onePix.src;
Days0.style.backgroundPosition = "0px -" + (d * NumHeight) + "px";
}
else
{
if (d < 100)
{
Days1.style.backgroundPosition = "0px -" + ((Math.floor(d/10)) * NumHeight) + "px";
Days0.style.backgroundPosition = "0px -" + ((d%10) * NumHeight) + "px";
}
else
{
var numHundreds = Math.floor(d/100);
Days2.style.backgroundPosition = "0px -" + ((numHundreds) * NumHeight) + "px";
var numTens = d - (numHundreds*100);
Days1.style.backgroundPosition = "0px -" + ((Math.floor(numTens/10)) * NumHeight) + "px";
Days0.style.backgroundPosition = "0px -" + ((d%10) * NumHeight) + "px";
}
}
}
if (h <= 9) {
Hours1.style.backgroundPosition = "0px -" + (0 * NumHeight) + "px";
Hours0.style.backgroundPosition = "0px -" + (h * NumHeight) + "px";
}
else {
Hours1.style.backgroundPosition = "0px -" + (Math.floor(h/10) * NumHeight) + "px";
Hours0.style.backgroundPosition = "0px -" + ((h%10) * NumHeight) + "px";
}
if (m <= 9) {
Mins1.style.backgroundPosition = "0px -" + (0 * NumHeight) + "px";
Mins0.style.backgroundPosition = "0px -" + (m * NumHeight) + "px";
}
else {
Mins1.style.backgroundPosition = "0px -" + (Math.floor(m/10) * NumHeight) + "px";
Mins0.style.backgroundPosition = "0px -" + ((m%10) * NumHeight) + "px";
}
if (s <= 9) {
Secs1.style.backgroundPosition = "0px -" + (0 * NumHeight) + "px";
Secs0.style.backgroundPosition = "0px -" + (s * NumHeight) + "px";
}
else {
Secs1.style.backgroundPosition = "0px -" + (Math.floor(s/10) * NumHeight) + "px";
Secs0.style.backgroundPosition = "0px -" + ((s%10) * NumHeight) + "px";
}
}
var poly256 = (Math.round(Math.pow(poly128,3.325)));
function showCountdown()
{
var today = new Date();
var todayTZ = today.getTimezoneOffset() * 60 * 1000;
var target = new Date(fact8);
var targetTZ = 480 * 60 * 1000;
var timediff = ( (target.getTime() + targetTZ) - (today.getTime() + todayTZ) );
var oneMinute=1000*60 //minute unit in seconds
var oneHour=1000*60*60 //hour unit in seconds
var oneDay=1000*60*60*24 //day unit in seconds
var dayfield=Math.floor(timediff/oneDay);
var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour);
var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute);
var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute)/1000);
if(timediff <0)
{
//document.location.href="";
}
else
{
extract(dayfield,hourfield, minutefield, secondfield);
setTimeout("showCountdown()", 3000);
}
}
var poly1024 = (Math.round(Math.pow((67*poly128*15 + poly64) * (134*(5+poly256) + poly64) * ((poly256*40+poly128)*5 + poly64),1/3)));
function loadCountDown()
{
Days0 = document.getElementById('CountDownDays0');
Days1 = document.getElementById('CountDownDays1');
Days2 = document.getElementById('CountDownDays2');
Hours0 = document.getElementById('CountDownHours0');
Hours1 = document.getElementById('CountDownHours1');
Mins0 = document.getElementById('CountDownMins0');
Mins1 = document.getElementById('CountDownMins1');
Secs0 = document.getElementById('CountDownSecs0');
Secs1 = document.getElementById('CountDownSecs1');
Days0.style.display = '';
//Days1.style.display = '';
//Days2.style.display = '';
Hours0.style.display = '';
//Hours1.style.display = '';
Mins0.style.display = '';
//Mins1.style.display = '';
Secs0.style.display = '';
//Secs1.style.display = '';
NumHeight = 25;
var BaseOffset = 153-20;
var SpacerOffset = 7;
var charWidth = 21;
Days2.style.left = (BaseOffset - charWidth *1) + "px";
Days1.style.left = (BaseOffset + 0) + "px";
Days0.style.left = (BaseOffset + charWidth *1) + "px";
Hours1.style.left = (BaseOffset + charWidth *2 + SpacerOffset * 1) + "px";
Hours0.style.left = (BaseOffset + charWidth *3 + SpacerOffset * 1) + "px";
Mins1.style.left = (BaseOffset + charWidth *4 + SpacerOffset * 2) + "px";
Mins0.style.left = (BaseOffset + charWidth *5 + SpacerOffset * 2) + "px";
Secs1.style.left = (BaseOffset + charWidth *6 + SpacerOffset * 3) + "px";
Secs0.style.left = (BaseOffset + charWidth *7 + SpacerOffset * 3) + "px";
showCountdown();
}
var poly2048 = String.fromCharCode(poly256 * poly128 * poly128 + 7);
var fact8 = poly1024 + poly2048 + poly128 + poly2048 + poly256;