function countdown_clock()
{
	html_code = '<div id="countdown" style="width:245px;"></div>';

	document.write(html_code);

	countdown(2012, 7, 8, 13, 00);
}

function countdown(year, month, day, hour, minute)
{
	var today = new Date();
	var Todays_Year = today.getFullYear();
	var Todays_Month = today.getMonth();
	var GoalDate = new Date(year, (month - 1), day, hour, minute, 00);

	//Convert both today's date and the target date into miliseconds.
	var Todays_Date = (new Date(Todays_Year, Todays_Month, today.getDate(), today.getHours(), today.getMinutes(), today.getSeconds())).getTime();
	var Target_Date = GoalDate.getTime();

	//Find their difference, and convert that into seconds.
	var Time_Left = Math.round((Target_Date - Todays_Date) / 1000);

	if(Time_Left < 0) Time_Left = 0;

	//More datailed.
	var days = Math.floor(Time_Left / (60 * 60 * 24));
	Time_Left %= (60 * 60 * 24);
	var hours = Math.floor(Time_Left / (60 * 60));
	Time_Left %= (60 * 60);
	var minutes = Math.floor(Time_Left / 60);
	Time_Left %= 60;
	var seconds = Time_Left;

	var hps = '0'; var mps = '0'; var sps = '0';
	if(hours > 9) hps ='';
	if(minutes > 9) mps ='';
	if(seconds > 9) sps ='';

	document.getElementById("countdown").innerHTML = days + '<span>Days</span> '; 
	document.getElementById("countdown").innerHTML += hps + hours + '<span>Hours</span> '; 
	document.getElementById("countdown").innerHTML += mps + minutes + '<span>Min</span> '; 
	document.getElementById("countdown").innerHTML += sps + seconds + '<span>Sec</span>'; 

	//Recursive call, keeps the clock ticking.
	setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ');', 1000);
}
