
//Array used in storing the shorter Timezone names 
var tzVsShortForm = new Array();
tzVsShortForm['Pacific/Tongatapu']  = 'TOT';
tzVsShortForm['Pacific/Fiji']  = 'FJT';
tzVsShortForm['Pacific/Auckland']  = 'NZDT';
tzVsShortForm['Asia/Magadan']  = 'MAGT';
tzVsShortForm['Asia/Vladivostok']  = 'VLAT';
tzVsShortForm['Australia/Hobart']  = 'EST';
tzVsShortForm['Pacific/Guam']  = 'ChST';
tzVsShortForm['Australia/Sydney']  = 'EST';
tzVsShortForm['Australia/Brisbane']  = 'EST';
tzVsShortForm['Australia/Adelaide']  = 'CST';
tzVsShortForm['Australia/Darwin']  = 'CST';
tzVsShortForm['Asia/Yakutsk']  = 'YAKT';
tzVsShortForm['Asia/Seoul']  = 'KST';
tzVsShortForm['Asia/Tokyo']  = 'JST';
tzVsShortForm['Asia/Taipei']  = 'CST';
tzVsShortForm['Australia/Perth']  = 'WST';
tzVsShortForm['Asia/Kuala_Lumpur']  = 'MYT';
tzVsShortForm['Asia/Irkutsk']  = 'IRKT';
tzVsShortForm['Asia/Hong_Kong']  = 'HKT';
tzVsShortForm['Asia/Krasnoyarsk']  = 'KRAT';
tzVsShortForm['Asia/Bangkok']  = 'ICT';
tzVsShortForm['Asia/Rangoon']  = 'MMT';
tzVsShortForm['Asia/Colombo']  = 'IST';
tzVsShortForm['Asia/Dhaka']  = 'BDT';
tzVsShortForm['Asia/Almaty']  = 'ALMT';
tzVsShortForm['Asia/Katmandu']  = 'NPT';
tzVsShortForm['Asia/Calcutta']  = 'IST';
tzVsShortForm['Asia/Karachi']  = 'PKT';
tzVsShortForm['Asia/Yekaterinburg']  = 'YEKT';
tzVsShortForm['Asia/Kabul']  = 'AFT';
tzVsShortForm['Asia/Baku']  = 'AZT';
tzVsShortForm['Asia/Dubai']  = 'GST';
tzVsShortForm['Asia/Tehran']  = 'IRST';
tzVsShortForm['Africa/Nairobi']  = 'EAT';
tzVsShortForm['Europe/Moscow']  = 'MSK';
tzVsShortForm['Asia/Kuwait']  = 'AST';
tzVsShortForm['Asia/Baghdad']  = 'AST';
tzVsShortForm['Asia/Jerusalem']  = 'IST';
tzVsShortForm['Europe/Helsinki']  = 'EET';
tzVsShortForm['Africa/Harare']  = 'CAT';
tzVsShortForm['Africa/Cairo']  = 'EET';
tzVsShortForm['Europe/Bucharest']  = 'EET';
tzVsShortForm['Europe/Athens']  = 'EET';
tzVsShortForm['Africa/Lagos']  = 'WAT';
tzVsShortForm['Europe/Warsaw']  = 'CET';
tzVsShortForm['Europe/Brussels']  = 'CET';
tzVsShortForm['Europe/Belgrade']  = 'CET';
tzVsShortForm['Europe/Amsterdam']  = 'CET';
tzVsShortForm['Africa/Casablanca']  = 'WET';
tzVsShortForm['GMT']  = 'GMT';
tzVsShortForm['Atlantic/Azores']  = 'AZOT';
tzVsShortForm['Atlantic/Cape_Verde']  = 'CVT';
tzVsShortForm['Atlantic/South_Georgia']  = 'GST';
tzVsShortForm['America/Sao_Paulo']  = 'BRST';
tzVsShortForm['America/Buenos_Aires']  = 'ART';
tzVsShortForm['America/Thule']  = 'AST';
tzVsShortForm['America/St_Johns']  = 'NST';
tzVsShortForm['America/Montreal']  = 'EST';
tzVsShortForm['America/Caracas']  = 'VET';
tzVsShortForm['America/Santiago']  = 'CLST';
tzVsShortForm['America/Bogota']  = 'COT';
tzVsShortForm['America/New_York']  = 'EST';
tzVsShortForm['America/Indianapolis']  = 'EST';
tzVsShortForm['America/Costa_Rica']  = 'CST';
tzVsShortForm['America/Chicago']  = 'CST';
tzVsShortForm['America/Mexico_City']  = 'CST';
tzVsShortForm['America/Winnipeg']  = 'CST';
tzVsShortForm['America/Phoenix']  = 'MST';
tzVsShortForm['America/Tegucigalpa']  = 'CST';
tzVsShortForm['America/Denver']  = 'MST';
tzVsShortForm['America/Los_Angeles']  = 'PST';
tzVsShortForm['America/Anchorage']  = 'AKST';
tzVsShortForm['Pacific/Honolulu']  = 'HST';
tzVsShortForm['Pacific/Apia']  = 'WST';
tzVsShortForm['MIT']  = 'WST';




//Timezone to be selected by default and the divId in which the 
//timezone component to be placed.
function getTZComp(divId)
{
    var divEle = document.getElementById(divId);
    divEle.innerHTML="<select id=\"timeZoneCombo\" name=\"timeZone\" class=\"timezoneselect\">"
        +"<option value=\"Pacific/Tongatapu\">(GMT+13:00) Nukualofa, Pacific/Tongatapu</option>"
        +"<option value=\"Pacific/Fiji\">(GMT+12:00) Fiji, Kamchatka, Marshall Is., Pacific/Fiji</option>"
        +"<option value=\"Pacific/Auckland\">(GMT+12:00) Auckland, Wellington, Pacific/Auckland</option>"
        +"<option value=\"Asia/Magadan\">(GMT+11:00) Magadan, Solomon Is., New Caledonia, Asia/Magadan</option>"
        +"<option value=\"Asia/Vladivostok\">(GMT+10:00) Vladivostok, Asia/Vladivostok</option>"
        +"<option value=\"Australia/Hobart\">(GMT+10:00) Hobart, Australia/Hobart</option>"
        +"<option value=\"Pacific/Guam\">(GMT+10:00) Guam, Port Moresby, Pacific/Guam</option>"
        +"<option value=\"Australia/Sydney\">(GMT+10:00) Canberra, Melbourne, Sydney, Australia/Sydney</option>"
        +"<option value=\"Australia/Brisbane\">(GMT+10:00) Brisbane, Australia/Brisbane</option>"
        +"<option value=\"Australia/Adelaide\">(GMT+09:30) Adelaide, Australia/Adelaide</option>"
        +"<option value=\"Australia/Darwin\">(GMT+09:30) Darwin, Australia/Darwin</option>"
        +"<option value=\"Asia/Yakutsk\">(GMT+09:00) Yakutsk, Asia/Yakutsk</option>"
        +"<option value=\"Asia/Seoul\">(GMT+09:00) Seoul, Asia/Seoul</option>"
        +"<option value=\"Asia/Tokyo\">(GMT+09:00) Osaka, Sapporo, Tokyo, Asia/Tokyo</option>"
        +"<option value=\"Asia/Taipei\">(GMT+08:00) Taipei, Asia/Taipei</option>"
        +"<option value=\"Australia/Perth\">(GMT+08:00) Perth, Australia/Perth</option>"
        +"<option value=\"Asia/Kuala_Lumpur\">(GMT+08:00) Kuala Lumpur, Singapore, Asia/Kuala_Lumpur</option>"
        +"<option value=\"Asia/Irkutsk\">(GMT+08:00) Irkutsk, Ulaan Bataar, Asia/Irkutsk</option>"
        +"<option value=\"Asia/Hong_Kong\">(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi, Asia/Hong_Kong</option>"
        +"<option value=\"Asia/Krasnoyarsk\">(GMT+07:00) Krasnoyarsk, Asia/Krasnoyarsk</option>"
        +"<option value=\"Asia/Bangkok\">(GMT+07:00) Bangkok, Hanoi, Jakarta, Asia/Bangkok</option>"
        +"<option value=\"Asia/Rangoon\">(GMT+06:30) Rangoon, Asia/Rangoon</option>"
        +"<option value=\"Asia/Colombo\">(GMT+06:00) Sri Jayawardenepura, Asia/Colombo</option>"
        +"<option value=\"Asia/Dhaka\">(GMT+06:00) Astana, Dhaka, Asia/Dhaka</option>"
        +"<option value=\"Asia/Almaty\">(GMT+06:00) Almaty, Novosibirsk, Asia/Almaty</option>"
        +"<option value=\"Asia/Katmandu\">(GMT+05:45) Kathmandu, Asia/Katmandu</option>"
        +"<option value=\"Asia/Calcutta\">(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi, Asia/Calcutta</option>"
        +"<option value=\"Asia/Karachi\">(GMT+05:00) Islamabad, Karachi, Tashkent, Asia/Karachi</option>"
        +"<option value=\"Asia/Yekaterinburg\">(GMT+05:00) Ekaterinburg, Asia/Yekaterinburg</option>"
        +"<option value=\"Asia/Kabul\">(GMT+04:30) Kabul, Asia/Kabul</option>"
        +"<option value=\"Asia/Baku\">(GMT+04:00) Baku, Tbilisi, Yerevan, Asia/Baku</option>"
        +"<option value=\"Asia/Dubai\">(GMT+04:00) Abu Dhabi, Muscat, Asia/Dubai</option>"
        +"<option value=\"Asia/Tehran\">(GMT+03:30) Tehran, Asia/Tehran</option>"
        +"<option value=\"Africa/Nairobi\">(GMT+03:00) Nairobi, Africa/Nairobi</option>"
        +"<option value=\"Europe/Moscow\">(GMT+03:00) Moscow, St. Petersburg, Volgograd, Europe/Moscow</option>"
        +"<option value=\"Asia/Kuwait\">(GMT+03:00) Kuwait, Riyadh, Asia/Kuwait</option>"
        +"<option value=\"Asia/Baghdad\">(GMT+03:00) Baghdad, Asia/Baghdad</option>"
        +"<option value=\"Asia/Jerusalem\">(GMT+02:00) Jerusalem, Asia/Jerusalem</option>"
        +"<option value=\"Europe/Helsinki\">(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius, Europe/Helsinki</option>"
        +"<option value=\"Africa/Harare\">(GMT+02:00) Harare, Pretoria, Africa/Harare</option>"
        +"<option value=\"Africa/Cairo\">(GMT+02:00) Cairo, Africa/Cairo</option>"
        +"<option value=\"Europe/Bucharest\">(GMT+02:00) Bucharest, Europe/Bucharest</option>"
        +"<option value=\"Europe/Athens\">(GMT+02:00) Athens, Istanbul, Minsk, Europe/Athens</option>"
        +"<option value=\"Africa/Lagos\">(GMT+01:00) West Central Africa, Africa/Lagos</option>"
        +"<option value=\"Europe/Warsaw\">(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb, Europe/Warsaw</option>"
        +"<option value=\"Europe/Brussels\">(GMT+01:00) Brussels, Copenhagen, Madrid, Paris, Europe/Brussels</option>"
        +"<option value=\"Europe/Belgrade\">(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague, Europe/Belgrade</option>"
        +"<option value=\"Europe/Amsterdam\">(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna, Europe/Amsterdam</option>"
        +"<option value=\"Africa/Casablanca\">(GMT) Casablanca, Monrovia, Africa/Casablanca</option>"
        +"<option value=\"GMT\">(GMT) Greenwich Mean Time</option>"
        +"<option value=\"Atlantic/Azores\">(GMT-01:00) Azores, Atlantic/Azores</option>"
        +"<option value=\"Atlantic/Cape_Verde\">(GMT-01:00) Cape Verde Is., Atlantic/Cape_Verde</option>"
        +"<option value=\"Atlantic/South_Georgia\">(GMT-02:00) Mid-Atlantic, Atlantic/South_Georgia</option>"
        +"<option value=\"America/Sao_Paulo\">(GMT-03:00) Brasilia, America/Sao_Paulo</option>"
        +"<option value=\"America/Buenos_Aires\">(GMT-03:00) Buenos Aires, Georgetown, America/Buenos_Aires</option>"
        +"<option value=\"America/Thule\">(GMT-03:00) Greenland, America/Thule</option>"
        +"<option value=\"America/St_Johns\">(GMT-03:30) Newfoundland, America/St_Johns</option>"
        +"<option value=\"America/Montreal\">(GMT-04:00) Atlantic Time (Canada), America/Montreal</option>"
        +"<option value=\"America/Caracas\">(GMT-04:00) Caracas, La Paz, America/Caracas</option>"
        +"<option value=\"America/Santiago\">(GMT-04:00) Santiago, America/Santiago</option>"
        +"<option value=\"America/Bogota\">(GMT-05:00) Bogota, Lima, Quito, America/Bogota</option>"
        +"<option value=\"America/New_York\">(GMT-05:00) Eastern Time (US & Canada), America/New_York</option>"
        +"<option value=\"America/Indianapolis\">(GMT-05:00) Indiana (East), America/Indianapolis</option>"
        +"<option value=\"America/Costa_Rica\">(GMT-06:00) Central America, America/Costa_Rica</option>"
        +"<option value=\"America/Chicago\">(GMT-06:00) Central Time (US & Canada), America/Chicago</option>"
        +"<option value=\"America/Mexico_City\">(GMT-06:00) Guadalajara, Mexico City, Monterrey, America/Mexico_City</option>"
        +"<option value=\"America/Winnipeg\">(GMT-06:00) Saskatchewan, America/Winnipeg</option>"
        +"<option value=\"America/Phoenix\">(GMT-07:00) Arizona, America/Phoenix</option>"
        +"<option value=\"America/Tegucigalpa\">(GMT-07:00) Chihuahua, La Paz, Mazatlan, America/Tegucigalpa</option>"
        +"<option value=\"America/Denver\">(GMT-07:00) Mountain Time (US & Canada), America/Denver</option>"
        +"<option value=\"America/Los_Angeles\">(GMT-08:00) Pacific Time (US & Canada) Tijuana, America/Los_Angeles</option>"
        +"<option value=\"America/Anchorage\">(GMT-09:00) Alaska, America/Anchorage</option>"
        +"<option value=\"Pacific/Honolulu\">(GMT-10:00) Hawaii, Pacific/Honolulu</option>"
        +"<option value=\"Pacific/Apia\">(GMT-11:00) Midway Island, Samoa, Pacific/Apia</option>"
        +"<option value=\"MIT\">(GMT-12:00) International Date Line West, MIT</option>"
        +"</select>";
}

function setTimeZone(timezone)
{
    var compEle = document.getElementById("timeZoneCombo");
    compEle.value = timezone;
}

function getSelectedTimeZone(returnType)
{
    var compEle = document.getElementById("timeZoneCombo");
    var val = compEle.options[compEle.selectedIndex].value;
    if(returnType == "intext")
    {
        val = compEle.options[compEle.selectedIndex].text;
    }
    return val;
}



