var timer = null
zone=0;
isitlocal=true;
ampm='';

function stop()
{
clearTimeout(timer)
}

function updateclock(z){
zone=z.options[z.selectedIndex].value;
isitlocal=(z.options[0].selected)?true:false;
}

function WorldClock(){
if (zone == 545){
var time = new Date()
var hours = time.getUTCHours()
var minutes = time.getUTCMinutes()
minutes = minutes + 45
minHr = parseInt((minutes/60))
minutes = minutes % 60
hours = hours + minHr  
ampm = (((hours + 5)%24)>11)?"PM":"AM"
hours = ((hours + 5)%24)%12
if (hours == 0)
hours = 12  
var seconds = time.getUTCSeconds()
statusampm = ampm
var finaltime=hours+':'+((minutes < 10)?"0"+minutes:minutes)+':'+((seconds < 10)?"0"+seconds:seconds)+' '+statusampm;
}
else {
now=new Date();
ofst=now.getTimezoneOffset()/60;
secs=now.getSeconds();
sec=-1.57+Math.PI*secs/30;
mins=now.getMinutes();
min=-1.57+Math.PI*mins/30;
hr=(isitlocal)?now.getHours():(now.getHours() + parseInt(ofst)) + parseInt(zone);
hrs=-1.575+Math.PI*hr/6+Math.PI*parseInt(now.getMinutes())/360;
if (hr < 0) hr+=24;
if (hr > 23) hr-=24;
ampm = (hr > 11)?"PM":"AM";
statusampm = ampm
hr2 = hr;
if (hr2 == 0) hr2=12;
(hr2 < 13)?hr2:hr2 %= 12;


var finaltime=hr2+':'+((mins < 10)?"0"+mins:mins)+':'+((secs < 10)?"0"+secs:secs)+' '+statusampm;
}
document.forms["time"].display.value = finaltime
timer = setTimeout('WorldClock()',1000);
}