function countdown_clock(year, month, day, hour, minute, format)
         {
         //I chose a div as the container for the timer, but
         //it can be an input tag inside a form, or anything
         //who's displayed content can be changed through
         //client-side scripting.
         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)
         {
         
        //var day=ReadTargetDay();
        //var month=ReadTargetMonth();
        //var year=ReadTargetYear();

         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();
         
         Target_Date.setDate(day);
         Target_Date.setMonth(month);
         Target_Date.setYear(year);
      
         //Target_Date = (new Date(8,9,3));// year, month, day);//10,9,14));// (new Date (year, month, day);//myDate;//(new Date(8,9,15));//myDate.getFullYear() -2000, myDate.getMonth, myDate.getDate));                 
         Target_Date = (new Date(year, month, day, hour, minute));
         
         //Find their difference, and convert that into seconds.                  
         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);
                    hours = Math.floor(Time_Left / (60 * 60));
                    Time_Left %= (60 * 60);
                    minutes = Math.floor(Time_Left / 60);
                    Time_Left %= 60;
                    seconds = Time_Left;
                    
                    dps = 's'; hps = 's'; mps = 's'; sps = 's';
                    //ps is short for plural suffix.
                    if(days == 1) dps ='';
                    if(hours == 1) hps ='';
                    if(minutes == 1) mps ='';
                    if(seconds == 1) sps ='';

                    // pad all numbers to a minimum of 2 digits
                    days = zeroPad(days, 2);
                    hours = zeroPad(hours, 2)
                    minutes = zeroPad(minutes, 2)
                    seconds = zeroPad(seconds, 2);
                    
                    var txt = '<div class="countdownclock">';
                    txt += '<div class="divfloatleft"><div id="countdownDays">' + days + '</div>';
                    txt += '<div id="daysLabel">days</div></div>';
                    txt += '<div class="divfloatleft"><div id="countdownHours">' + hours + '</div>';
                    txt += '<div id="hoursLabel">hrs</div></div>';
                    txt += '<div class="divfloatleft"><div id="countdownMinutes">' + minutes + '</div>';
                    txt += '<div id="minutesLabel">mins</div></div>';
                    txt += '<div class="divfloatleft"><div id="countdownSeconds">' + seconds + '</div>';
                    txt += '<div id="secondsLabel">secs</div></div>';
                    txt += '    </div>';
                    
                    //document.all.countdown.innerHTML = txt;
                     document.getElementById('countdown').innerHTML=txt;



                    //Recursive call, keeps the clock ticking.
                    setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' + format + ');', 1000);
            }
function zeroPad(num,count)
{ 
    var numZeropad = num + '';
    while(numZeropad.length < count) 
    {
        numZeropad = "0" + numZeropad; 
    }
    return numZeropad;
}
