function clock(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="clock"></div>';
         
         document.write(html_code);
         
         Today = new Date();
         Todays_Year = Today.getYear() - 2000;
         Todays_Month = Today.getMonth() + 1;
         
         <?
         $date = getDate();
         
         $second = $date["seconds"];
         $minute = $date["minutes"];
         $hour = $date["hours"];
         $day = $date["mday"];
         $month = $date["mon"];
         $month_name = $date["month"];
         $year = $date["year"];
         ?>
         
         //Computes the time difference between the client computer and the server.
         Server_Date = (new Date(<?= $year - 2000 ?>, <?= $month ?>, <?= $day ?>,
                                 <?= $hour ?>, <?= $minute ?>, <?= $second ?>)).getTime();
         Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(),
                                 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();
         
         tick((Todays_Date - Server_Date), format);                
         }
         
function tick(time_difference, format)
         {
         Today = new Date(new Date().getTime() - time_difference);  
         
         minutes = Today.getMinutes();
         if(minutes < 10)
            minutes = '0' + minutes;
            
         seconds = Today.getSeconds();
         if(seconds < 10)
            seconds = '0' + seconds;
         
         months = new Array('January',
                            'February',
                            'March',
                            'April',
                            'May',
                            'June',
                            'July',
                            'August',
                            'September',
                            'October',
                            'November',
                            'December');                                    

         switch(format)
               {
               case 0:
                    document.all.clock.innerHTML = months[Today.getMonth()] + ' ' +
                                                   Today.getDate() + ', ' + 
                                                   Today.getYear() +  ' ' + 
                                                   Today.getHours() + ':' +
                                                   minutes + ':' +
                                                   seconds;
                    break;
               case 1:
                    document.all.clock.innerHTML = Today.getDate() + '-' +
                                                   (Today.getMonth() + 1) + '-' + 
                                                   Today.getYear() +  ' ' + 
                                                   Today.getHours() + ':' +
                                                   minutes + ':' +
                                                   seconds;
                    break;
               default: 
                    document.all.clock.innerHTML = months[Today.getMonth()] + ' ' +
                                                   Today.getDate() + ', ' + 
                                                   Today.getYear() +  ' ' + 
                                                   Today.getHours() + ':' +
                                                   minutes + ':' +
                                                   seconds;
               }
               
         //Recursive call, keeps the clock ticking.
         setTimeout('tick(' + time_difference + ', ' + format + ');', 1000);
         }