  	var top_count=4;
	var top_class="top_story_left_box";
	
	function show_top(id_top){
		 
	 if (document.getElementById("top"+id_top).className!=top_class+" show"){
		 
		 for(i=1; i<=top_count; i++) {
		 	document.getElementById("top"+i).className=top_class;
			document.getElementById("thumb"+i).className="";
		 }
		 document.getElementById("top"+id_top).className=top_class+" show";
		 document.getElementById("thumb"+id_top).className="selected";
		 //opacity("top"+id_top, 60, 100, 1000);
	 }
	}
	
function switch_top(id_top){
		show_top(id_top);
}

function countdown(year, month, day, hour, minute, format)
         {
         Today = new Date();
         Todays_Year = Today.getFullYear() - 2000;
         Todays_Month = Today.getMonth();                  
         
         //Convert both today's date and the target date into miliseconds.                           
         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();                  
         
         //Find their difference, and convert that into seconds.                  
         Time_Left = Math.round((Target_Date - Todays_Date) / 1000);
         
         if(Time_Left < 0)
            Time_Left = 0;
         
         switch(format)
               {
               case 0:
                    //The simplest way to display the time left.
                    document.getElementById("countdown").innerHTML = Time_Left + ' vteřin';
                    break;
               case 1:
                    //More datailed.
                    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 = ' dní'; hps = ' hodin'; mps = ' minut'; sps = ' vteřin';
                    //ps is short for plural suffix.
                    if(days == 1) dps =' den';
                    if(hours == 1) hps =' hodina';
                    if(minutes == 1) mps =' minuta';
                    if(seconds == 1) sps =' vteřina';
					
					if(days > 1 && days<5 ) dps =' dny';
                    if(hours > 1 && hours<5 ) hps =' hodiny';
                    if(minutes > 1 && minutes<5 ) mps =' minuty';
                    if(seconds > 1 && seconds<5 ) sps =' vteřiny';
                    if(seconds == 0 && minutes==0&& hours==0&& days==0){
						 //document.getElementById("countdown").innerHTML = 'utkání již bylo odehráno';
					}
					else{
						
						document.getElementById("countdown").innerHTML = 'Do začátku utkání zbývá:<br />';
	                    document.getElementById("countdown").innerHTML += days +  dps + ' ';
    	                document.getElementById("countdown").innerHTML += hours +  hps + ' ';
        	            document.getElementById("countdown").innerHTML += minutes +  mps + ' ';
            	        document.getElementById("countdown").innerHTML += seconds + ' s' ;
					}
                    break;
               default: 
                    document.getElementById("countdown").innerHTML = Time_Left + ' vteřin';
               }
               
         //Recursive call, keeps the clock ticking.
         setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' + format + ');', 1000);
         }