// JavaScript Document

	var ctd_countDownTime = 0;		// holds the remaining number of milliseconds before the event
  	var ctd_startTime;						// holds the time at which the scripts started running
  	var ctd_currentTime = "000:00:00:00";	// holds the string representation of the countdown
  	var ctd_elementId = "";
  	
	function ctd_updateCountDown() {
  		var countDiv = document.getElementById(ctd_elementId);
  		if (countDiv != null) {
  			var now = new Date();
  			var offset = Math.round(now.getTime() / 1000) - Math.round(ctd_startTime.getTime() / 1000);
  			var newCount = ctd_countDownTime - offset * 1000;
			  countDiv.innerHTML = ctd_getDays(newCount) + " : " + ctd_getHours(newCount) + " : " + ctd_getMinutes(newCount) + " : " + ctd_getSeconds(newCount);
			  window.setTimeout("ctd_updateCountDown();", 300);
		}
  	}
  	
  	function ctd_getSeconds(milliseconds) {
	  var seconds = Math.floor(milliseconds / 1000) % 60;
	  if (seconds < 10) {
	  	return "0" + seconds;
	  } else {
	  	return seconds;
	  }
	}
  	
  	function ctd_getMinutes(milliseconds) {
	  var minutes = Math.floor(milliseconds / 60000) % 60;
	  if (minutes < 10) {
	  	return "0" + minutes;
	  } else {
	  	return minutes;
	  }
	}
	
	function ctd_getHours(milliseconds) {
	  var hours = Math.floor(milliseconds / 3600000) % 24;
	  if (hours < 10) {
	  	return "0" + hours;
	  } else {
	  	return hours;
	  }
	}
	
	function ctd_getDays(milliseconds) {
	  var days = Math.floor(milliseconds / 86400000);
	  if (days < 10) {
	  	return "00" + days;
	  } else if (days < 100) {
	  	return "0" + days;
	  } else {
	  	return days;
	  }
	}
  	
  	function ctd_startCountDown(id) {
  		ctd_elementId = id;
		ctd_startTime = new Date();	
		window.setTimeout("ctd_updateCountDown();", 0);
	}