
var serverDate;
function getServerDate(){
var s_hours = 23;
var s_minutes = 11;
var s_seconds =23;
serverDate=new Date(); //server date and time, change server-side code accordingly
serverDate.setHours(s_hours);
serverDate.setMinutes(s_minutes);
serverDate.setSeconds(s_seconds);
}

function tick(){

var min = serverDate.getMinutes();
if (min<10) min="0"+min;
var sec = serverDate.getSeconds();
if (sec<10) sec="0"+sec;
window.status = serverDate.getHours() + ":" + min + ":" + sec;
}


function clock()
{
serverDate.setSeconds(serverDate.getSeconds()+1);
var hours = serverDate.getHours();
var minutes = serverDate.getMinutes();
var seconds = serverDate.getSeconds();
var time_holder; // holds the time

// add a leading zero if less than 10

hours = ((hours < 10) ? "0" + hours : hours);

minutes = ((minutes < 10) ? "0" + minutes : minutes);

seconds = ((seconds < 10) ? "0" + seconds : seconds);

 
time_holder = hours + ":" + minutes + ":" + seconds;


document.getElementById('jsClock').innerHTML = time_holder;

 
// keep the clock ticking

setTimeout("clock()", 1000);

}

