function countdown_clock(year, month, day, hour, minute, format)
         {
       
         html_code = '<div id="countdown"></div>';
         
         document.write(html_code);
         
         countdown(year, month, day, hour, minute, format);                
         }
         
function countdown(year, month, day, hour, minute, format)
         {
         Today = new Date();
         Todays_Year = Today.getFullYear() - 2000;
         Todays_Month = Today.getMonth() + 1;                  
         
         //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, day, hour, minute, 00)).getTime();                  
         
         //Find their difference, and convert that into seconds.                  
         timeLeft = Math.round((Target_Date - Todays_Date) / 1000);
         
         if(timeLeft < 0)
            timeLeft = 0;
         
         switch(format)
               {
               case 0:
                    //The simplest way to display the time left.
                    document.all.countdown.innerHTML = timeLeft + ' seconds';
                    break;
               case 1:
                    //More datailed.
		    weeks = Math.floor(timeLeft / (60 * 60 * 24 * 7));
		    timeLeft %= (60 * 60 * 24 * 7);

                    days = Math.floor(timeLeft / (60 * 60 * 24));
                    timeLeft %= (60 * 60 * 24);
                    hours = Math.floor(timeLeft / (60 * 60));
                    timeLeft %= (60 * 60);
                    minutes = Math.floor(timeLeft / 60);
                    timeLeft %= 60;
                    seconds = timeLeft;
                    week = ' week';
					day = ' day';
					hr = ' hour';
					
					wps = 's';
					
                    dps = 's'; 
		            hps = 's'; 
                    mps = 's'; 
                    //ps is short for plural suffix.
                    if(weeks == 1) wps = '';
					if(weeks == 0) {
						week = '';
						weeks = '';
						wps = '';
					}
					if(days == 1) dps ='';
					if(days == 0) {
						days = '';
						dps = '';
						day = '';
					
					}
		    
                    if(hours == 1) hps ='';
					if(hours == 0){
						hr = '';
						hours = '';
						hps = '';
					}
                    if(minutes == 1) mps ='';
					
					
                    
                    document.all.countdown.innerHTML = weeks + week + wps + ' ';
                    document.all.countdown.innerHTML += days + day + dps + ' ';
                    document.all.countdown.innerHTML += hours +  hr + hps + ' ';
                    document.all.countdown.innerHTML += minutes + ' minute' + mps + ' ';
                    break;
               default: 
                    document.all.countdown.innerHTML = timeLeft + ' seconds';
               }
               
         //Recursive call, keeps the clock ticking.
         setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' + format + ');', 1000);
         }







