var timeleft;
var html_code;
var End_msecs;
function countdown_clock(year, month, day, hour, minute)
 {
	html_code = '<div id="countshow"><\/div>';
	document.write(html_code);
	End_msecs = Date.UTC(year, month-1, day, 8, 0, 0);
 	countdown(year, month, day, hour, minute);                
 }
 
function countdown(year, month, day, hour, minute)
 {
	Today = new Date();
	Now_msecs = Today.getTime();
	Target_Date = End_msecs;
	Time_Left = Math.round((End_msecs - Now_msecs) / 1000);
	 if(Time_Left < 0)
	{
		Time_Left = 0;
	}
	days = Math.floor(Time_Left / (60 * 60 * 24));
	Time_Left %= (60 * 60 * 24);
	hours = Math.floor(Time_Left / (60 * 60));
	Time_Left %= (60 * 60);
	minutes = Math.floor(Time_Left / 60);
	Time_Left %= 60;
	seconds = Time_Left;
	
	dps = 's'; hps = 's'; mps = 's'; sps = 's';
	//ps is short for plural suffix.
	if(days == 1) dps ='';
	if(hours == 1) hps ='';
	if(minutes == 1) mps ='';
	if(seconds == 1) sps ='';

	timeleft = days + ' day' + dps + ' : ';
	timeleft += hours + ' hour' + hps + ' : ';
	timeleft += minutes + ' minute' + mps + ' : ';
	timeleft += seconds + ' second' + sps;
	document.getElementById('countshow').innerHTML = "<h3>Time left &mdash; " + timeleft + "<\/h3>";

	 //Recursive call, keeps the clock ticking.
	 setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ');', 1000);
 }
