var weekdays = new Array();
weekdays[0] = "Sunday";
weekdays[1] = "Monday";
weekdays[2] = "Tuesday";
weekdays[3] = "Wednesday";
weekdays[4] = "Thursday";
weekdays[5] = "Friday";
weekdays[6] = "Saturday";

var months = new Array();
months[0] = "January";
months[1] = "February";
months[2] = "March";
months[3] = "April";
months[4] = "May";
months[5] = "June";
months[6] = "July";
months[7] = "August";
months[8] = "September";
months[9] = "October";
months[10] = "November";
months[11] = "December";

var africa = new Array();
africa[0] = "Coordinated Universal Time;UTC;0;";
africa[1] = "Algiers, Algeria;DZ;1;";
africa[2] = "Luanda, Angola;AO;1;";
africa[3] = "Porto Novo, Benin;BJ;1;";
africa[4] = "Gaborone, Botswana;BW;2;";
africa[5] = "Ouagadougou, Burkina Faso;BF;0;";
africa[6] = "Bujumbura, Burundi;BI;2;";
africa[7] = "Yaounde, Cameroon;CM;1;";
africa[8] = "Praia, Cape Verde;CV;-1;";
africa[9] = "Bangui, Central African Republic;CF;1;";
africa[10] = "N'Djamena, Chad;TD;1;";
africa[11] = "Moroni, Comoros;KM;3;";
africa[12] = "Abidjan, Cote d'Ivoire;CI;0;";
africa[13] = "Kinshasa, Democratic Republic of the Congo;CD;1;";
africa[14] = "Lubumbashi, Democratic Republic of the Congo;CD;2;";
africa[15] = "Djibouti, Djibouti;DJ;3;";
africa[16] = "Cairo, Egypt;EG;2;seg";
africa[17] = "Malabo, Equatorial Guinea;GQ;1;";
africa[18] = "Asmara, Eritrea;ER;3;";
africa[19] = "Addis Ababa, Ethiopia;ET;3;";
africa[20] = "Libreville, Gabon;GA;1;";
africa[21] = "Banjul, Gambia;GM;0;";
africa[22] = "Accra, Ghana;GH;0;";
africa[23] = "Conakry, Guinea;GN;0;";
africa[24] = "Bissau, Guinea-Bissau;GW;0;";
africa[25] = "Nairobi, Kenya;KE;3;";
africa[26] = "Maseru, Lesotho;LS;2;";
africa[27] = "Monrovia, Liberia;LR;0;";
africa[28] = "Tripoli, Libya;LY;2;";
africa[29] = "Antananarivo, Madagascar;MG;3;";
africa[30] = "Lilongwe, Malawi;MW;2;";
africa[31] = "Bamako, Mali;ML;0;";
africa[32] = "Nouakchott, Mauritania;MR;0;";
africa[33] = "Port Louis, Mauritius;MU;4;";
africa[34] = "Mamoutzou, Mayotte;YT;3;";
africa[35] = "Casablanca, Morocco;MA;0;";
africa[36] = "Rabat, Morocco;MA;0;";
africa[37] = "Maputo, Mozambique;MZ;2;";
africa[38] = "Windhoek, Namibia;NA;1;sna";
africa[39] = "Niamey, Niger;NE;1;";
africa[40] = "Abuja, Nigeria;NG;1;";
africa[41] = "Lagos, Nigeria;NG;1;";
africa[42] = "Brazzaville, Republic of the Congo;CG;1;";
africa[43] = "Saint-Denis, Reunion;RE;4;";
africa[44] = "Kigali, Rwanda;RW;2;";
africa[45] = "Jamestown, Saint Helena;SH;0;";
africa[46] = "Sao Tome, Sao Tome and Principe;ST;0;";
africa[47] = "Dakar, Senegal;SN;0;";
africa[48] = "Victoria, Seychelles;SC;4;";
africa[49] = "Freetown, Sierra Leone;SL;0;";
africa[50] = "Mogadishu, Somalia;SO;3;";
africa[51] = "Cape Town, South Africa;ZA;2;";
africa[52] = "Johannesburg, South Africa;ZA;2;";
africa[53] = "Pretoria, South Africa;ZA;2;";
africa[54] = "Khartoum, Sudan;SD;3;";
africa[55] = "Mbabane, Swaziland;SZ;2;";
africa[56] = "Dar es Salaam, Tanzania;TZ;3;";
africa[57] = "Dodoma, Tanzania;TZ;3;";
africa[58] = "Lome, Togo;TG;0;";
africa[59] = "Tunis, Tunisia;TN;1;stn";
africa[60] = "Kampala, Uganda;UG;3;";
africa[61] = "El Aaiun, Western Sahara;EH;0;";
africa[62] = "Lusaka, Zambia;ZM;2;";
africa[63] = "Harare, Zimbabwe;ZW;2;";

var asia = new Array();
asia[0] = "Coordinated Universal Time;UTC;0;";
asia[1] = "Kabul, Afghanistan;AF;4.5;";
asia[2] = "Yerevan, Armenia;AM;4;sam";
asia[3] = "Baku, Azerbaijan;AZ;4;saz";
asia[4] = "Manama, Bahrain;BH;3;";
asia[5] = "Dhaka, Bangladesh;BD;6;";
asia[6] = "Thimphu, Bhutan;BT;6;";
asia[7] = "Bandar Seri Begawan, Brunei;BN;8;";
asia[8] = "Rangoon, Burma;MM;6.5;";
asia[9] = "Phnom Penh, Cambodia;KH;7;";
asia[10] = "Beijing, China;CN;8;";
asia[11] = "Hong Kong, China;HK;8;";
asia[12] = "Macau, China;MO;8;";
asia[13] = "Shanghai, China;MO;8;";
asia[14] = "Dili, East Timor;TL;9;";
asia[15] = "Tbilisi, Georgia;GE;4;";
asia[16] = "Mumbai, India;IN;5.5;";
asia[17] = "New Delhi, India;IN;5.5;";
asia[18] = "Denpasar, Bali, Indonesia;ID;8;";
asia[19] = "Jakarta, Java, Indonesia;ID;7;";
asia[20] = "Ambon, Maluku, Indonesia;ID;9;";
asia[21] = "Tehran, Iran;IR;3.5;";
asia[22] = "Baghdad, Iraq;IQ;3;siq";
asia[23] = "Jerusalem, Israel;IL;2;sil";
asia[24] = "Tel Aviv, Israel;IL;2;sil";
asia[25] = "Hiroshima, Japan;JP;9;";
asia[26] = "Kyoto, Japan;JP;9;";
asia[27] = "Nagasaki, Japan;JP;9;";
asia[28] = "Osaka, Japan;JP;9;";
asia[29] = "Tokyo, Japan;JP;9;";
asia[30] = "Yokohama, Japan;JP;9;";
asia[31] = "Amman, Jordan;JO;2;sjo";
asia[32] = "Almaty, Kazakhstan;KZ;6;";
asia[33] = "Aqtau, Kazakhstan;KZ;5;";
asia[34] = "Astana, Kazakhstan;KZ;6;";
asia[35] = "Kuwait City, Kuwait;KW;3;";
asia[36] = "Bishkek, Kyrgyzstan;KG;6;";
asia[37] = "Vientiane, Laos;LA;7;";
asia[38] = "Beirut, Lebanon;LB;2;slb";
asia[39] = "Kuala Lumpur, Malaysia;MY;8;";
asia[40] = "Male, Maldives;MV;5;";
asia[41] = "Hovd, Mongolia;MN;7;smn";
asia[42] = "Ulaanbaatar, Mongolia;MN;8;smn";
asia[43] = "Kathmandu, Nepal;NP;5.75;";
asia[44] = "Pyongyang, North Korea;KP;9;";
asia[45] = "Muscat, Oman;OM;4;";
asia[46] = "Islamabad, Pakistan;PK;5;";
asia[47] = "Karachi, Pakistan;PK;5;";
asia[48] = "Manila, Philippines;PH;8;";
asia[49] = "Quezon City, Philippines;PH;8;";
asia[50] = "Doha, Qatar;QA;3;";
asia[51] = "Mecca, Saudi Arabia;SA;3;";
asia[52] = "Riyadh, Saudi Arabia;SA;3;";
asia[53] = "Singapore, Singapore;SG;8;";
asia[54] = "Seoul, South Korea;KR;9;";
asia[55] = "Colombo, Sri Lanka;LK;5.5;";
asia[56] = "Damascus, Syria;SY;2;ssy";
asia[57] = "Taipei, Taiwan;TW;8;";
asia[58] = "Dushanbe, Tajikistan;TJ;5;";
asia[59] = "Bangkok, Thailand;TH;7;";
asia[60] = "Ankara, Turkey;TR;2;str";
asia[61] = "Istanbul, Turkey;TR;2;str";
asia[62] = "Ashgabat, Turkmenistan;TM;5;";
asia[63] = "Abu Dhabi, United Arab Emirates;AE;4;";
asia[64] = "Dubai, United Arab Emirates;AE;4;";
asia[65] = "Tashkent, Uzbekistan;UZ;5;";
asia[66] = "Hanoi, Vietnam;VN;7;";
asia[67] = "Ho Chi Minh City, Vietnam;VN;7;";
asia[68] = "Sanaa, Yemen;YE;3;";

var caribbean = new Array();
caribbean[0] = "Coordinated Universal Time;UTC;0;";
caribbean[1] = "The Valley, Anguilla;AI;-4;";
caribbean[2] = "Saint John's, Antigua and Barbuda;AG;-4;";
caribbean[3] = "Oranjestad, Aruba;AW;-4;";
caribbean[4] = "Nassau, Bahamas;BS;-5;sbs";
caribbean[5] = "Bridgetown, Barbados;BB;-4;";
caribbean[6] = "Road Town, British Virgin Islands;VG;-4;";
caribbean[7] = "George Town, Grand Cayman, Cayman Islands;KY;-5;";
caribbean[8] = "Havana, Cuba;CU;-5;scu";
caribbean[9] = "Roseau, Dominica;DM;-4;";
caribbean[10] = "Santo Domingo, Dominican Republic;DO;-4;";
caribbean[11] = "Saint George's, Grenada;GD;-4;";
caribbean[12] = "Basse-Terre, Guadeloupe;GP;-4;";
caribbean[13] = "Port-au-Prince, Haiti;HT;-5;sht";
caribbean[14] = "Kingston, Jamaica;JM;-5;";
caribbean[15] = "Fort-de-France, Martinique;MQ;-4;";
caribbean[16] = "Plymouth, Montserrat;MS;-4;";
caribbean[17] = "Willemstad, Curacao, Netherlands Antilles;AN;-4;";
caribbean[18] = "San Juan, Puerto Rico;PR;-4;";
caribbean[19] = "Basseterre, Saint Kitts and Nevis;KN;-4;";
caribbean[20] = "Castries, Saint Lucia;LC;-4;";
caribbean[21] = "Kingstown, Saint Vincent and the Grenadines;VC;-4;";
caribbean[22] = "Port-of-Spain, Trinidad and Tobago;TT;-4;";
caribbean[23] = "Grand Turk, Turks and Caicos Islands;TC;-5;stc";
caribbean[24] = "Charlotte Amalie, US Virgin Islands;VI;-4;";

var centralamerica = new Array();
centralamerica[0] = "Coordinated Universal Time;UTC;0;";
centralamerica[1] = "Belmopan, Belize;BZ;-6;";
centralamerica[2] = "San Jose, Costa Rica;CR;-6;";
centralamerica[3] = "San Salvador, El Salvador;SV;-6;";
centralamerica[4] = "Guatemala, Guatemala;GT;-6;sgt";
centralamerica[5] = "Tegucigalpa, Honduras;HN;-6;shn";
centralamerica[6] = "Chihuahua, Mexico;MX;-7;smx";
centralamerica[7] = "Mexicali, Mexico;MX;-8;smx";
centralamerica[8] = "Mexico City, Mexico;MX;-6;smx";
centralamerica[9] = "Managua, Nicaragua;NI;-6;sni";
centralamerica[10] = "Panama, Panama;PA;-5;";

var europe = new Array();
europe[0] = "Coordinated Universal Time;UTC;0;";
europe[1] = "Tirana, Albania;AL;1;seu1";
europe[2] = "Andorra la Vella, Andorra;AD;1;seu1";
europe[3] = "Salzburg, Austria, EU;AT;1;seu1";
europe[4] = "Vienna, Austria, EU;AT;1;seu1";
europe[5] = "Minsk, Belarus;BY;2;seu1";
europe[6] = "Brussels, Belgium, EU;BE;1;seu1";
europe[7] = "Sarajevo, Bosnia and Herzegovina;BA;1;seu1";
europe[8] = "Sofia, Bulgaria;BG;2;seu2";
europe[9] = "Zagreb, Croatia;HR;1;seu1";
europe[10] = "Nicosia, Cyprus, EU;CY;2;seu2";
europe[11] = "Prague, Czech Republic, EU;CZ;1;seu1";
europe[12] = "Copenhagen, Denmark, EU;DK;1;seu1";
europe[13] = "Tallinn, Estonia, EU;EE;2;seu2";
europe[14] = "Torshavn, Faroe Islands;FO;0;seu3";
europe[15] = "Helsinki, Finland, EU;FI;2;seu2";
europe[16] = "Bordeaux, France, EU;FR;1;seu1";
europe[17] = "Lyon, France, EU;FR;1;seu1";
europe[18] = "Marseille, France, EU;FR;1;seu1";
europe[19] = "Nice, France, EU;FR;1;seu1";
europe[20] = "Paris, France, EU;FR;1;seu1";
europe[21] = "Strasbourg, France, EU;FR;1;seu1";
europe[22] = "Toulouse, France, EU;FR;1;seu1";
europe[23] = "Ajaccio, Corsica, France, EU;FR;1;seu1";
europe[24] = "Berlin, Germany, EU;DE;1;seu1";
europe[25] = "Frankfurt, Germany, EU;DE;1;seu1";
europe[26] = "Hamburg, Germany, EU;DE;1;seu1";
europe[27] = "Munich, Germany, EU;DE;1;seu1";
europe[28] = "Gibraltar, Gibraltar;GI;1;seu1";
europe[29] = "Athens, Greece, EU;GR;2;seu2";
europe[30] = "Saint Peter Port, Guernsey;GG;0;seu3";
europe[31] = "Budapest, Hungary, EU;HU;1;seu1";
europe[32] = "Reykjavik, Iceland;IS;0;";
europe[33] = "Dublin, Ireland, EU;IE;0;seu3";
europe[34] = "Douglas, Isle of Man;IM;0;seu3";
europe[35] = "Milan, Italy, EU;IT;1;seu1";
europe[36] = "Naples, Italy, EU;IT;1;seu1";
europe[37] = "Rome, Italy, EU;IT;1;seu1";
europe[38] = "Venice, Italy, EU;IT;1;seu1";
europe[39] = "Palermo, Sicily, Italy, EU;IT;1;seu1";
europe[40] = "Jan Mayen, Jan Mayen;SJ;1;seu1";
europe[41] = "Saint Helier, Jersey;JE;0;seu3";
europe[42] = "Riga, Latvia, EU;LV;2;seu2";
europe[43] = "Vaduz, Liechtenstein;LI;1;seu1";
europe[44] = "Vilnius, Lithuania, EU;LT;2;seu2";
europe[45] = "Luxembourg, Luxembourg, EU;LU;1;seu1";
europe[46] = "Skopje, Macedonia;MK;1;seu1";
europe[47] = "Valletta, Malta, EU;MT;1;seu1";
europe[48] = "Chisinau, Moldova;MD;2;seu2";
europe[49] = "Monaco, Monaco;MC;1;seu1";
europe[50] = "Podgorica, Montenegro;CS;1;seu1";
europe[51] = "Amsterdam, Netherlands, EU;NL;1;seu1";
europe[52] = "Rotterdam, Netherlands, EU;NL;1;seu1";
europe[53] = "Oslo, Norway;NO;1;seu1";
europe[54] = "Warsaw, Poland, EU;PL;1;seu1";
europe[55] = "Lisbon, Portugal, EU;PT;0;seu3";
europe[56] = "Porto, Portugal, EU;PT;0;seu3";
europe[57] = "Ponta Delgada, Azores, Portugal, EU;PT;-1;seu4";
europe[58] = "Funchal, Madeira, Portugal, EU;PT;0;seu3";
europe[59] = "Bucharest, Romania;RO;2;seu2";
europe[60] = "Irkutsk, Russia;RU;8;seu1";
europe[61] = "Kaliningrad, Russia;RU;2;seu1";
europe[62] = "Kamchatka, Russia;RU;12;seu1";
europe[63] = "Kazan, Russia;RU;3;seu1";
europe[64] = "Krasnoyarsk, Russia;RU;7;seu1";
europe[65] = "Magadan, Russia;RU;11;seu1";
europe[66] = "Moscow, Russia;RU;3;seu1";
europe[67] = "Novosibirsk, Russia;RU;6;seu1";
europe[68] = "Omsk, Russia;RU;6;seu1";
europe[69] = "Saint Petersburg, Russia;RU;3;seu1";
europe[70] = "Samara, Russia;RU;4;seu1";
europe[71] = "Vladivostok, Russia;RU;10;seu1";
europe[72] = "Volgograd, Russia;RU;3;seu1";
europe[73] = "Yakutsk, Russia;RU;9;seu1";
europe[74] = "Yekaterinburg, Russia;RU;5;seu1";
europe[75] = "San Marino, San Marino;SM;1;seu1";
europe[76] = "Belgrade, Serbia;CS;1;seu1";
europe[77] = "Bratislava, Slovakia, EU;SK;1;seu1";
europe[78] = "Ljubljana, Slovenia, EU;SI;1;seu1";
europe[79] = "Barcelona, Spain, EU;ES;1;seu1";
europe[80] = "Madrid, Spain, EU;ES;1;seu1";
europe[81] = "Sevilla, Spain, EU;ES;1;seu1";
europe[82] = "Valencia, Spain, EU;ES;1;seu1";
europe[83] = "Las Palmas, Canary Islands, Spain, EU;ES;0;seu3";
europe[84] = "Palma, Majorca, Spain, EU;ES;1;seu1";
europe[85] = "Longyearbyen, Svalbard;SJ;1;seu1";
europe[86] = "Stockholm, Sweden, EU;SE;1;seu1";
europe[87] = "Bern, Switzerland;CH;1;seu1";
europe[88] = "Geneva, Switzerland;CH;1;seu1";
europe[89] = "Zurich, Switzerland;CH;1;seu1";
europe[90] = "Kiev, Ukraine;UA;2;seu2";
europe[91] = "London, England, United Kingdom, EU;UK;0;seu3";
europe[92] = "Belfast, Northern Ireland, United Kingdom, EU;UK;0;seu3";
europe[93] = "Edinburgh, Scotland, United Kingdom, EU;UK;0;seu3";
europe[94] = "Cardiff, Wales, United Kingdom, EU;UK;0;seu3";
europe[95] = "Vatican City, Vatican City;VA;1;seu1";

var northamerica = new Array();
northamerica[0] = "Coordinated Universal Time;UTC;0;";
northamerica[1] = "Hamilton, Bermuda;BM;-4;sus";
northamerica[2] = "Edmonton, Alberta, Canada;CA;-7;sus";
northamerica[3] = "Victoria, British Columbia, Canada;CA;-8;sus";
northamerica[4] = "Winnipeg, Manitoba, Canada;CA;-6;sus";
northamerica[5] = "Fredericton, New Brunswick, Canada;CA;-4;sus";
northamerica[6] = "Saint John's, Newfoundland and Labrador, Canada;CA;-3.5;sca";
northamerica[7] = "Yellowknife, Northwest Territories, Canada;CA;-7;sus";
northamerica[8] = "Halifax, Nova Scotia, Canada;CA;-4;sus";
northamerica[9] = "Iqaluit, Nunavut Territory, Canada;CA;-5;sus";
northamerica[10] = "Toronto, Ontario, Canada;CA;-5;sus";
northamerica[11] = "Charlottetown, Prince Edward Island, Canada;CA;-4;sus";
northamerica[12] = "Quebec City, Quebec, Canada;CA;-5;sus";
northamerica[13] = "Regina, Saskatchewan, Canada;CA;-6;";
northamerica[14] = "Whitehorse, Yukon Territory, Canada;CA;-8;sus";
northamerica[15] = "Ittoqqortoormiit (Scoresbysund), Greenland;GL;-1;sgl1";
northamerica[16] = "Nuuk (Godthab), Greenland;GL;-3;sgl2";
northamerica[17] = "Qaanaaq (Thule), Greenland;GL;-4;sus";
northamerica[18] = "Saint-Pierre, Saint-Pierre and Miquelon;PM;-3;sus";
northamerica[19] = "Birmingham, Alabama, United States;US;-6;sus";
northamerica[20] = "Montgomery, Alabama, United States;US;-6;sus";
northamerica[21] = "Anchorage, Alaska, United States;US;-9;sus";
northamerica[22] = "Juneau, Alaska, United States;US;-9;sus";
northamerica[23] = "Phoenix, Arizona, United States;US;-7;";
northamerica[24] = "Little Rock, Arkansas, United States;US;-6;sus";
northamerica[25] = "Los Angeles, California, United States;US;-8;sus";
northamerica[26] = "Sacramento, California, United States;US;-8;sus";
northamerica[27] = "Denver, Colorado, United States;US;-7;sus";
northamerica[28] = "Bridgeport, Connecticut, United States;US;-5;sus";
northamerica[29] = "Hartford, Connecticut, United States;US;-5;sus";
northamerica[30] = "Dover, Delaware, United States;US;-5;sus";
northamerica[31] = "Wilmington, Delaware, United States;US;-5;sus";
northamerica[32] = "Washington D.C., District of Columbia, United States;US;-5;sus";
northamerica[33] = "Jacksonville, Florida, United States;US;-5;sus";
northamerica[34] = "Tallahassee, Florida, United States;US;-5;sus";
northamerica[35] = "Atlanta, Georgia, United States;US;-5;sus";
northamerica[36] = "Honolulu, Hawaii, United States;US;-10;";
northamerica[37] = "Boise, Idaho, United States;US;-7;sus";
northamerica[38] = "Chicago, Illinois, United States;US;-6;sus";
northamerica[39] = "Springfield, Illinois, United States;US;-6;sus";
northamerica[40] = "Indianapolis, Indiana, United States;US;-5;sus";
northamerica[41] = "Des Moines, Iowa, United States;US;-6;sus";
northamerica[42] = "Topeka, Kansas, United States;US;-6;sus";
northamerica[43] = "Wichita, Kansas, United States;US;-6;sus";
northamerica[44] = "Frankfort, Kentucky, United States;US;-5;sus";
northamerica[45] = "Louisville, Kentucky, United States;US;-5;sus";
northamerica[46] = "Baton Rouge, Louisiana, United States;US;-6;sus";
northamerica[47] = "New Orleans, Louisiana, United States;US;-6;sus";
northamerica[48] = "Augusta, Maine, United States;US;-5;sus";
northamerica[49] = "Portland, Maine, United States;US;-5;sus";
northamerica[50] = "Annapolis, Maryland, United States;US;-5;sus";
northamerica[51] = "Baltimore, Maryland, United States;US;-5;sus";
northamerica[52] = "Boston, Massachusetts, United States;US;-5;sus";
northamerica[53] = "Detroit, Michigan, United States;US;-5;sus";
northamerica[54] = "Lansing, Michigan, United States;US;-5;sus";
northamerica[55] = "Minneapolis, Minnesota, United States;US;-6;sus";
northamerica[56] = "Saint Paul, Minnesota, United States;US;-6;sus";
northamerica[57] = "Jackson, Mississippi, United States;US;-6;sus";
northamerica[58] = "Jefferson City, Missouri, United States;US;-6;sus";
northamerica[59] = "Kansas City, Missouri, United States;US;-6;sus";
northamerica[60] = "Billings, Montana, United States;US;-7;sus";
northamerica[61] = "Helena, Montana, United States;US;-7;sus";
northamerica[62] = "Lincoln, Nebraska, United States;US;-6;sus";
northamerica[63] = "Omaha, Nebraska, United States;US;-6;sus";
northamerica[64] = "Carson City, Nevada, United States;US;-8;sus";
northamerica[65] = "Las Vegas, Nevada, United States;US;-8;sus";
northamerica[66] = "Concord, New Hampshire, United States;US;-5;sus";
northamerica[67] = "Manchester, New Hampshire, United States;US;-5;sus";
northamerica[68] = "Newark, New Jersey, United States;US;-5;sus";
northamerica[69] = "Trenton, New Jersey, United States;US;-5;sus";
northamerica[70] = "Albuquerque, New Mexico, United States;US;-7;sus";
northamerica[71] = "Santa Fe, New Mexico, United States;US;-7;sus";
northamerica[72] = "Albany, New York, United States;US;-5;sus";
northamerica[73] = "New York City, New York, United States;US;-5;sus";
northamerica[74] = "Charlotte, North Carolina, United States;US;-5;sus";
northamerica[75] = "Raleigh, North Carolina, United States;US;-5;sus";
northamerica[76] = "Bismarck, North Dakota, United States;US;-6;sus";
northamerica[77] = "Fargo, North Dakota, United States;US;-6;sus";
northamerica[78] = "Columbus, Ohio, United States;US;-5;sus";
northamerica[79] = "Oklahoma City, Oklahoma, United States;US;-6;sus";
northamerica[80] = "Portland, Oregon, United States;US;-8;sus";
northamerica[81] = "Salem, Oregon, United States;US;-8;sus";
northamerica[82] = "Harrisburg, Pennsylvania, United States;US;-5;sus";
northamerica[83] = "Philadelphia, Pennsylvania, United States;US;-5;sus";
northamerica[84] = "Providence, Rhode Island, United States;US;-5;sus";
northamerica[85] = "Columbia, South Carolina, United States;US;-5;sus";
northamerica[86] = "Pierre, South Dakota, United States;US;-6;sus";
northamerica[87] = "Sioux Falls, South Dakota, United States;US;-6;sus";
northamerica[88] = "Memphis, Tennessee, United States;US;-6;sus";
northamerica[89] = "Nashville, Tennessee, United States;US;-6;sus";
northamerica[90] = "Austin, Texas, United States;US;-6;sus";
northamerica[91] = "Houston, Texas, United States;US;-6;sus";
northamerica[92] = "Salt Lake City, Utah, United States;US;-7;sus";
northamerica[93] = "Burlington, Vermont, United States;US;-5;sus";
northamerica[94] = "Montpelier, Vermont, United States;US;-5;sus";
northamerica[95] = "Richmond, Virginia, United States;US;-5;sus";
northamerica[96] = "Virginia Beach, Virginia, United States;US;-5;sus";
northamerica[97] = "Olympia, Washington, United States;US;-8;sus";
northamerica[98] = "Seattle, Washington, United States;US;-8;sus";
northamerica[99] = "Charleston, West Virginia, United States;US;-5;sus";
northamerica[100] = "Madison, Wisconsin, United States;US;-6;sus";
northamerica[101] = "Milwaukee, Wisconsin, United States;US;-6;sus";
northamerica[102] = "Cheyenne, Wyoming, United States;US;-7;sus";

var oceania = new Array();
oceania[0] = "Coordinated Universal Time;UTC;0;";
oceania[1] = "Pago Pago, American Samoa;AS;-11;";
oceania[2] = "Adelaide, Australia;AU;9.5;sau";
oceania[3] = "Brisbane, Australia;AU;10;";
oceania[4] = "Canberra, Australia;AU;10;sau";
oceania[5] = "Melbourne, Australia;AU;10;sau";
oceania[6] = "Perth, Australia;AU;8;";
oceania[7] = "Sydney, Australia;AU;10;sau";
oceania[8] = "The Settlement, Christmas Island;CX;7;";
oceania[9] = "West Island, Cocos (Keeling) Islands;CC;6.5;";
oceania[10] = "Avarua, Cook Islands;CK;-10;";
oceania[11] = "Suva, Fiji;FJ;12;";
oceania[12] = "Papeete, Tahiti, French Polynesia;PF;-10;";
oceania[13] = "Tarawa, Gilbert Islands, Kiribati;KI;12;";
oceania[14] = "Kiritimati, Line Islands, Kiribati;KI;14;";
oceania[15] = "Rawaki, Phoenix Islands, Kiribati;KI;13;";
oceania[16] = "Guam, Mariana Islands;GU;10;";
oceania[17] = "Majuro, Marshall Islands;MH;12;";
oceania[18] = "Palikir, Pohnpei, Micronesia;FM;11;";
oceania[19] = "Colonia, Yap, Micronesia;FM;10;";
oceania[20] = "Yaren, Nauru;NR;12;";
oceania[21] = "Noumea, New Caledonia;NC;11;";
oceania[22] = "Auckland, New Zealand;NZ;12;snz";
oceania[23] = "Wellington, New Zealand;NZ;12;snz";
oceania[24] = "Alofi, Niue;NU;-11;";
oceania[25] = "Kingston, Norfolk Island;NF;11.5;";
oceania[26] = "Saipan, Northern Mariana Islands;MP;10;";
oceania[27] = "Koror, Palau;PW;9;";
oceania[28] = "Port Moresby, Papua New Guinea;PG;10;";
oceania[29] = "Adamstown, Pitcairn Islands;PN;-8;";
oceania[30] = "Apia, Samoa;WS;-11;";
oceania[31] = "Honiara, Solomon Islands;SB;11;";
oceania[32] = "Fakaofo, Tokelau;TK;-10;";
oceania[33] = "Nuku'alofa, Tonga;TO;13;";
oceania[34] = "Funafuti, Tuvalu;TV;12;";
oceania[35] = "Port Vila, Vanuatu;VU;11;";
oceania[36] = "Mata-Utu, Wallis and Futuna;WF;12;";

var southamerica = new Array();
southamerica[0] = "Coordinated Universal Time;UTC;0;";
southamerica[1] = "Buenos Aires, Argentina;AR;-3;";
southamerica[2] = "Cordoba, Argentina;AR;-3;";
southamerica[3] = "Mendoza, Argentina;AR;-3;";
southamerica[4] = "Rosario, Argentina;AR;-3;";
southamerica[5] = "Santa Fe, Argentina;AR;-3;";
southamerica[6] = "La Paz, Bolivia;BO;-4;";
southamerica[7] = "Santa Cruz, Bolivia;BO;-4;";
southamerica[8] = "Belo Horizonte, Brazil;BR;-3;sbr";
southamerica[9] = "Brasilia, Brazil;BR;-3;sbr";
southamerica[10] = "Cuiaba, Brazil;BR;-4;sbr";
southamerica[11] = "Fernando de Noronha, Brazil;BR;-2;";
southamerica[12] = "Fortaleza, Brazil;BR;-3;";
southamerica[13] = "Manaus, Brazil;BR;-4;";
southamerica[14] = "Rio Branco, Brazil;BR;-5;";
southamerica[15] = "Rio de Janeiro, Brazil;BR;-3;sbr";
southamerica[16] = "Salvador, Brazil;BR;-3;";
southamerica[17] = "Sao Paulo, Brazil;BR;-3;sbr";
southamerica[18] = "Santiago, Chile;CL;-4;scl";
southamerica[19] = "Bogota, Colombia;CO;-5;";
southamerica[20] = "Guayaquil, Ecuador;EC;-5;";
southamerica[21] = "Quito, Ecuador;EC;-5;";
southamerica[22] = "Galapagos Islands, Ecuador;EC;-6;";
southamerica[23] = "Stanley, Falkland Islands;FK;-4;sfk";
southamerica[24] = "Cayenne, French Guiana;GF;-3;";
southamerica[25] = "Georgetown, Guyana;GY;-4;";
southamerica[26] = "Asuncion, Paraguay;PY;-4;spy";
southamerica[27] = "Lima, Peru;PE;-5;";
southamerica[28] = "Grytviken, South Georgia and the South Sandwich Islands;GS;-2;";
southamerica[29] = "Paramaribo, Suriname;SR;-3;";
southamerica[30] = "Montevideo, Uruguay;UY;-3;suy";
southamerica[31] = "Caracas, Venezuela;VE;-4;";

var cityValue = "africa-0";

function onChangeCity(value)
{
  cityValue = value;

  updateTimeDate();
}

function updateTimeDate()
{
  fields = cityValue.split("-");
  continent = fields[0];
  city = fields[1];

  if ((continent == "africa") && ((city > 0) && (city <= 63)))
  {
    record = africa[city];
  }
  else
  if ((continent == "asia") && ((city > 0) && (city <= 68)))
  {
    record = asia[city];
  }
  else
  if ((continent == "caribbean") && ((city > 0) && (city <= 24)))
  {
    record = caribbean[city];
  }
  else
  if ((continent == "centralamerica") && ((city > 0) && (city <= 10)))
  {
    record = centralamerica[city];
  }
  else
  if ((continent == "europe") && ((city > 0) && (city <= 95)))
  {
    record = europe[city];
  }
  else
  if ((continent == "northamerica") && ((city > 0) && (city <= 102)))
  {
    record = northamerica[city];
  }
  else
  if ((continent == "oceania") && ((city > 0) && (city <= 36)))
  {
    record = oceania[city];
  }
  else
  if ((continent == "southamerica") && ((city > 0) && (city <= 31)))
  {
    record = southamerica[city];
  }
  else
  {
    record = "Coordinated Universal Time;UTC;0;";
  }

  fields = record.split(";");
  offset = fields[2];

  localDate = new Date();

  localMillis = localDate.getTime();
  localOffsetMillis = localDate.getTimezoneOffset() * 60000;
  utcMillis = localMillis + localOffsetMillis;
  cityMillis = utcMillis + (offset * 3600000);

  cityDate = new Date(cityMillis);

  if (fields[3] != "")
  {
    if (summerTime(fields[3], cityDate))
    {
      offset++;
      cityMillis = utcMillis + (offset * 3600000);

      cityDate = new Date(cityMillis);
    }
  }

  h = cityDate.getHours();
  m = cityDate.getMinutes();
  s = cityDate.getSeconds();

  timeString = formatTime(h, m, s, document.worldclock.hourformat[0].checked);
  document.worldclock.time.value = timeString;

  year = cityDate.getFullYear();
  month = months[cityDate.getMonth()];
  day = cityDate.getDate();
  weekday = weekdays[cityDate.getDay()];

  document.worldclock.date.value = weekday + ", " + month + " " + day + ", " + year;

  setTimeout("updateTimeDate()", 1000);
}

function summerTime(dst, cityDate)
{
  result = false;

  if (dst == "seg")
  {
    result = summerTimeEgypt(dst, cityDate);
  }
  else
  if (dst == "sna")
  {
    result = summerTimeNamibia(dst, cityDate);
  }
  else
  if (dst == "stn")
  {
    result = summerTimeEurope("seu1", cityDate);
  }
  else
  if (dst == "sam")
  {
    result = summerTimeEurope("seu1", cityDate);
  }
  else
  if (dst == "saz")
  {
    result = summerTimeAzerbaijan(dst, cityDate);
  }
  else
  if (dst == "siq")
  {
    result = summerTimeIraq(dst, cityDate);
  }
  else
  if (dst == "sil")
  {
    result = summerTimeIsrael(dst, cityDate);
  }
  else
  if (dst == "sjo")
  {
    result = summerTimeJordan(dst, cityDate);
  }
  else
  if (dst == "slb")
  {
    result = summerTimeLebanon(dst, cityDate);
  }
  else
  if (dst == "smn")
  {
    result = summerTimeMongolia(dst, cityDate);
  }
  else
  if (dst == "ssy")
  {
    result = summerTimeSyria(dst, cityDate);
  }
  else
  if (dst == "str")
  {
    result = summerTimeEurope("seu2", cityDate);
  }
  else
  if ((dst == "sbs") || (dst == "sht") || (dst == "stc"))
  {
    result = summerTimeCaribbean(dst, cityDate);
  }
  else
  if (dst == "scu")
  {
    result = summerTimeCuba(dst, cityDate);
  }
  else
  if (dst == "sgt")
  {
    result = summerTimeGuatemala(dst, cityDate);
  }
  else
  if (dst == "shn")
  {
    result = summerTimeHonduras(dst, cityDate);
  }
  else
  if (dst == "smx")
  {
    result = summerTimeMexico(dst, cityDate);
  }
  else
  if (dst == "sni")
  {
    result = summerTimeNicaragua(dst, cityDate);
  }
  else
  if (dst.match("seu"))
  {
    result = summerTimeEurope(dst, cityDate);
  }
  else
  if (dst == "sca")
  {
    result = summerTimeCanada(dst, cityDate);
  }
  else
  if (dst.match("sgl"))
  {
    result = summerTimeGreenland(dst, cityDate);
  }
  else
  if (dst == "sus")
  {
    result = summerTimeUnitedStates(dst, cityDate);
  }
  else
  if (dst.match("sau"))
  {
    result = summerTimeAustralia(dst, cityDate);
  }
  else
  if (dst.match("snz"))
  {
    result = summerTimeNewZealand(dst, cityDate);
  }
  else
  if (dst.match("sbr"))
  {
    result = summerTimeBrazil(dst, cityDate);
  }
  else
  if (dst.match("scl"))
  {
    result = summerTimeChile(dst, cityDate);
  }
  else
  if (dst.match("sfk"))
  {
    result = summerTimeFalklandIslands(dst, cityDate);
  }
  else
  if (dst.match("spy"))
  {
    result = summerTimeParaguay(dst, cityDate);
  }
  else
  if (dst.match("suy"))
  {
    result = summerTimeUruguay(dst, cityDate);
  }

  return (result);
}

function summerTimeEgypt(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 3, 30);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 8, 30);

  date1.setHours(0, 0, 0, 0);
  date2.setHours(23, 0, 0, 0);

  while (date1.getDay() != 5)
  {
    date1.setDate(date1.getDate() - 1);
  }

  while (date2.getDay() != 5)
  {
    date2.setDate(date2.getDate() - 1);
  }

  date2.setDate(date2.getDate() - 1);

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeNamibia(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 3, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 8, 1);

  date1.setHours(1, 0, 0, 0);
  date2.setHours(2, 0, 0, 0);

  while (date1.getDay() != 0)
  {
    date1.setDate(date1.getDate() + 1);
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() + 1);
  }

  return ((cityDate < date1) || (cityDate >= date2));
}

function summerTimeAzerbaijan(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 31);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 31);

  date1.setHours(4, 0, 0, 0);
  date2.setHours(4, 0, 0, 0);

  while (date1.getDay() != 0)
  {
    date1.setDate(date1.getDate() - 1);
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() - 1);
  }

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeIraq(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 3, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 1);

  date1.setHours(3, 0, 0, 0);
  date2.setHours(3, 0, 0, 0);

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeIsrael(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 30);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 8, 16);

  date1.setHours(2, 0, 0, 0);
  date2.setHours(1, 0, 0, 0);

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeJordan(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 31);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 8, 30);

  date1.setHours(0, 0, 0, 0);
  date2.setHours(0, 0, 0, 0);

  while (date1.getDay() != 4)
  {
    date1.setDate(date1.getDate() - 1);
  }

  while (date2.getDay() != 5)
  {
    date2.setDate(date2.getDate() - 1);
  }

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeLebanon(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 31);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 31);

  date1.setHours(0, 0, 0, 0);
  date2.setHours(23, 0, 0, 0);

  while (date1.getDay() != 0)
  {
    date1.setDate(date1.getDate() - 1);
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() - 1);
  }

  date2.setDate(date2.getDate() - 1);

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeMongolia(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 31);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 8, 30);

  date1.setHours(2, 0, 0, 0);
  date2.setHours(1, 0, 0, 0);

  while (date1.getDay() != 6)
  {
    date1.setDate(date1.getDate() - 1);
  }

  while (date2.getDay() != 6)
  {
    date2.setDate(date2.getDate() - 1);
  }

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeSyria(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 3, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 8, 30);

  date1.setHours(0, 0, 0, 0);
  date2.setHours(23, 0, 0, 0);

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeEurope(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 31);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 31);

  if (dst == "seu1")
  {
    date1.setHours(2, 0, 0, 0);
    date2.setHours(2, 0, 0, 0);
  }
  else
  if (dst == "seu2")
  {
    date1.setHours(3, 0, 0, 0);
    date2.setHours(3, 0, 0, 0);
  }
  else
  if (dst == "seu3")
  {
    date1.setHours(1, 0, 0, 0);
    date2.setHours(1, 0, 0, 0);
  }
  else
  if (dst == "seu4")
  {
    date1.setHours(0, 0, 0, 0);
    date2.setHours(0, 0, 0, 0);
  }

  while (date1.getDay() != 0)
  {
    date1.setDate(date1.getDate() - 1);
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() - 1);
  }

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeCaribbean(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 3, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 31);

  if (dst == "sbs")
  {
    date1.setHours(2, 0, 0, 0);
    date2.setHours(1, 0, 0, 0);
  }
  else
  if ((dst == "sht") || (dst == "stc"))
  {
    date1.setHours(0, 0, 0, 0);
    date2.setHours(23, 0, 0, 0);
  }

  while (date1.getDay() != 0)
  {
    date1.setDate(date1.getDate() + 1);
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() - 1);
  }

  if ((dst == "sht") || (dst == "stc"))
  {
    date2.setDate(date2.getDate() - 1);
  }

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeCuba(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 31);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 31);

  date1.setHours(0, 0, 0, 0);
  date2.setHours(0, 0, 0, 0);

  while (date1.getDay() != 0)
  {
    date1.setDate(date1.getDate() - 1);
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() - 1);
  }

  return ((cityDate.getFullYear() == 2006) || ((cityDate >= date1) && (cityDate < date2)));
}

function summerTimeGuatemala(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 3, 30);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 8, 30);

  date1.setHours(0, 0, 0, 0);
  date2.setHours(23, 0, 0, 0);

  return ((cityDate.getFullYear() == 2006) && ((cityDate >= date1) && (cityDate < date2)));
}

function summerTimeHonduras(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 4, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 7, 1);

  date1.setHours(0, 0, 0, 0);
  date2.setHours(23, 0, 0, 0);

  while (date1.getDay() != 0)
  {
    date1.setDate(date1.getDate() + 1);
  }

  while (date2.getDay() != 1)
  {
    date2.setDate(date2.getDate() + 1);
  }

  date2.setDate(date2.getDate() - 1);

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeMexico(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 3, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 31);

  date1.setHours(2, 0, 0, 0);
  date2.setHours(1, 0, 0, 0);

  while (date1.getDay() != 0)
  {
    date1.setDate(date1.getDate() + 1);
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() - 1);
  }

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeNicaragua(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 3, 30);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 1);

  date1.setHours(2, 0, 0, 0);
  date2.setHours(1, 0, 0, 0);

  return ((cityDate.getFullYear() == 2006) && ((cityDate >= date1) && (cityDate < date2)));
}

function summerTimeCanada(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 10, 1);

  date1.setHours(0, 1, 0, 0);
  date2.setHours(23, 1, 0, 0);

  i = 0;
  while (i < 2)
  {
    if (date1.getDay() == 0)
    {
      i++;
    }

    if (i < 2)
    {
      date1.setDate(date1.getDate() + 1);
    }
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() + 1);
  }

  date2.setDate(date2.getDate() - 1);

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeGreenland(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 31);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 31);

  if (dst == "sgl1")
  {
    weekday = 0;
    date1.setHours(0, 0, 0, 0);
    date2.setHours(0, 0, 0, 0);
  }
  else
  if (dst == "sgl2")
  {
    weekday = 6;
    date1.setHours(10, 0, 0, 0);
    date2.setHours(10, 0, 0, 0);
  }

  while (date1.getDay() != weekday)
  {
    date1.setDate(date1.getDate() - 1);
  }

  while (date2.getDay() != weekday)
  {
    date2.setDate(date2.getDate() - 1);
  }

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeUnitedStates(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 10, 1);

  date1.setHours(2, 0, 0, 0);
  date2.setHours(1, 0, 0, 0);

  i = 0;
  while (i < 2)
  {
    if (date1.getDay() == 0)
    {
      i++;
    }

    if (i < 2)
    {
      date1.setDate(date1.getDate() + 1);
    }
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() + 1);
  }

  return ((cityDate >= date1) && (cityDate < date2));
}

function summerTimeAustralia(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 31);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 31);

  date1.setHours(2, 0, 0, 0);
  date2.setHours(2, 0, 0, 0);

  while (date1.getDay() != 0)
  {
    date1.setDate(date1.getDate() - 1);
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() - 1);
  }

  return ((cityDate < date1) || (cityDate >= date2));
}

function summerTimeNewZealand(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 1);

  date1.setHours(2, 0, 0, 0);
  date2.setHours(2, 0, 0, 0);

  i = 0;
  while (i < 3)
  {
    if (date1.getDay() == 0)
    {
      i++;
    }

    if (i < 3)
    {
      date1.setDate(date1.getDate() + 1);
    }
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() + 1);
  }

  return ((cityDate < date1) || (cityDate >= date2));
}

function summerTimeBrazil(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 1, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 1);

  date1.setHours(23, 0, 0, 0);
  date2.setHours(0, 0, 0, 0);

  i = 0;
  while (i < 3)
  {
    if (date1.getDay() == 0)
    {
      i++;
    }

    if (i < 3)
    {
      date1.setDate(date1.getDate() + 1);
    }
  }

  date1.setDate(date1.getDate() - 1);

  i = 0;
  while (i < 3)
  {
    if (date2.getDay() == 0)
    {
      i++;
    }

    if (i < 3)
    {
      date2.setDate(date2.getDate() + 1);
    }
  }

  return ((cityDate < date1) || (cityDate >= date2));
}

function summerTimeChile(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 10);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 14);

  date1.setHours(23, 0, 0, 0);
  date2.setHours(0, 0, 0, 0);

  return ((cityDate < date1) || (cityDate >= date2));
}

function summerTimeFalklandIslands(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 3, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 8, 1);

  date1.setHours(1, 0, 0, 0);
  date2.setHours(2, 0, 0, 0);

  i = 0;
  while (i < 3)
  {
    if (date1.getDay() == 0)
    {
      i++;
    }

    if (i < 3)
    {
      date1.setDate(date1.getDate() + 1);
    }
  }

  while (date2.getDay() != 0)
  {
    date2.setDate(date2.getDate() + 1);
  }

  return ((cityDate < date1) || (cityDate >= date2));
}

function summerTimeParaguay(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 1);

  date1.setHours(23, 0, 0, 0);
  date2.setHours(0, 0, 0, 0);

  i = 0;
  while (i < 2)
  {
    if (date1.getDay() == 0)
    {
      i++;
    }

    if (i < 2)
    {
      date1.setDate(date1.getDate() + 1);
    }
  }

  date1.setDate(date1.getDate() - 1);

  i = 0;
  while (i < 3)
  {
    if (date2.getDay() == 0)
    {
      i++;
    }

    if (i < 3)
    {
      date2.setDate(date2.getDate() + 1);
    }
  }

  return ((cityDate < date1) || (cityDate >= date2));
}

function summerTimeUruguay(dst, cityDate)
{
  date1 = new Date();
  date1.setFullYear(cityDate.getFullYear(), 2, 1);

  date2 = new Date();
  date2.setFullYear(cityDate.getFullYear(), 9, 1);

  date1.setHours(1, 0, 0, 0);
  date2.setHours(2, 0, 0, 0);

  i = 0;
  while (i < 2)
  {
    if (date1.getDay() == 0)
    {
      i++;
    }

    if (i < 2)
    {
      date1.setDate(date1.getDate() + 1);
    }
  }

  i = 0;
  while (i < 2)
  {
    if (date2.getDay() == 0)
    {
      i++;
    }

    if (i < 2)
    {
      date2.setDate(date2.getDate() + 1);
    }
  }

  return ((cityDate < date1) || (cityDate >= date2));
}

function formatTime(h, m, s, format12hours)
{
  hourFormat = "";

  if (format12hours)
  {
    if (h >= 12)
    {
      hourFormat = " PM";

      if (h > 12)
      {
        h -= 12;
      }
    }
    else
    {
      if (h == 0)
      {
        h = "12";
      }

      hourFormat = " AM";
    }
  }

  if (m < 10)
  {
    m = "0" + m;
  }

  if (s < 10)
  {
    s = "0" + s;
  }

  if (h < 10)
  {
    h = "0" + h;
  }

  return (h + ":" + m + ":" + s + hourFormat);
}
