var blnFirst = true;
var elemDays, elemHours, elemMinutes, elemSeconds; // Used in countdown function below

function countdown(Todays_Date, Target_Date)
         {

            if (elemDays == null) {
                elemDays = document.getElementById("days");
                elemHours = document.getElementById("hours");
                elemMinutes = document.getElementById("minutes");
                elemSeconds = document.getElementById("seconds");
            }
         //Convert both today's date and the target date into miliseconds.                           
//         Todays_Date = Todays_Date.getTime();                                 
//         Target_Date = Target_Date.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(1) //format)
               {
               case 0:
                    //The simplest way to display the time left.
//                    document.all.countdown.innerHTML = Time_Left + ' seconds';
                    break;
               case 1:
                    //More datailed.
*/
										var days = Math.floor(Time_Left / (86400));
                    Time_Left %= (86400);
                    var hours = Math.floor(Time_Left / (3600));
                    Time_Left %= (3600);
                    var minutes = Math.floor(Time_Left / 60);
                    Time_Left %= 60;
                    var seconds = Time_Left;
                    
					if (elemDays.innerHTML != days || blnFirst)
	                    elemDays.innerHTML = days;
                    if (elemHours.innerHTML != hours || blnFirst)
						elemHours.innerHTML = hours;
                    if (elemMinutes.innerHTML != minutes || blnFirst)
						elemMinutes.innerHTML = minutes;
                    if (elemSeconds.innerHTML != seconds || blnFirst)
						elemSeconds.innerHTML = seconds;
										
					blnFirst = false;
/*
                    break;
               default: 
//                    document.all.countdown.innerHTML = Time_Left + ' seconds';
               }
*/               
         //Recursive call, keeps the clock ticking.
//         setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' + format + ');', 1000);
						setTimeout('addSec('+ Todays_Date + ',' + Target_Date +');', 1000);
         }
				 
				 function addSec(Todays_Date, Target_Date) {
					 Todays_Date += 1000;
					 if (Todays_Date >= Target_Date)
					   document.URL = document.URL;
					 else
						 countdown(Todays_Date, Target_Date);
				 }
	
