﻿// Java-Script


var montharray = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

function setCountdown(theyear, themonth, theday, thehour, themin, thesec) {
	yr = theyear;
	mo = themonth;
	da = theday;
	hr = thehour;
	min = themin;
	sec = thesec;
}

function startCountdown() {
	countdown();
}

function countdown() {
	var today=new Date()
	var todayy=today.getYear()
	var todaym=today.getMonth()
	var todayd=today.getDate()
	var todayh=today.getHours()
	var todaymin=today.getMinutes()
	var todaysec=today.getSeconds();

	var futureDate = new Date(yr, mo - 1, da, hr, min, sec);
	dd = futureDate.getTime() - today;
	dday = Math.floor(dd / (60*60*1000*24) * 1);
	dhour = Math.floor((dd % (60*60*1000*24)) / (60*60*1000) * 1);
	dmin = Math.floor(((dd % (60*60*1000*24)) % (60*60*1000)) / (60*1000) * 1);
	dsec = Math.floor((((dd % (60*60*1000*24)) % (60*60*1000)) % (60*1000)) / 1000 * 1);
	d10sec = Math.floor((((dd % (60*60*1000*24)) % (60*60*1000)) % (60*1000)) % 1000 / 100 * 1);

	//if on day of occasion
	if(dd <= 0){
//		crosscount.innerHTML = "0:00:00:00.0";
//		crosscount.style.color = "#ff0088";
//		crosscount.style.borderColor = "#ff0088";
		document.getElementById("days").innerHTML = "0";
		document.getElementById("hours").innerHTML = "00";
		document.getElementById("minutes").innerHTML = "00";
		document.getElementById("seconds").innerHTML = "00";
		document.getElementById("seconds10").innerHTML = "0";
/*
		document.getElementById("days").style.color = "#ff0088";
		document.getElementById("hours").style.color = "#ff0088";
		document.getElementById("minutes").style.color = "#ff0088";
		document.getElementById("seconds").style.color = "#ff0088";
		document.getElementById("seconds10").style.color = "#ff0088";
*/
		return
	} else {
		if(dday == 0){
		}
		document.getElementById("days").innerHTML = dday;
		if(dhour < 10){
			document.getElementById("hours").innerHTML = "0" + dhour;
		}else{
			document.getElementById("hours").innerHTML = dhour;
		}
		if(dmin < 10){
			document.getElementById("minutes").innerHTML = "0" + dmin;
		}else{
			document.getElementById("minutes").innerHTML = dmin;
		}
		if(dsec < 10){
			document.getElementById("seconds").innerHTML = "0" + dsec;
		}else{
			document.getElementById("seconds").innerHTML = dsec;
		}
		document.getElementById("seconds10").innerHTML = d10sec;
//		crosscount.innerHTML = innerHTML;
	}

	setTimeout("countdown()",10)
}
//  End -->
