function countdown_clock(year, month, day, hour, minute) {

	       if(document.getElementById('countdown')){
	       	setTimeout('countdown(\'' + year + '\',\'' + month + '\',\'' + day + '\',\'' + hour + '\',\'' + minute + '\');', 1000);
	       } else {
	       	setTimeout('countdown_clock(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ');', 1000);
	       }
}
function countdown(year, month, day, hour, minute) {
         
	
  			//var laenge = document.getElementById("countdown").firstChild.nodeValue.length;
  			var laengeH = document.getElementById("hours").firstChild.nodeValue.length;
  			var laengeM = document.getElementById("minutes").firstChild.nodeValue.length;
  			var laengeS = document.getElementById("seconds").firstChild.nodeValue.length;
  		
         Today = new Date();
         Todays_Year = Today.getFullYear() - 2000;
         Todays_Month = Today.getMonth();                  
         Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), 
                                 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();                                 
         Target_Date = (new Date(year, month - 1, day, hour, minute, 00)).getTime();                  
         
         Time_Left = Math.round((Target_Date - Todays_Date) / 1000);
         
         if(Time_Left < 0)
            Time_Left = 0;
         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;
         if(hours < 10) { h0 ='0'; } else { h0=''; }
         if(minutes < 10) { m0 ='0'; } else { m0=''; }
         if(seconds < 10) { s0 ='0'; } else { s0=''; }
         
         var newTime = h0+hours+'h '+m0+minutes+'min '+s0+seconds+'sec';
         
         var h = h0+hours;
         var m = m0+minutes;
         var s = s0+seconds;
         
  			// document.getElementById("countdown").firstChild.replaceData(0, laenge, newTime);
  			 
  			document.getElementById("hours").firstChild.replaceData(0, laengeH, h);
  			document.getElementById("minutes").firstChild.replaceData(0, laengeM, m);
  			document.getElementById("seconds").firstChild.replaceData(0, laengeS, s);
        
         setTimeout('countdown(\'' + year + '\',\'' + month + '\',\'' + day + '\',\'' + hour + '\',\'' + minute + '\');', 1000);
         }

function win_countdown(year, month, day, hour, minute) {
    
	Today = new Date();
	Todays_Year = Today.getFullYear() - 2000;
	Todays_Month = Today.getMonth();                  
	Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), 
	                        Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();                                 
	Target_Date = (new Date(year, month - 1, day, hour, minute, 00)).getTime();                  
	
	Time_Left = Math.round((Target_Date - Todays_Date) / 1000);
	
	if(Time_Left < 0)
	   Time_Left = 0;
	//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;
	if(hours < 10) { h0 ='0'; } else { h0=''; }
	if(minutes < 10) { m0 ='0'; } else { m0=''; }
	if(seconds < 10) { s0 ='0'; } else { s0=''; }
	
	document.getElementById("hour_time").innerHTML = h0+hours;
	document.getElementById("min_time").innerHTML = m0+minutes;
	document.getElementById("sec_time").innerHTML = s0+seconds;

	setTimeout('win_countdown(\'' + year + '\',\'' + month + '\',\'' + day + '\',\'' + hour + '\',\'' + minute + '\');', 1000);
}