<!--
var clockID = 0;
var timezone = 3600;
var offset = "";
var tzoffset = "";
var entries = 65;
var criteria = "";

var zone = new MakeArray(entries);

function MakeArray(n) {
   for (var i = 1; i <= n; i++) { this[i] = 0; }
   this.maxlen = n; this.len = 0; return this;
}

function addZone(zonename, timediff) {
  this.name = zonename; this.time = timediff;
}

function Add(name, time) {
  zone.len++; zone[zone.len] = new addZone(name, time);
}

/////////////////////////////////////////////////////////////////////////////
// Add Details for each timezone.
// ie. Add("Timezone Name", "Time Difference");

Add("Afghanistan", "+4.50");
Add("Albania", "+2.00");
Add("Algeria", "+1.00");
Add("American Samoa", "-11.00");
Add("Andorra", "+2.00");
Add("Angola", "+1.00");
Add("Anguilla", "-4.00");
Add("Antigua and Barbuda", "-4.00");
Add("Argentina", "-3.00");
Add("Armenia", "+5.00");
Add("Aruba", "-4.00");
Add("Australia - Australian Capital Territory", "+10.00"); Add("Australia - Broken Hill", "+9.50"); 
Add("Australia - Lord Howe Island", "+10.50"); 
Add("Australia - New South Wales", "+10.00");
Add("Australia - Northern Territory", "+9.5"); 
Add("Australia - Queensland", "+10.00"); 
Add("Australia - South Australia", "+9.50"); 
Add("Australia - Tasmania", "+10.00"); 
Add("Australia - Victoria", "+10.00"); 
Add("Australia - Western Australia", "+8.00"); 
Add("Austria", "+2.00"); 
Add("Azerbaijan", "+5.00"); 
Add("Bahamas", "-4.00"); 
Add("Bahrain", "+3.00"); 
Add("Bangladesh", "+6.00");
Add("Barbados", "-4.00"); 
Add("Belarus", "+3.00"); 
Add("Belgium", "+2.00"); 
Add("Belize", "-6.00"); 
Add("Benin", "+1.00"); 
Add("Bermuda", "-3.00"); 
Add("Bhutan", "+6.00"); 
Add("Bolivia", "-4.00"); 
Add("Bosnia and Herzegovnia", "+2.00"); 
Add("Brazil - Acre", "-5.00"); 
Add("Brazil - Alagoas", "-3.00"); 
Add("Brazil - Amapa", "-3.00"); 
Add("Brazil - Amazonas", "-4.00"); 
Add("Brazil - Bahia", "-3.00"); 
Add("Brazil - Ceara", "-3.00"); 
Add("Brazil - Distrito Federal", "-3.00"); 
Add("Brazil - Espirto Santo", "-3.00"); 
Add("Brazil - Fernando de Noronha", "-2.00"); 
Add("Brazil - Goias", "-3.00"); 
Add("Brazil - Maranhao", "-3.00"); 
Add("Brazil - Mato Grosso", "-4.00"); 
Add("Brazil - Mato Grosso do Sul", "-4.00"); 
Add("Brazil - Minas Gerais", "-3.00"); 
Add("Brazil - Para (eastern)", "-3.00"); 
Add("Brazil - Para (western)", "-4.00"); 
Add("Brazil - Paraiba", "-3.00"); 
Add("Brazil - Parana", "-3.00"); 
Add("Brazil - Pernambuco", "-3.00"); 
Add("Brazil - Piaui", "-3.00"); 
Add("Brazil - Rio de Janeiro", "-3.00"); 
Add("Brazil - Rio Grande do Norte", "-3.00"); 
Add("Brazil - Rio Grande do Sul", "-3.00"); 
Add("Brazil - Rondonia", "-4.00"); 
Add("Brazil - Roraima", "-4.00"); 
Add("Brazil - Santa Catarina", "-3.00"); 
Add("Brazil - Sao Paulo", "-3.00"); 
Add("Brazil - Sergipe", "-3.00"); 
Add("Brazil - Tocantins", "-3.00"); 
Add("Brunei Darussalam", "+8.00"); 
Add("Bulgaria", "+3.00"); 
Add("Burkina Faso", "+0.00"); 
Add("Burundi", "+2.00"); 
Add("Cambodia", "+7.00"); 
Add("Cameroon", "+1.00"); 
Add("Canada - Alberta", "-6.00"); 
Add("Canada - British Columbia", "-7.00"); 
Add("Canada - Labrador", "-3.00"); 
Add("Canada - Manitoba", "-5.00"); 
Add("Canada - New Brunswick", "-3.00"); 
Add("Canada - Newfoundland", "-2.50"); 
Add("Canada - Northwest Territories", "-6.00"); 
Add("Canada - Nova Scotia", "-3.00"); 
Add("Canada - Nunavut (Southampton Island)", "-5.00"); 
Add("Canada - Nunavut (Central)", "-5.00"); 
Add("Canada - Nunavut (Eastern)", "-4.00"); 
Add("Canada - Nunavut (Mountain)", "-6.00"); 
Add("Canada - Ontario", "-4.00"); 
Add("Canada - Ontario (western)", "-5.00"); 
Add("Canada - Prince Edward Island", "-3.00"); 
Add("Canada - Quebec", "-4.00"); 
Add("Canada - Saskatchewan", "-6.00"); 
Add("Canada - Yukon", "-7.00"); 
Add("Cape Verde", "-1.00"); 
Add("Cayman Islands", "-5.00"); 
Add("Central African Republic", "+1.00");
Add("Chad", "+1.00"); Add("Chile", "-4.00"); 
Add("Chile - Easter Island", "-6.00"); 
Add("China", "+8.00"); 
Add("Christmas Island (Indian Ocean)", "+7.00"); 
Add("Cocos Islands", "+6.50"); 
Add("Colombia", "-5.00");
Add("Comoros", "+1.00"); 
Add("Congo", "+1.00");
Add("Cook Islands", "-10.00"); 
Add("Costa Rica", "-6.00"); 
Add("Cote D'Ivoire", "0.00"); 
Add("Croatia", "+2.00"); 
Add("Cuba", "-4.00"); 
Add("Cyprus", "+3.00"); 
Add("Czech Republic", "+2.00"); 
Add("Denmark", "+2.00"); 
Add("Djibouti", "+3.00"); 
Add("Dominica", "-4.00"); 
Add("Dominican Republic", "-4.00"); 
Add("Ecuador", "-5.00"); 
Add("Ecuador - Galapagos Islands", "-6.00"); 
Add("Egypt", "+2.00"); 
Add("El Salvador", "-6.00"); 
Add("Equatorial Guinea", "+1.00"); 
Add("Eritrea", "+3.00"); 
Add("Estonia", "+3.00"); 
Add("Ethiopia", "+3.00"); 
Add("Falkland Islands", "-4.00"); 
Add("Faroe Islands", "1.00"); 
Add("Fiji", "+12.00"); 
Add("Finland", "+3.00"); 
Add("France", "+2.00"); 
Add("French Guiana", "-3.00"); 
Add("French Polynesia - Gambier Islands", "-9.00"); 
Add("French Polynesia - Marquesas Islands", "-9.30"); 
Add("French Polynesia - Society Archipelago", "-10.00");
Add("French Polynesia - Tuamotu Archipelago", "-10.00"); 
Add("French Polynesia - Tubuai Islands", "-10.00"); 
Add("Gabon", "+1.00"); 
Add("Gambia", "0.00"); 
Add("Georgia", "+4.00"); 
Add("Germany", "+2.00"); 
Add("Ghana", "0.00"); 
Add("Gibraltar", "+2.00"); 
Add("Greece", "+3.00"); 
Add("Greenland - Greenland", "-2.00"); 
Add("Greenland - Ittoqqortoormiit", "-0.00"); 
Add("Greenland - Pituffik", "-3.00"); 
Add("Grenada", "-4.00"); 
Add("Guadeloupe", "-4.00"); 
Add("Guam", "+10.00"); 
Add("Guatemala", "-6.00"); 
Add("Guinea", "0.00"); 
Add("Guinea-Bissau", "0.00"); 
Add("Guyana", "-4.00"); 
Add("Haiti", "-4.00"); 
Add("Honduras", "-6.00"); 
Add("Hong Kong", "+8.00"); 
Add("Hungary", "+2.00"); 
Add("Iceland", "0.00"); 
Add("India", "+5.50"); 
Add("Indonesia (central)", "+8.00"); 
Add("Indonesia (eastern)", "+9.00"); 
Add("Indonesia (western)", "+7.00"); 
Add("Iran", "+4.50"); 
Add("Iraq", "+4.00"); 
Add("Ireland", "+1.00"); 
Add("Israel", "+3.00"); 
Add("Italy", "+2.00"); 
Add("Jamaica", "-5.00"); 
Add("Japan", "+9.00"); 
Add("Johnston Atoll (U.S.)", "-10.00"); 
Add("Jordan", "+3.00"); 
Add("Kazakhstan (central)", "+5.00"); 
Add("Kazakhstan (eastern)", "+6.00"); 
Add("Kazakhstan (western)", "+4.00"); 
Add("Kenya", "+3.00"); 
Add("Kiribati - Gilbert Islands", "+12.00"); 
Add("Kiribati - Line Islands", "+14.00"); 
Add("Kiribati - Phoenix Islands", "+13.00"); 
Add("Korea (north)", "+9.00"); 
Add("Korea (south)", "+9.00"); 
Add("Kuwait", "+3.00"); 
Add("Kyrgyzstan", "+6.00"); 
Add("Laos", "+7.00"); 
Add("Latvia", "+3.00"); 
Add("Lebanon", "+3.00"); 
Add("Lesotho", "+2.00"); 
Add("Liberia", "0.00"); 
Add("Libyan Arab Jamahiriya", "+2.00"); 
Add("Liechtenstein", "+2.00"); 
Add("Lithuania", "+3.00"); 
Add("Luxembourg", "+2.00"); 
Add("Macao", "+8.00"); 
Add("Macedonia", "+2.00"); 
Add("Madagascar", "+3.00"); 
Add("Malawi", "+2.00"); 
Add("Malaysia", "+8.00"); 
Add("Maldives", "+5.00"); 
Add("Mali", "0.00"); 
Add("Malta", "+2.00"); 
Add("Marshall Islands", "+12.00"); 
Add("Martinique", "-4.00"); 
Add("Mauritania", "0.00"); 
Add("Mauritius", "+4.00"); 
Add("Mayotte", "+3.00"); 
Add("Mexico - Baja California Norte", "-7.00"); 
Add("Mexico - Baja California Sur", "-6.00"); 
Add("Mexico - Chihuahua", "-6.00"); 
Add("Mexico - Nayarit", "-6.00"); 
Add("Mexico - Sinaloa", "-6.00"); 
Add("Mexico - Sonora", "-7.00"); 
Add("Mexico (central)", "-5.00"); 
Add("Mexico (eastern)", "-5.00"); 
Add("Mexico (western)", "-5.00"); 
Add("Micronesia - Kosrae Pohnpei", "+11.00"); 
Add("Micronesia - Yap Chuuk", "+10.00"); 
Add("Moldova", "+3.00"); 
Add("Monaco", "+2.00"); 
Add("Mongolia", "+8.00"); 
Add("Montserrat", "-4.00"); 
Add("Morocco", "0.00"); 
Add("Mozambique", "+2.00"); 
Add("Myanmar", "+6.50"); 
Add("Namibia", "+1.00"); 
Add("Nauru", "+12.00"); 
Add("Nepal", "+5.75"); 
Add("Netherlands", "+2.00"); 
Add("Netherlands Antilles", "-4.00"); 
Add("New Caledonia", "+11.00"); 
Add("New Zealand", "+12.00"); 
Add("New Zealand - Chatham Islands", "+12.75"); 
Add("Nicaragua", "-5.00"); 
Add("Niger", "+1.00"); 
Add("Nigeria", "+1.00"); 
Add("Niue", "-11.00"); 
Add("Norfolk Island", "+11.50"); 
Add("Northern Mariana Islands", "+10.00"); 
Add("Norway", "+2.00"); 
Add("Oman", "+4.00"); 
Add("Pakistan", "+5.00"); 
Add("Palau", "+9.00"); 
Add("Palestinian Territory", "+3.00"); 
Add("Panama", "-5.00"); 
Add("Papua New Guinea", "+10.00"); 
Add("Paraguay", "-4.00"); 
Add("Peru", "-5.00"); 
Add("Philippines", "+8.00"); 
Add("Poland", "+2.00"); 
Add("Portugal - Azores", "+1.00"); 
Add("Portugal - Mainland Maderia", "0.00"); 
Add("Puerto Rico", "-4.00"); 
Add("Reunion", "+4.00"); 
Add("Romania", "+3.00"); 
Add("Russian Federation - Zone 1", "+2.00"); 
Add("Russian Federation - Zone 2", "+3.00"); 
Add("Russian Federation - Zone 3", "+4.00"); 
Add("Russian Federation - Zone 4", "+5.00"); 
Add("Russian Federation - Zone 5", "+6.00"); 
Add("Russian Federation - Zone 6", "+7.00"); 
Add("Russian Federation - Zone 7", "+8.00"); 
Add("Russian Federation - Zone 8", "+9.00"); 
Add("Russian Federation - Zone 9", "+10.00"); 
Add("Russian Federation - Zone 10", "+11.00"); 
Add("Russian Federation - Zone 11", "+12.00"); 
Add("Rwanda", "+2.00"); 
Add("Saint Helena", "0.00"); 
Add("Saint Kitts and Nevis", "-4.00"); 
Add("Saint Lucia", "-4.00"); 
Add("Saint Pierre and Miquelon", "-2.00"); 
Add("Saint Vincent and The Grenadines", "-4.00"); 
Add("Samoa", "-11.00"); 
Add("San Marino", "+2.00"); 
Add("Sao Tome and Principe", "0.00"); 
Add("Saudi Arabia", "+3.00"); 
Add("Senegal", "0.00"); 
Add("Serbia and Montenegro", "+2.00"); 
Add("Seychelles", "+4.00"); 
Add("Sierra Leone", "0.00"); 
Add("Singapore", "+8.00"); 
Add("Slovakia", "+2.00"); 
Add("Slovenia", "+2.00"); 
Add("Solomon Islands", "+11.00"); 
Add("Somalia", "+3.00"); 
Add("South Africa", "+2.00"); 
Add("Spain - Canary Islands", "+1.00"); 
Add("Spain - Mainland, Baleares, Melilla, Ceuta", "+2.00"); 
Add("Sri Lanka", "+6.00"); 
Add("Sudan", "+3.00"); 
Add("Suriname", "-3.00"); 
Add("Svalbard and Jan Mayen", "+2.00"); 
Add("Swaziland", "+2.00");
Add("Sweden", "+2.00"); 
Add("Switzerland", "+2.00"); 

Add("Syrian Arab Republic", "+3.00"); 
Add("Taiwan", "+8.00"); 
Add("Tajikistan", "+5.00"); 
Add("Tanzania", "+3.00"); 
Add("Thailand", "+7.00"); 
Add("Timor-Leste", "+9.00"); 
Add("Togo", "0.00"); 
Add("Tokelau", "-10.00"); 
Add("Tonga", "+13.00"); 
Add("Trinidad and Tobago", "-4.00"); 
Add("Tunisia", "+1.00"); 
Add("Turkey", "+3.00"); 
Add("Turkmenistan", "+5.00"); 
Add("Turks and Caicos Islands", "-4.00"); 
Add("Tuvalu", "+12.00"); 
Add("Uganda", "+3.00"); 
Add("Ukraine", "+3.00"); 
Add("United Arab Emirates", "+4.00"); 
Add("United Kingdom", "+1.00"); 
Add("United States - Alabama", "-5.00"); 
Add("United States - Alaska", "-8.00"); 
Add("United States - Alaska (Aleutian Islands)", "-9.00"); 
Add("United States - Arizona", "-7.00"); 
Add("United States - Arkansas", "-5.00"); 
Add("United States - California", "-7.00"); 
Add("United States - Colorado", "-6.00"); 
Add("United States - Connecticut", "-4.00"); 
Add("United States - Delaware", "-4.00"); 
Add("United States - District of Columbia", "-4.00"); 
Add("United States - Florida", "-4.00"); 
Add("United States - Florida (far west)", "-5.00"); 
Add("United States - Georgia", "-4.00"); 
Add("United States - Hawaii", "-10.00"); 
Add("United States - Idaho (northern)", "-7.00"); 
Add("United States - Idaho (southern)", "-6.00"); 
Add("United States - Illinois", "-6.00"); 
Add("United States - Indiana", "-5.00"); 
Add("United States - Indiana (SW and NW corners)", "-5.00"); Add("United States - Iowa", "-5.00"); 
Add("United States - Kansas", "-5.00"); 
Add("United States - Kansas (exception)", "-6.00"); 
Add("United States - Kentucky (eastern)", "-4.00"); 
Add("United States - Kentucky (western)", "-5.00"); 
Add("United States - Louisiana", "-5.00"); 
Add("United States - Maine", "-4.00"); 
Add("United States - Maryland", "-4.00"); 
Add("United States - Massachusetts", "-4.00"); 
Add("United States - Michigan", "-4.00"); 
Add("United States - Michigan (exception)", "-5.00"); 
Add("United States - Minnesota", "-5.00"); 
Add("United States - Missouri", "-5.00"); 
Add("United States - Montana", "-6.00"); 
Add("United States - Nebraska", "-5.00"); 
Add("United States - Nebraska (western)", "-6.00"); 
Add("United States - Nevada", "-7.00"); 
Add("United States - New Hampshire", "-4.00"); 
Add("United States - New Jersey", "-4.00"); 
Add("United States - New Mexico", "-6.00"); 
Add("United States - New York", "-4.00"); 
Add("United States - North Carolina", "-4.00"); 
Add("United States - North Dakota", "-5.00"); 
Add("United States - North Dakota (western)", "-6.00"); 
Add("United States - Ohio", "-4.00"); 
Add("United States - Oklahoma", "-5.00"); 
Add("United States - Oregon", "-7.00"); 
Add("United States - Oregon (exception)", "-6.00"); 
Add("United States - Pennsylvania", "-4.00"); 
Add("United States - Rhode Island", "-4.00"); 
Add("United States - South Carolina", "-4.00"); 
Add("United States - South Dakota (eastern)", "-5.00"); 
Add("United States - South Dakota (western)", "-6.00"); 
Add("United States - Tennessee (eastern)", "-4.00"); 
Add("United States - Tennessee (western)", "-5.00"); 
Add("United States - Texas", "-5.00"); 
Add("United States - Texas (far west)", "-6.00"); 
Add("United States - Utah", "-6.00"); 
Add("United States - Vermont", "-4.00"); 
Add("United States - Virginia", "-4.00"); 
Add("United States - Washington", "-7.00"); 
Add("United States - West Virginia", "-4.00"); 
Add("United States - Wisconsin", "-5.00"); 
Add("United States - Wyoming", "-6.00"); 
Add("Uruguay", "-3.00"); 
Add("Uzbekistan", "+5.00"); 
Add("Vanuatu", "+11.00"); 
Add("Venezuela", "-4.00"); 
Add("Vietnam", "+7.00"); 
Add("Virgin Islands (British)", "-4.00"); 
Add("Virgin Islands (U.S.)", "-4.00"); 
Add("Wake Island (U.S.)", "+12.00"); 
Add("Wallis and Futuna", "+12.00"); 
Add("Yemen", "+3.00"); 
Add("Zambia", "+2.00"); 
Add("Zimbabwe", "+2.00");


// End of timezone entries.
/////////////////////////////////////////////////////////////////////////////

function searchTimeZone() {
   var doc = document.forms['clock'];
   doc.timezone.selectedIndex = 0;
   document.clock.date.value = "";
   document.clock.time.value = "";
   document.clock.country.value = "";
   KillClock();
   criteria = prompt("Enter the time zone you are looking for?", criteria);
   if (criteria) criteria = criteria.toLowerCase();
   zonefound = 0;
   for (i=1; i<=zone.len; i++) {
      zonefind = zone[i].name.toLowerCase();
      if (zonefind.indexOf(criteria) >= 0 && (!zonefound) && (criteria)) {
         doc.timezone.selectedIndex = i;
         timezone = parseFloat(zone[i].time);
         StartClock();
         zonefound++;
      }
   }
   if (!zonefound && (criteria)) {
      alert("Unable to find the specified time zone.");
      setTimeout("searchTimeZone()", 200);
   }
}

function changeTimeZone(tz) {
   var doc = document.forms['clock'];
   var newzone = doc.timezone.options[doc.timezone.selectedIndex].text
   KillClock();
   document.clock.country.value = newzone;
   if (!doc.timezone.selectedIndex) {
       KillClock();
       document.clock.date.value = "";	   
       document.clock.time.value = "";       
   }else{
       newzone = zone[doc.timezone.selectedIndex].name;	   
       timezone = parseFloat(tz);
       StartClock();
   }
}

function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
   var tDate = new Date();
   tDate.setTime(tDate.getTime() + (timezone * 3600000)); tDate.toGMTString();
   newtime = tDate.toGMTString(); newtime = newtime.substring(0,25);
   ndate = newtime.substring(0,16); ntime = newtime.substring(17,19);
   otime = newtime.substring(19); ohour = parseInt(ntime.substring(0,2));
   ampm = (parseInt(ohour) < 12) ? " AM" : " PM";
   nhour = (parseInt(ntime) >= 13) ? "" + (parseInt(ntime) - 12) + "" : ntime;
   if(ntime == "00" || ntime == "0") { nhour = "12"; }
   if (nhour.substring(0,1) == "0") nhour = nhour.substring(1,2);
   if (nhour.length == 1) nhour = " " + nhour;
   ntime = nhour + otime + ampm;
   document.clock.date.value = ndate;
   document.clock.time.value = ntime;
   clockID = setTimeout("UpdateClock()", 1000);

}

function StartClock() {
   clockID = setTimeout("UpdateClock()", 200);
}

function KillClock() {
   if(clockID) {
      document.clock.date.value = "";
      document.clock.time.value = "";
      clearTimeout(clockID);
      clockID  = 0;
   }
}


document.write('<h4>World Time Clock</h4>');
document.write('<form name="clock"><select  style="font-size:9px;" name=timezone onChange="changeTimeZone(this.options[this.selectedIndex].value)">');
document.write('<option value=0>Select Destination...</option>');
for (i=1; i<=zone.len; i++) {
    offset = zone[i].time.split(".");
    hoffset = offset[0];
    moffset = (parseInt(offset[1])) ? "30" : "00";
    tzoffset = hoffset + ":" + moffset 
 
    document.write('<option value="' + zone[i].time + '">' + zone[i].name);
    if (parseInt(zone[i].time));
    document.write('</option>\n');
}
document.write('</select><br><br>');
document.write('<input style="font-size:9px;" class=worldtime2 size=40 type=text name="country" onFocus="this.blur()"><br>');
document.write('<input style="font-size:9px;" class=worldtime size=15 type=text name="time" onFocus="this.blur()"><br>');
document.write('<input style="font-size:9px;" class=worldtime3 size=20 type=text name="date" onFocus="this.blur()">');
document.write('</form>');
-->
