
var k = 0
var ctimerID = null;
var timerID = null;
var timerRunning = false;
var city = ""
var hours;
var minutes;
var seconds;

function stopclock (){
        if(timerRunning)
                clearTimeout(timerID);
        timerRunning = false;
}

function startclock () {
        // Make sure the clock is stopped
        stopclock();
        showtime();
        checkCity();
}

function showtime () {

        var d = new Date();
	currentTimeZoneOffsetInHours = parseInt(d.getTimezoneOffset()/60);
        hours = d.getHours();
	hours = (hours + currentTimeZoneOffsetInHours);
	hours--; //for daylightsavings
	minutes = d.getMinutes();
        seconds = d.getSeconds();
        checkHour();
        if (hours <= 0) {hours = hours + 24};
        if (hours > 24) {hours = hours - 24};
        var timeValue = "" + ((hours >12) ? hours -12 :hours);
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
        timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
        timeValue += (hours >= 12) ? " P.M." : " A.M.";      
       
       document.getElementById("txtFace").value=timeValue;
       
       
        timerID = setTimeout("showtime()",1000);
        timerRunning = true; 
//	document.clock.test.value = d.getHours();
}

function checkHour() {
if (k==0)  {hours = (hours + 4.00)}  
if (k==1)  {hours = (hours + 9.00)} 
if (k==2)  {hours = (hours - 9.00)} 
if (k==3)  {hours = (hours + 6.00)} 
if (k==4)  {hours = (hours + 1.00)} 
if (k==5)  {hours = (hours - 7.00)} 
if (k==6)  {hours = (hours + 6.00)} 
if (k==7)  {hours = (hours + 2.00)} 
if (k==8)  {hours = (hours - 4.00)} 
if (k==9)  {hours = (hours +12.00)} 
if (k==10) {hours = (hours - 1.00)} 
if (k==11) {hours = (hours + 3.00)} 
if (k==12) {hours = (hours + 4.00)}
if (k==13) {hours = (hours + 7.00)} 
if (k==14) {hours = (hours + 8.00)} 
if (k==15) {hours = (hours + 1.00)} 
if (k==16) {hours = (hours + 1.00)} 
if (k==17) {hours = (hours + 1.00)} 
if (k==18) {hours = (hours - 5.00)} 
if (k==19) {hours = (hours - 3.00)} 
if (k==20) {hours = (hours + 1.00)} 
if (k==21) {hours = (hours +10.00)} 
if (k==22) {hours = (hours + 1.00)} 
if (k==23) {hours = (hours + 2.00)} 
if (k==24) {hours = (hours + 1.00)} 
if (k==25) {hours = (hours - 3.00)} 
if (k==26) {hours = (hours + 2.00)} 
if (k==27) {hours = (hours + 6.00)} 
if (k==28) {hours = (hours +10.00)} 
if (k==29) {hours = (hours - 1.00)} 
if (k==30) {hours = (hours - 4.00)} 
if (k==31) {hours = (hours + 0.00)} 
if (k==32) {hours = (hours + 6.00)} 
if (k==33) {hours = (hours + 8.00)} 
if (k==34) {hours = (hours + 6.00)} 
if (k==35) {hours = (hours + 1.00)} 
if (k==36) {hours = (hours + 9.00)} 
if (k==37) {hours = (hours + 6.00)} 
if (k==38) {hours = (hours + 6.00)} 
if (k==39) {hours = (hours + 0.00)} 
if (k==40) {hours = (hours + 0.00)} 
if (k==41) {hours = (hours + 5.00)} 
if (k==42) {hours = (hours -12.00)} 
if (k==43) {hours = (hours +12.00)} 
if (k==44) {hours = (hours - 3.00)} 
if (k==45) {hours = (hours + 0.00)} 
if (k==46) {hours = (hours +10.00)} 
if (k==47) {hours = (hours + 7.00)} 
if (k==48) {hours = (hours + 2.00)} 
if (k==49) {hours = (hours -10.00)} 
if (k==50) {hours = (hours + 2.00)} 
if (k==51) {hours = (hours +10.00)} 
if (k==52) {hours = (hours + 8.00)} 
if (k==53) {hours = (hours - 5.00)} 
if (k==54) {hours = (hours + 5.00)} 
if (k==55) {hours = (hours + 2.00)} 
if (k==56) {hours = (hours + 7.00)} 
if (k==57) {hours = (hours + 2.00)} 
if (k==58) {hours = (hours + 4.00)} 
if (k==59) {hours = (hours + 5.00)} 
if (k==60) {hours = (hours + 3.00)} 
if (k==61) {hours = (hours -12.00)} 
if (k==62) {hours = (hours - 4.00)} 
if (k==63) {hours = (hours - 5.00)} 
if (k==64) {hours = (hours + 0.00)} 
if (k==65) {hours = (hours + 0.00)} 
if (k==66) {hours = (hours + 1.00)} 
if (k==67) {hours = (hours + 1.00)} 
if (k==68) {hours = (hours +11.00)} 
if (k==69) {hours = (hours +12.00)} 
if (k==70) {hours = (hours +10.00)} 
if (k==71) {hours = (hours - 6.00)} 
if (k==72) {hours = (hours - 2.00)} 
if (k==73) {hours = (hours -11.00)} 
if (k==74) {hours = (hours + 2.00)} 
if (k==75) {hours = (hours + 0.00)} 
if (k==76) {hours = (hours + 3.00)} 
if (k==77) {hours = (hours - 7.00)} 
if (k==78) {hours = (hours + 6.00)} 
if (k==79) {hours = (hours + 4.00)} 
if (k==80) {hours = (hours + 3.00)} 
if (k==81) {hours = (hours +11.00)} 
if (k==82) {hours = (hours - 3.00)} 
if (k==83) {hours = (hours + 9.00)} 
if (k==84) {hours = (hours - 8.00)} 
if (k==85) {hours = (hours + 1.00)} 
if (k==86) {hours = (hours + 8.00)} 
if (k==87) {hours = (hours +10.00)} 
if (k==88) {hours = (hours + 1.00)} 
if (k==89) {hours = (hours + 2.00)} 
if (k==90) {hours = (hours - 5.00)} 
if (k==91) {hours = (hours + 2.00)} 
if (k==92) {hours = (hours + 3.00)} 
if (k==93) {hours = (hours + 1.00)} 
if (k==94) {hours = (hours -11.00)} 
if (k==95) {hours = (hours - 4.00)} 
if (k==96) {hours = (hours + 9.00)} 
if (k==97) {hours = (hours + 1.00)} 
if (k==98) {hours = (hours - 6.00)} 
if (k==99) {hours = (hours + 9.00)} 
if (k==100) {hours = (hours + 8.00)}  
if (k==101) {hours = (hours + 1.00)}  
if (k==102) {hours = (hours + 1.00)}  
if (k==103) {hours = (hours +11.00)}  
if (k==104) {hours = (hours + 3.00)}  
if (k==105) {hours = (hours + 1.00)}  
if (k==106) {hours = (hours +10.00)}  
if (k==107) {hours = (hours + 8.00)}  
if (k==108) {hours = (hours + 2.00)}  
if (k==109) {hours = (hours + 5.00)}  
if (k==110) {hours = (hours + 4.00)}  
if (k==111) {hours = (hours - 6.00)}  
if (k==112) {hours = (hours + 3.00)}  
if (k==113) {hours = (hours - 8.00)}  
if (k==114) {hours = (hours + 9.00)}  
if (k==115) {hours = (hours + 8.00)}  
if (k==116) {hours = (hours + 1.00)}  
if (k==117) {hours = (hours + 1.00)}  
if (k==118) {hours = (hours +10.00)}  
if (k==119) {hours = (hours + 3.00)}  
if (k==120) {hours = (hours + 1.00)}  
if (k==121) {hours = (hours +12.00)}  
if (k==122) {hours = (hours + 9.00)}  
if (k==123) {hours = (hours + 1.00)} 
}

function checkCity() {
	k++
	
	if (k == 124) {k = 0}
	
if (k==0) {document.getElementById("txtCity").value = "ABU DHABI                      "}
if (k==1) {document.getElementById("txtCity").value = "ADELAIDE                       "}
if (k==2) {document.getElementById("txtCity").value = "ALASKA                         "}
if (k==3) {document.getElementById("txtCity").value = "ALMATY                         "}
if (k==4) {document.getElementById("txtCity").value = "AMSTERDAM                      "}
if (k==5) {document.getElementById("txtCity").value = "ARIZONA                        "}
if (k==6) {document.getElementById("txtCity").value = "ASTANA                         "}
if (k==7) {document.getElementById("txtCity").value = "ATHENS                         "}
if (k==8) {document.getElementById("txtCity").value = "ATLANTIC(CANADA)               "}
if (k==9) {document.getElementById("txtCity").value = "AUCKLAND                       "}
if (k==10) {document.getElementById("txtCity").value = "AZORES                         "}
if (k==11) {document.getElementById("txtCity").value = "BAGHDAD                        "}
if (k==12) {document.getElementById("txtCity").value = "BAKU                           "}
if (k==13) {document.getElementById("txtCity").value = "BANGKOK                        "}
if (k==14) {document.getElementById("txtCity").value = "BEJING                         "}
if (k==15) {document.getElementById("txtCity").value = "BELGRADE                       "}
if (k==16) {document.getElementById("txtCity").value = "BERLIN                         "}
if (k==17) {document.getElementById("txtCity").value = "BERN                           "}
if (k==18) {document.getElementById("txtCity").value = "BOGOTA                         "}
if (k==19) {document.getElementById("txtCity").value = "BRASILIA                       "}
if (k==20) {document.getElementById("txtCity").value = "BRATISLAVA                     "}
if (k==21) {document.getElementById("txtCity").value = "BRISBANE                       "}
if (k==22) {document.getElementById("txtCity").value = "BRUSSELS                       "}
if (k==23) {document.getElementById("txtCity").value = "BUCHAREST                      "}
if (k==24) {document.getElementById("txtCity").value = "BUDAPEST                       "}
if (k==25) {document.getElementById("txtCity").value = "BUENOS AIRES                   "}
if (k==26) {document.getElementById("txtCity").value = "CAIRO                          "}
if (k==27) {document.getElementById("txtCity").value = "CALCUTTA                       "}
if (k==28) {document.getElementById("txtCity").value = "CANBERRA                       "}
if (k==29) {document.getElementById("txtCity").value = "CAPE VERDE IS.                 "}
if (k==30) {document.getElementById("txtCity").value = "CARACAS                        "}
if (k==31) {document.getElementById("txtCity").value = "CASABLANCA                     "}
if (k==32) {document.getElementById("txtCity").value = "CHENNAI/MADRAS                 "}
if (k==33) {document.getElementById("txtCity").value = "CHONGGING                      "}
if (k==34) {document.getElementById("txtCity").value = "COLOMBO                        "}
if (k==35) {document.getElementById("txtCity").value = "COPENHAGEN                     "}
if (k==36) {document.getElementById("txtCity").value = "DARWIN                         "}
if (k==37) {document.getElementById("txtCity").value = "DELHI                          "}
if (k==38) {document.getElementById("txtCity").value = "DHAKA                          "}
if (k==39) {document.getElementById("txtCity").value = "DUBLIN                         "}
if (k==40) {document.getElementById("txtCity").value = "EDINBURGH                      "}
if (k==41) {document.getElementById("txtCity").value = "EKATERINBURG                   "}
if (k==42) {document.getElementById("txtCity").value = "ENIWETOK                       "}
if (k==43) {document.getElementById("txtCity").value = "FIJI                           "}
if (k==44) {document.getElementById("txtCity").value = "GEORGE TOWN                    "}
if (k==45) {document.getElementById("txtCity").value = "GMT                            "}
if (k==46) {document.getElementById("txtCity").value = "GUAM                           "}
if (k==47) {document.getElementById("txtCity").value = "HANOI                          "}
if (k==48) {document.getElementById("txtCity").value = "HARARE                         "}
if (k==49) {document.getElementById("txtCity").value = "HAWAII                         "}
if (k==50) {document.getElementById("txtCity").value = "HELSINKI                       "}
if (k==51) {document.getElementById("txtCity").value = "HOBART                         "}
if (k==52) {document.getElementById("txtCity").value = "HONG KONG                      "}
if (k==53) {document.getElementById("txtCity").value = "INDIANA EAST                   "}
if (k==54) {document.getElementById("txtCity").value = "ISLAMABAD                      "}
if (k==55) {document.getElementById("txtCity").value = "ISTANBUL                       "}
if (k==56) {document.getElementById("txtCity").value = "JAKARTA                        "}
if (k==57) {document.getElementById("txtCity").value = "JERUSALEM                      "}
if (k==58) {document.getElementById("txtCity").value = "KABUL                          "}
if (k==59) {document.getElementById("txtCity").value = "KARACHI                        "}
if (k==60) {document.getElementById("txtCity").value = "KUWAIT                         "}
if (k==61) {document.getElementById("txtCity").value = "KWAJALEIN                      "}
if (k==62) {document.getElementById("txtCity").value = "LA PAZ                         "}
if (k==63) {document.getElementById("txtCity").value = "LIMA                           "}
if (k==64) {document.getElementById("txtCity").value = "LISBON                         "}
if (k==65) {document.getElementById("txtCity").value = "LONDON                         "}
if (k==66) {document.getElementById("txtCity").value = "LUJBLJANA                      "}
if (k==67) {document.getElementById("txtCity").value = "MADRID                         "}
if (k==68) {document.getElementById("txtCity").value = "MAGADAN                        "}
if (k==69) {document.getElementById("txtCity").value = "MARSHALL ISLANDS               "}
if (k==70) {document.getElementById("txtCity").value = "MELBOURNE                      "}
if (k==71) {document.getElementById("txtCity").value = "MEXICO CITY                    "}
if (k==72) {document.getElementById("txtCity").value = "MID ATLANTIC                   "}
if (k==73) {document.getElementById("txtCity").value = "MIDWAY ISLAND                  "}
if (k==74) {document.getElementById("txtCity").value = "MINSK                          "}
if (k==75) {document.getElementById("txtCity").value = "MONORIVA                       "}
if (k==76) {document.getElementById("txtCity").value = "MOSCOW                         "}
if (k==77) {document.getElementById("txtCity").value = "MOUNTAIN TIME                  "}
if (k==78) {document.getElementById("txtCity").value = "MUMBAI/BOMBAY                  "}
if (k==79) {document.getElementById("txtCity").value = "MUSCAT                         "}
if (k==80) {document.getElementById("txtCity").value = "NAIROBI                        "}
if (k==81) {document.getElementById("txtCity").value = "NEW CALEDONIA                  "}
if (k==82) {document.getElementById("txtCity").value = "NEW FOUNDLAND                  "}
if (k==83) {document.getElementById("txtCity").value = "OSAKA                          "}
if (k==84) {document.getElementById("txtCity").value = "PACIFIC TIME                   "}
if (k==85) {document.getElementById("txtCity").value = "PARIS                          "}
if (k==86) {document.getElementById("txtCity").value = "PERTH                          "}
if (k==87) {document.getElementById("txtCity").value = "PORT MORESBY                   "}
if (k==88) {document.getElementById("txtCity").value = "PRAGUE                         "}
if (k==89) {document.getElementById("txtCity").value = "PRETORIA                       "}
if (k==90) {document.getElementById("txtCity").value = "QUITO                          "}
if (k==91) {document.getElementById("txtCity").value = "RIGA                           "}
if (k==92) {document.getElementById("txtCity").value = "RIYADH                         "}
if (k==93) {document.getElementById("txtCity").value = "ROME                           "}
if (k==94) {document.getElementById("txtCity").value = "SAMOA                          "}
if (k==95) {document.getElementById("txtCity").value = "SANTIAGO                       "}
if (k==96) {document.getElementById("txtCity").value = "SAPPORO                        "}
if (k==97) {document.getElementById("txtCity").value = "SARAJEVO                       "}
if (k==98) {document.getElementById("txtCity").value = "SASKATCHEWAN                   "}
if (k==99) {document.getElementById("txtCity").value = "SEOUL                          "}
if (k==100) {document.getElementById("txtCity").value = "SINGAPORE                      "}
if (k==101) {document.getElementById("txtCity").value = "SKOPJE                         "}
if (k==102) {document.getElementById("txtCity").value = "SOFIJA                         "}
if (k==103) {document.getElementById("txtCity").value = "SOLOMON ISLANDS                "}
if (k==104) {document.getElementById("txtCity").value = "ST.PETERSBURG                  "}
if (k==105) {document.getElementById("txtCity").value = "STOCKHOLM                      "}
if (k==106) {document.getElementById("txtCity").value = "SYDNEY                         "}
if (k==107) {document.getElementById("txtCity").value = "TAIPEI                         "}
if (k==108) {document.getElementById("txtCity").value = "TALLINN                        "}
if (k==109) {document.getElementById("txtCity").value = "TASKENT                        "}
if (k==110) {document.getElementById("txtCity").value = "TBLISI                         "}
if (k==111) {document.getElementById("txtCity").value = "TEGUCIGALPA                    "}
if (k==112) {document.getElementById("txtCity").value = "TEHRAN                         "}
if (k==113) {document.getElementById("txtCity").value = "TIJUANA                        "}
if (k==114) {document.getElementById("txtCity").value = "TOKYO                          "}
if (k==115) {document.getElementById("txtCity").value = "URMUQI                         "}
if (k==116) {document.getElementById("txtCity").value = "VIENNA                         "}
if (k==117) {document.getElementById("txtCity").value = "VILNIUS                        "}
if (k==118) {document.getElementById("txtCity").value = "VLADIVOSTOK                    "}
if (k==119) {document.getElementById("txtCity").value = "VOLGOGRAD                      "}
if (k==120) {document.getElementById("txtCity").value = "WARSAW                         "}
if (k==121) {document.getElementById("txtCity").value = "WELLINGTON                     "}
if (k==122) {document.getElementById("txtCity").value = "YAKUTSK                        "}
ctimerID = setTimeout("checkCity()",10000);
	}
