var timerID = null;
var timerRunning = false;
function stopclock ()
{
  if(timerRunning)
      clearTimeout(timerID);
  timerRunning = false;
}

function showtime () 
{
  
  addtimess();

 document.getElementById("label").value=document.getElementById("week").value+" "+document.getElementById("hh").value+":"+document.getElementById("mm").value+":"+document.getElementById("ss").value+" GMT"
  timelondon();
  timenewyork();
  timebar();
  timetokyo();
  timesy();
  timerID = setTimeout("showtime()",1000);
  timerRunning = true;
}

function startclock () 
{
  settime1();
  stopclock();
  timegmt();
  showtime();
}

//===================
function settime1()
{
 var s=document.getElementById("ss").value;
 if (s=="0"){document.getElementById("ss").value="00";}
 if (s=="1"){document.getElementById("ss").value="01";}
 if (s=="2"){document.getElementById("ss").value="02";}
 if (s=="3"){document.getElementById("ss").value="03";}
 if (s=="4"){document.getElementById("ss").value="04";}
 if (s=="5"){document.getElementById("ss").value="05";}
 if (s=="6"){document.getElementById("ss").value="06";}
 if (s=="7"){document.getElementById("ss").value="07";}
 if (s=="8"){document.getElementById("ss").value="08";}
 if (s=="9"){document.getElementById("ss").value="09";}
  var m=document.getElementById("mm").value;
 if (m=="0"){document.getElementById("mm").value="00";}
 if (m=="1"){document.getElementById("mm").value="01";}
 if (m=="2"){document.getElementById("mm").value="02";}
 if (m=="3"){document.getElementById("mm").value="03";}
 if (m=="4"){document.getElementById("mm").value="04";}
 if (m=="5"){document.getElementById("mm").value="05";}
 if (m=="6"){document.getElementById("mm").value="06";}
 if (m=="7"){document.getElementById("mm").value="07";}
 if (m=="8"){document.getElementById("mm").value="08";}
 if (m=="9"){document.getElementById("mm").value="09";}
 var h=document.getElementById("hh").value;
 if (h=="0"){document.getElementById("hh").value="00";}
 if (h=="1"){document.getElementById("hh").value="01";}
 if (h=="2"){document.getElementById("hh").value="02";}
 if (h=="3"){document.getElementById("hh").value="03";}
 if (h=="4"){document.getElementById("hh").value="04";}
 if (h=="5"){document.getElementById("hh").value="05";}
 if (h=="6"){document.getElementById("hh").value="06";}
 if (h=="7"){document.getElementById("hh").value="07";}
 if (h=="8"){document.getElementById("hh").value="08";}
 if (h=="9"){document.getElementById("hh").value="09";}
}
//================================================================================
function addtimess()
{
 var a=document.getElementById("ss").value;
 if (a=="00"){document.getElementById("ss").value="01";}
 else if (a=="01"){document.getElementById("ss").value="02";}
  else if (a=="02"){document.getElementById("ss").value="03";}
 else  if (a=="03"){document.getElementById("ss").value="04";}
 else  if (a=="04"){document.getElementById("ss").value="05";}
 else  if (a=="05"){document.getElementById("ss").value="06";}
  else if (a=="06"){document.getElementById("ss").value="07";}
  else if (a=="07"){document.getElementById("ss").value="08";}
  else if (a=="08"){document.getElementById("ss").value="09";}
  else if (a=="09"){document.getElementById("ss").value="10";}
  else if (a=="10"){document.getElementById("ss").value="11";}
  else if (a=="11"){document.getElementById("ss").value="12";}
  else if (a=="12"){document.getElementById("ss").value="13";}
  else if (a=="13"){document.getElementById("ss").value="14";}
  else if (a=="14"){document.getElementById("ss").value="15";}
  else if (a=="15"){document.getElementById("ss").value="16";}
  else if (a=="16"){document.getElementById("ss").value="17";}
  else if (a=="17"){document.getElementById("ss").value="18";}
  else if (a=="18"){document.getElementById("ss").value="19";}
  else if (a=="19"){document.getElementById("ss").value="20";}
  else if (a=="20"){document.getElementById("ss").value="21";}
  else if (a=="21"){document.getElementById("ss").value="22";}
  else if (a=="22"){document.getElementById("ss").value="23";}
  else if (a=="23"){document.getElementById("ss").value="24";}
  else if (a=="24"){document.getElementById("ss").value="25";}
  else if (a=="25"){document.getElementById("ss").value="26";}
  else if (a=="26"){document.getElementById("ss").value="27";}
  else if (a=="27"){document.getElementById("ss").value="28";}
  else if (a=="28"){document.getElementById("ss").value="29";}
 else if (a=="29"){document.getElementById("ss").value="30";}
 else if (a=="30"){document.getElementById("ss").value="31";}
 else if (a=="31"){document.getElementById("ss").value="32";}
 else if (a=="32"){document.getElementById("ss").value="33";}
 else if (a=="33"){document.getElementById("ss").value="34";}
 else if (a=="34"){document.getElementById("ss").value="35";}
 else if (a=="35"){document.getElementById("ss").value="36";}
 else if (a=="36"){document.getElementById("ss").value="37";}
 else if (a=="37"){document.getElementById("ss").value="38";}
 else if (a=="38"){document.getElementById("ss").value="39";}
 else if (a=="39"){document.getElementById("ss").value="40";}
 else if (a=="40"){document.getElementById("ss").value="41";}
 else if (a=="41"){document.getElementById("ss").value="42";}
 else if (a=="42"){document.getElementById("ss").value="43";}
 else if (a=="43"){document.getElementById("ss").value="44";}
 else if (a=="44"){document.getElementById("ss").value="45";}
 else if (a=="45"){document.getElementById("ss").value="46";}
 else if (a=="46"){document.getElementById("ss").value="47";}
 else if (a=="47"){document.getElementById("ss").value="48";}
 else if (a=="48"){document.getElementById("ss").value="49";}
 else if (a=="49"){document.getElementById("ss").value="50";}
 else if (a=="50"){document.getElementById("ss").value="51";}
 else if (a=="51"){document.getElementById("ss").value="52";}
 else if (a=="52"){document.getElementById("ss").value="53";}
 else if (a=="53"){document.getElementById("ss").value="54";}
 else if (a=="54"){document.getElementById("ss").value="55";}
 else if (a=="55"){document.getElementById("ss").value="56";}
 else if (a=="56"){document.getElementById("ss").value="57";}
 else if (a=="57"){document.getElementById("ss").value="58";}
 else if (a=="58"){document.getElementById("ss").value="59";}
 else if (a=="59"){document.getElementById("ss").value="00"; addtimemm();}
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function addtimemm()
{
 var a=document.getElementById("mm").value;
 if (a=="00"){document.getElementById("mm").value="01";}
  else if (a=="01"){document.getElementById("mm").value="02";}
  else if (a=="02"){document.getElementById("mm").value="03";}
  else if (a=="03"){document.getElementById("mm").value="04";}
  else if (a=="04"){document.getElementById("mm").value="05";}
  else if (a=="05"){document.getElementById("mm").value="06";}
  else if (a=="06"){document.getElementById("mm").value="07";}
  else if (a=="07"){document.getElementById("mm").value="08";}
  else if (a=="08"){document.getElementById("mm").value="09";}
  else if (a=="09"){document.getElementById("mm").value="10";}
  else if (a=="10"){document.getElementById("mm").value="11";}
  else if (a=="11"){document.getElementById("mm").value="12";}
  else if (a=="12"){document.getElementById("mm").value="13";}
  else if (a=="13"){document.getElementById("mm").value="14";}
  else if (a=="14"){document.getElementById("mm").value="15";}
  else if (a=="15"){document.getElementById("mm").value="16";}
  else if (a=="16"){document.getElementById("mm").value="17";}
  else if (a=="17"){document.getElementById("mm").value="18";}
  else if (a=="18"){document.getElementById("mm").value="19";}
  else if (a=="19"){document.getElementById("mm").value="20";}
  else if (a=="20"){document.getElementById("mm").value="21";}
  else if (a=="21"){document.getElementById("mm").value="22";}
  else if (a=="22"){document.getElementById("mm").value="23";}
  else if (a=="23"){document.getElementById("mm").value="24";}
  else if (a=="24"){document.getElementById("mm").value="25";}
  else if (a=="25"){document.getElementById("mm").value="26";}
  else if (a=="26"){document.getElementById("mm").value="27";}
  else if (a=="27"){document.getElementById("mm").value="28";}
  else if (a=="28"){document.getElementById("mm").value="29";}
 else if (a=="29"){document.getElementById("mm").value="30";}
 else if (a=="30"){document.getElementById("mm").value="31";}
 else if (a=="31"){document.getElementById("mm").value="32";}
 else if (a=="32"){document.getElementById("mm").value="33";}
 else if (a=="33"){document.getElementById("mm").value="34";}
 else if (a=="34"){document.getElementById("mm").value="35";}
 else if (a=="35"){document.getElementById("mm").value="36";}
 else if (a=="36"){document.getElementById("mm").value="37";}
 else if (a=="37"){document.getElementById("mm").value="38";}
 else if (a=="38"){document.getElementById("mm").value="39";}
 else if (a=="39"){document.getElementById("mm").value="40";}
 else if (a=="40"){document.getElementById("mm").value="41";}
 else if (a=="41"){document.getElementById("mm").value="42";}
 else if (a=="42"){document.getElementById("mm").value="43";}
 else if (a=="43"){document.getElementById("mm").value="44";}
 else if (a=="44"){document.getElementById("mm").value="45";}
 else if (a=="45"){document.getElementById("mm").value="46";}
 else if (a=="46"){document.getElementById("mm").value="47";}
 else if (a=="47"){document.getElementById("mm").value="48";}
 else if (a=="48"){document.getElementById("mm").value="49";}
 else if (a=="49"){document.getElementById("mm").value="50";}
 else if (a=="50"){document.getElementById("mm").value="51";}
 else if (a=="51"){document.getElementById("mm").value="52";}
 else if (a=="52"){document.getElementById("mm").value="53";}
 else if (a=="53"){document.getElementById("mm").value="54";}
 else if (a=="54"){document.getElementById("mm").value="55";}
 else if (a=="55"){document.getElementById("mm").value="56";}
 else if (a=="56"){document.getElementById("mm").value="57";}
 else if (a=="57"){document.getElementById("mm").value="58";}
 else if (a=="58"){document.getElementById("mm").value="59";}
 else if (a=="59"){document.getElementById("mm").value="00"; addtimehh();}
}
//----------------------------------------------------------------------------
function addtimehh()
{
 var a=document.getElementById("hh").value;
 if (a=="00"){document.getElementById("hh").value="01";}
  else if (a=="01"){document.getElementById("hh").value="02";}
  else if (a=="02"){document.getElementById("hh").value="03";}
  else if (a=="03"){document.getElementById("hh").value="04";}
  else if (a=="04"){document.getElementById("hh").value="05";}
  else if (a=="05"){document.getElementById("hh").value="06";}
  else if (a=="06"){document.getElementById("hh").value="07";}
  else if (a=="07"){document.getElementById("hh").value="08";}
  else if (a=="08"){document.getElementById("hh").value="09";}
  else if (a=="09"){document.getElementById("hh").value="10";}
  else if (a=="10"){document.getElementById("hh").value="11";}
  else if (a=="11"){document.getElementById("hh").value="12";}
  else if (a=="12"){document.getElementById("hh").value="13";}
  else if (a=="13"){document.getElementById("hh").value="14";}
  else if (a=="14"){document.getElementById("hh").value="15";}
  else if (a=="15"){document.getElementById("hh").value="16";}
  else if (a=="16"){document.getElementById("hh").value="17";}
  else if (a=="17"){document.getElementById("hh").value="18";}
  else if (a=="18"){document.getElementById("hh").value="19";}
  else if (a=="19"){document.getElementById("hh").value="20";}
  else if (a=="20"){document.getElementById("hh").value="21";}
  else if (a=="21"){document.getElementById("hh").value="22";}
  else if (a=="22"){document.getElementById("hh").value="23";}
  else if (a=="23"){document.getElementById("hh").value="00";}
}
//**********************************
function timelondon()
{
 var a=document.getElementById("hh").value;
 var p="";
  if (a=="00"){p="01";}
  else if (a=="01"){p="02";}
  else if (a=="02"){p="03";}
  else if (a=="03"){p="04";}
  else if (a=="04"){p="05";}
  else if (a=="05"){p="06";}
  else if (a=="06"){p="07";}
  else if (a=="07"){p="08";}
  else if (a=="08"){p="09";}
  else if (a=="09"){p="10";}
  else if (a=="10"){p="11";}
  else if (a=="11"){p="12";}
  else if (a=="12"){p="13";}
  else if (a=="13"){p="14";}
  else if (a=="14"){p="15";}
  else if (a=="15"){p="16";}
  else if (a=="16"){p="17";}
  else if (a=="17"){p="18";}
  else if (a=="18"){p="19";}
  else if (a=="19"){p="20";}
  else if (a=="20"){p="21";}
  else if (a=="21"){p="22";}
  else if (a=="22"){p="23";}
  else if (a=="23"){p="00";}
 document.getElementById("london").value=p+":"+document.getElementById("mm").value;
}
//**********************************
function timenewyork()
{
 var a=document.getElementById("hh").value;
 var p="";
  if (a=="00"){p="20";}
  else if (a=="01"){p="21";}
  else if (a=="02"){p="22";}
  else if (a=="03"){p="23";}
  else if (a=="04"){p="00";}
  else if (a=="05"){p="01";}
  else if (a=="06"){p="02";}
  else if (a=="07"){p="03";}
  else if (a=="08"){p="04";}
  else if (a=="09"){p="05";}
  else if (a=="10"){p="06";}
  else if (a=="11"){p="07";}
  else if (a=="12"){p="08";}
  else if (a=="13"){p="09";}
  else if (a=="14"){p="10";}
  else if (a=="15"){p="11";}
  else if (a=="16"){p="12";}
  else if (a=="17"){p="13";}
  else if (a=="18"){p="14";}
  else if (a=="19"){p="15";}
  else if (a=="20"){p="16";}
  else if (a=="21"){p="17";}
  else if (a=="22"){p="18";}
  else if (a=="23"){p="19";}
 document.getElementById("newyork").value=p+":"+document.getElementById("mm").value;
}
//**********************************
function timebar()
{
 var a=document.getElementById("hh").value;
 var p="";
  if (a=="00"){p="02";}
  else if (a=="01"){p="03";}
  else if (a=="02"){p="04";}
  else if (a=="03"){p="05";}
  else if (a=="04"){p="06";}
  else if (a=="05"){p="07";}
  else if (a=="06"){p="08";}
  else if (a=="07"){p="09";}
  else if (a=="08"){p="10";}
  else if (a=="09"){p="11";}
  else if (a=="10"){p="12";}
  else if (a=="11"){p="13";}
  else if (a=="12"){p="14";}
  else if (a=="13"){p="15";}
  else if (a=="14"){p="16";}
  else if (a=="15"){p="17";}
  else if (a=="16"){p="18";}
  else if (a=="17"){p="19";}
  else if (a=="18"){p="20";}
  else if (a=="19"){p="21";}
  else if (a=="20"){p="22";}
  else if (a=="21"){p="23";}
  else if (a=="22"){p="00";}
  else if (a=="23"){p="01";}
 document.getElementById("bar").value=p+":"+document.getElementById("mm").value;
}
//**********************************
function timetokyo()
{
 var a=document.getElementById("hh").value;
 var p="";
  if (a=="00"){p="09";}
  else if (a=="01"){p="10";}
  else if (a=="02"){p="11";}
  else if (a=="03"){p="12";}
  else if (a=="04"){p="13";}
  else if (a=="05"){p="14";}
  else if (a=="06"){p="15";}
  else if (a=="07"){p="16";}
  else if (a=="08"){p="17";}
  else if (a=="09"){p="18";}
  else if (a=="10"){p="19";}
  else if (a=="11"){p="20";}
  else if (a=="12"){p="21";}
  else if (a=="13"){p="22";}
  else if (a=="14"){p="23";}
  else if (a=="15"){p="00";}
  else if (a=="16"){p="01";}
  else if (a=="17"){p="02";}
  else if (a=="18"){p="03";}
  else if (a=="19"){p="04";}
  else if (a=="20"){p="05";}
  else if (a=="21"){p="06";}
  else if (a=="22"){p="07";}
  else if (a=="23"){p="08";}
 document.getElementById("tokyo").value=p+":"+document.getElementById("mm").value;
}
//**********************************
function timesy()
{
 var a=document.getElementById("hh").value;
 var p="";
  if (a=="00"){p="10";}
  else if (a=="01"){p="11";}
  else if (a=="02"){p="12";}
  else if (a=="03"){p="13";}
  else if (a=="04"){p="14";}
  else if (a=="05"){p="15";}
  else if (a=="06"){p="16";}
  else if (a=="07"){p="17";}
  else if (a=="08"){p="18";}
  else if (a=="09"){p="19";}
  else if (a=="10"){p="20";}
  else if (a=="11"){p="21";}
  else if (a=="12"){p="22";}
  else if (a=="13"){p="23";}
  else if (a=="14"){p="00";}
  else if (a=="15"){p="01";}
  else if (a=="16"){p="02";}
  else if (a=="17"){p="03";}
  else if (a=="18"){p="04";}
  else if (a=="19"){p="05";}
  else if (a=="20"){p="06";}
  else if (a=="21"){p="07";}
  else if (a=="22"){p="08";}
  else if (a=="23"){p="09";}
 document.getElementById("sy").value=p+":"+document.getElementById("mm").value;
}
//***********************************
function timegmt()
{
//timegmtM();
timegmtH();
}
//**********************************
function timegmtM()
{
 var a=document.getElementById("mm").value;
 var p="";
  if (a=="00"){p="24";}
  else if (a=="01"){p="25";}
  else if (a=="02"){p="26";}
  else if (a=="03"){p="27";}
  else if (a=="04"){p="28";}
  else if (a=="05"){p="29";}
  else if (a=="06"){p="30";}
  else if (a=="07"){p="31";}
  else if (a=="08"){p="32";}
  else if (a=="09"){p="33";}
  else if (a=="10"){p="34";}
  else if (a=="11"){p="35";}
  else if (a=="12"){p="36";}
  else if (a=="13"){p="37";}
  else if (a=="14"){p="38";}
  else if (a=="15"){p="39";}
  else if (a=="16"){p="40";}
  else if (a=="17"){p="41";}
  else if (a=="18"){p="42";}
  else if (a=="19"){p="43";}
  else if (a=="20"){p="44";}
  else if (a=="21"){p="45";}
  else if (a=="22"){p="46";}
  else if (a=="23"){p="47";}
  else if (a=="24"){p="48";}
  else if (a=="25"){p="49";}
  else if (a=="26"){p="50";}
  else if (a=="27"){p="51";}
  else if (a=="28"){p="52";}
  else if (a=="29"){p="53";}
  else if (a=="30"){p="54";}
  else if (a=="31"){p="55";}
  else if (a=="32"){p="56";}
  else if (a=="33"){p="57";}
  else if (a=="34"){p="58";}
  else if (a=="35"){p="59";}
  else if (a=="36"){p="00";addtimehh();}
  else if (a=="37"){p="01";addtimehh();}
  else if (a=="38"){p="02";addtimehh();}
  else if (a=="39"){p="03";addtimehh();}
  else if (a=="40"){p="04";addtimehh();}
   else if (a=="41"){p="05";addtimehh();}
    else if (a=="42"){p="06";addtimehh();}
     else if (a=="43"){p="07";addtimehh();}
      else if (a=="44"){p="08";addtimehh();}
       else if (a=="45"){p="09";addtimehh();}
        else if (a=="46"){p="10";addtimehh();}
         else if (a=="47"){p="11";addtimehh();}
          else if (a=="48"){p="12";addtimehh();}
           else if (a=="49"){p="13";addtimehh();}
            else if (a=="50"){p="14";addtimehh();}
             else if (a=="51"){p="15";addtimehh();}
              else if (a=="52"){p="16";addtimehh();}
               else if (a=="53"){p="17";addtimehh();}
                else if (a=="54"){p="18";addtimehh();}
                 else if (a=="55"){p="19";addtimehh();}
                  else if (a=="56"){p="20";addtimehh();}
                   else if (a=="57"){p="21";addtimehh();}
                    else if (a=="58"){p="22";addtimehh();}                   
                    else if (a=="59"){p="23";addtimehh();}
 document.getElementById("mm").value=p;
}
//**********************************
function timegmtH()
{
 var a=document.getElementById("hh").value;
 var p="";
  if (a=="00"){p="05";}
  else if (a=="01"){p="06";}
  else if (a=="02"){p="07";}
  else if (a=="03"){p="08";}
  else if (a=="04"){p="09";}
  else if (a=="05"){p="10";}
  else if (a=="06"){p="11";}
  else if (a=="07"){p="12";}
  else if (a=="08"){p="13";}
  else if (a=="09"){p="14";}
  else if (a=="10"){p="15";}
  else if (a=="11"){p="16";}
  else if (a=="12"){p="17";}
  else if (a=="13"){p="18";}
  else if (a=="14"){p="19";}
  else if (a=="15"){p="20";}
  else if (a=="16"){p="21";}
  else if (a=="17"){p="22";}
  else if (a=="18"){p="23";}
  else if (a=="19"){p="00";}
  else if (a=="20"){p="01";}
  else if (a=="21"){p="02";}
  else if (a=="22"){p="03";}
  else if (a=="23"){p="04";}
 document.getElementById("hh").value=p;
}