﻿today = new Date();
var bigDayArray = new Array("September 18, 2009", "December 30, 2009", "March 8, 2010")

function dateCountDown(i)
{
	BigDay = new Date(bigDayArray[i])
	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);
	minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
	strDaysLeft = daysLeft.toString();
	if (daysLeft > 0)
	{
		if(strDaysLeft.length == 3)
		{
			document.write("<td class=\"date\" width=\"38px\" align=\"center\">" + strDaysLeft.charAt(0) + "</td><td class=\"date\"  width=\"38px\" align=\"center\">" + strDaysLeft.charAt(1) + "</td><td class=\"date\"  width=\"38px\" align=\"center\">" + strDaysLeft.charAt(2) + "</td>");
		}
		if(strDaysLeft.length == 2)
		{
			document.write("<td class=\"date\"  width=\"38px\" align=\"center\">0</td><td class=\"date\"  width=\"38px\" align=\"center\">" + strDaysLeft.charAt(0) + "</td><td class=\"date\"  width=\"38px\" align=\"center\">" + strDaysLeft.charAt(1) + "</td>");
		}
		if(strDaysLeft.length == 1)
		{
			document.write("<td class=\"date\"  width=\"38px\" align=\"center\">0</td><td class=\"date\"  width=\"38px\" align=\"center\">0</td><td class=\"date\"  width=\"38px\" align=\"center\">" + strDaysLeft.charAt(0) + "</td>");
		}
	}
	else
	{
		document.write("<td class=\"date\"  width=\"38px\" align=\"center\"></td><td class=\"date\"  width=\"38px\" align=\"center\"></td><td class=\"date\"  width=\"38px\" align=\"center\">0</td>");
	}
}