var RegionCode = new Array(19);
var RegionName = new Array(19);
RegionCode[0] = 11
RegionName[0] = 'West Africa'
RegionCode[1] = 12
RegionName[1] = 'Eastern Africa'
RegionCode[2] = 13
RegionName[2] = 'Southwest Indian Ocean'
RegionCode[3] = 21
RegionName[3] = 'East Australia'
RegionCode[4] = 22
RegionName[4] = 'Southwest Pacific'
RegionCode[5] = 23
RegionName[5] = 'Micronesia'
RegionCode[6] = 24
RegionName[6] = 'Southeast and Central Pacific'
RegionCode[7] = 25
RegionName[7] = 'US Pacific Islands'
RegionCode[8] = 31
RegionName[8] = 'South Asia'
RegionCode[9] = 32
RegionName[9] = 'Southeast Asia'
RegionCode[10] = 33
RegionName[10] = 'North and East Asia'
RegionCode[11] = 41
RegionName[11] = 'U.S. Caribbean'
RegionCode[12] = 42
RegionName[12] = 'Mesoamerica'
RegionCode[13] = 43
RegionName[13] = 'Eastern Caribbean'
RegionCode[14] = 44
RegionName[14] = 'Southern Tropical America'
RegionCode[15] = 45
RegionName[15] = 'Northern Caribbean'
RegionCode[16] = 51
RegionName[16] = 'Persian Gulf'
RegionCode[17] = 52
RegionName[17] = 'Red Sea - Gulf of Aden'
RegionCode[18] = 60
RegionName[18] = 'Australia and Papua New Guinea'


var countryRegion = new Array(134);
var countryValue = new Array(134);
var countryDisplay = new Array(134);
countryRegion[0] = 23
countryValue[0] = 'ASM'
countryDisplay[0] = 'American Samoa'
countryRegion[1] = 43
countryValue[1] = 'AIA'
countryDisplay[1] = 'Anguilla'
countryRegion[2] = 43
countryValue[2] = 'ATG'
countryDisplay[2] = 'Antigua and Barbuda'
countryRegion[3] = 60
countryValue[3] = 'AUS'
countryDisplay[3] = 'Australia'
countryRegion[4] = 45
countryValue[4] = 'BHS'
countryDisplay[4] = 'Bahamas'
countryRegion[5] = 51
countryValue[5] = 'BHR'
countryDisplay[5] = 'Bahrain'
countryRegion[6] = 25
countryValue[6] = 'UMI_BHD'
countryDisplay[6] = 'Baker and Howland Islands'
countryRegion[7] = 31
countryValue[7] = 'BGD'
countryDisplay[7] = 'Bangladesh'
countryRegion[8] = 43
countryValue[8] = 'BRB'
countryDisplay[8] = 'Barbados'
countryRegion[9] = 42
countryValue[9] = 'BLZ'
countryDisplay[9] = 'Belize'
countryRegion[10] = 45
countryValue[10] = 'BMU'
countryDisplay[10] = 'Bermuda'
countryRegion[11] = 44
countryValue[11] = 'BRA'
countryDisplay[11] = 'Brazil'
countryRegion[12] = 32
countryValue[12] = 'BRN'
countryDisplay[12] = 'Brunei Darussalam'
countryRegion[13] = 32
countryValue[13] = 'KHM'
countryDisplay[13] = 'Cambodia'
countryRegion[14] = 11
countryValue[14] = 'CMR'
countryDisplay[14] = 'Cameroon'
countryRegion[15] = 11
countryValue[15] = 'CPV'
countryDisplay[15] = 'Cape Verde Islands'
countryRegion[16] = 45
countryValue[16] = 'CYM'
countryDisplay[16] = 'Cayman Islands'
countryRegion[17] = 31
countryValue[17] = 'GBR_CHA'
countryDisplay[17] = 'Chagos Archipelago (UK)'
countryRegion[18] = 44
countryValue[18] = 'CHL'
countryDisplay[18] = 'Chile'
countryRegion[19] = 33
countryValue[19] = 'CHN'
countryDisplay[19] = 'China'
countryRegion[20] = 24
countryValue[20] = 'FRA_CLI'
countryDisplay[20] = 'Clipperton Atoll (France)'
countryRegion[21] = 44
countryValue[21] = 'COL'
countryDisplay[21] = 'Colombia'
countryRegion[22] = 13
countryValue[22] = 'COM'
countryDisplay[22] = 'Comoros'
countryRegion[23] = 24
countryValue[23] = 'COK'
countryDisplay[23] = 'Cook Islands'
countryRegion[24] = 44
countryValue[24] = 'CRI'
countryDisplay[24] = 'Costa Rica'
countryRegion[25] = 45
countryValue[25] = 'CUB'
countryDisplay[25] = 'Cuba'
countryRegion[26] = 52
countryValue[26] = 'DJI'
countryDisplay[26] = 'Djibouti'
countryRegion[27] = 43
countryValue[27] = 'DMA'
countryDisplay[27] = 'Dominica'
countryRegion[28] = 45
countryValue[28] = 'DOM'
countryDisplay[28] = 'Dominican Republic'
countryRegion[29] = 32
countryValue[29] = 'TMP'
countryDisplay[29] = 'East Timor'
countryRegion[30] = 44
countryValue[30] = 'ECU'
countryDisplay[30] = 'Ecuador'
countryRegion[31] = 52
countryValue[31] = 'EGY'
countryDisplay[31] = 'Egypt'
countryRegion[32] = 42
countryValue[32] = 'SLV'
countryDisplay[32] = 'El Salvador'
countryRegion[33] = 11
countryValue[33] = 'GNQ'
countryDisplay[33] = 'Equatorial Guinea'
countryRegion[34] = 52
countryValue[34] = 'ERI'
countryDisplay[34] = 'Eritrea'
countryRegion[35] = 23
countryValue[35] = 'FSM'
countryDisplay[35] = 'Federated States of Micronesia'
countryRegion[36] = 22
countryValue[36] = 'FJI'
countryDisplay[36] = 'Fiji'
countryRegion[37] = 41
countryValue[37] = 'USA_FLO'
countryDisplay[37] = 'Florida (USA)'
countryRegion[38] = 24
countryValue[38] = 'PYF'
countryDisplay[38] = 'French Polynesia'
countryRegion[39] = 11
countryValue[39] = 'GHA'
countryDisplay[39] = 'Ghana'
countryRegion[40] = 43
countryValue[40] = 'GRD'
countryDisplay[40] = 'Grenada'
countryRegion[41] = 43
countryValue[41] = 'GLP'
countryDisplay[41] = 'Guadeloupe'
countryRegion[42] = 23
countryValue[42] = 'GUM'
countryDisplay[42] = 'Guam'
countryRegion[43] = 42
countryValue[43] = 'GTM'
countryDisplay[43] = 'Guatemala'
countryRegion[44] = 45
countryValue[44] = 'HTI'
countryDisplay[44] = 'Haiti'
countryRegion[45] = 25
countryValue[45] = 'USA_HAW'
countryDisplay[45] = 'Hawaiian Islands (USA)'
countryRegion[46] = 42
countryValue[46] = 'HND'
countryDisplay[46] = 'Honduras'
countryRegion[47] = 33
countryValue[47] = 'HKG'
countryDisplay[47] = 'Hong Kong'
countryRegion[48] = 31
countryValue[48] = 'IND'
countryDisplay[48] = 'India'
countryRegion[49] = 12
countryValue[49] = 'FRA_SCA'
countryDisplay[49] = 'Indian Ocean Islands (France)'
countryRegion[50] = 32
countryValue[50] = 'IDN'
countryDisplay[50] = 'Indonesia'
countryRegion[51] = 51
countryValue[51] = 'IRN'
countryDisplay[51] = 'Iran'
countryRegion[52] = 52
countryValue[52] = 'ISR'
countryDisplay[52] = 'Israel'
countryRegion[53] = 11
countryValue[53] = 'CIV'
countryDisplay[53] = 'Ivory Coast'
countryRegion[54] = 45
countryValue[54] = 'JAM'
countryDisplay[54] = 'Jamaica'
countryRegion[55] = 33
countryValue[55] = 'JPN'
countryDisplay[55] = 'Japan'
countryRegion[56] = 25
countryValue[56] = 'UMI_JAR'
countryDisplay[56] = 'Jarvis Island'
countryRegion[57] = 25
countryValue[57] = 'JTN'
countryDisplay[57] = 'Johnston Island'
countryRegion[58] = 52
countryValue[58] = 'JOR'
countryDisplay[58] = 'Jordan'
countryRegion[59] = 12
countryValue[59] = 'KEN'
countryDisplay[59] = 'Kenya'
countryRegion[60] = 25
countryValue[60] = 'USA_KIN'
countryDisplay[60] = 'Kingman Reef'
countryRegion[61] = 24
countryValue[61] = 'KIR'
countryDisplay[61] = 'Kiribati'
countryRegion[62] = 33
countryValue[62] = 'KOR'
countryDisplay[62] = 'Korea'
countryRegion[63] = 51
countryValue[63] = 'KWT'
countryDisplay[63] = 'Kuwait'
countryRegion[64] = 11
countryValue[64] = 'LBR'
countryDisplay[64] = 'Liberia'
countryRegion[65] = 13
countryValue[65] = 'MDG'
countryDisplay[65] = 'Madagascar'
countryRegion[66] = 32
countryValue[66] = 'MYS'
countryDisplay[66] = 'Malaysia'
countryRegion[67] = 31
countryValue[67] = 'MDV'
countryDisplay[67] = 'Maldives'
countryRegion[68] = 23
countryValue[68] = 'MHL'
countryDisplay[68] = 'Marshall Islands'
countryRegion[69] = 43
countryValue[69] = 'MTQ'
countryDisplay[69] = 'Martinique'
countryRegion[70] = 13
countryValue[70] = 'MUS'
countryDisplay[70] = 'Mauritius'
countryRegion[71] = 13
countryValue[71] = 'MYT'
countryDisplay[71] = 'Mayotte'
countryRegion[72] = 42
countryValue[72] = 'MEX'
countryDisplay[72] = 'Mexico'
countryRegion[73] = 25
countryValue[73] = 'UMI'
countryDisplay[73] = 'Minor Outlying Islands'
countryRegion[74] = 43
countryValue[74] = 'MSR'
countryDisplay[74] = 'Montserrat'
countryRegion[75] = 12
countryValue[75] = 'MOZ'
countryDisplay[75] = 'Mozambique'
countryRegion[76] = 32
countryValue[76] = 'MMR'
countryDisplay[76] = 'Myanmar'
countryRegion[77] = 22
countryValue[77] = 'NRU'
countryDisplay[77] = 'Nauru'
countryRegion[78] = 41
countryValue[78] = 'USA_NAV'
countryDisplay[78] = 'Navassa Island (USA)'
countryRegion[79] = 43
countryValue[79] = 'ANT'
countryDisplay[79] = 'Netherlands Antilles'
countryRegion[80] = 22
countryValue[80] = 'NCL'
countryDisplay[80] = 'New Caledonia'
countryRegion[81] = 24
countryValue[81] = 'NZL'
countryDisplay[81] = 'New Zealand'
countryRegion[82] = 42
countryValue[82] = 'NIC'
countryDisplay[82] = 'Nicaragua'
countryRegion[83] = 24
countryValue[83] = 'NIU'
countryDisplay[83] = 'Niue'
countryRegion[84] = 23
countryValue[84] = 'NMI'
countryDisplay[84] = 'Northern Mariana Islands'
countryRegion[85] = 51
countryValue[85] = 'OMN'
countryDisplay[85] = 'Oman'
countryRegion[86] = 31
countryValue[86] = 'PAK'
countryDisplay[86] = 'Pakistan'
countryRegion[87] = 23
countryValue[87] = 'PLW'
countryDisplay[87] = 'Palau'
countryRegion[88] = 25
countryValue[88] = 'UMI_PAL'
countryDisplay[88] = 'Palmyra Atoll'
countryRegion[89] = 44
countryValue[89] = 'PAN'
countryDisplay[89] = 'Panama'
countryRegion[90] = 60
countryValue[90] = 'PNG'
countryDisplay[90] = 'Papua New Guinea'
countryRegion[91] = 32
countryValue[91] = 'XXX_PAR'
countryDisplay[91] = 'Paracel Islands'
countryRegion[92] = 32
countryValue[92] = 'PHL'
countryDisplay[92] = 'Philippines'
countryRegion[93] = 24
countryValue[93] = 'PCN'
countryDisplay[93] = 'Pitcairn Islands'
countryRegion[94] = 41
countryValue[94] = 'PRI'
countryDisplay[94] = 'Puerto Rico'
countryRegion[95] = 51
countryValue[95] = 'QAT'
countryDisplay[95] = 'Qatar'
countryRegion[96] = 13
countryValue[96] = 'REU'
countryDisplay[96] = 'Réunion'
countryRegion[97] = 22
countryValue[97] = 'WSM'
countryDisplay[97] = 'Samoa'
countryRegion[98] = 11
countryValue[98] = 'STP'
countryDisplay[98] = 'Sao Tome and Principe'
countryRegion[99] = 52
countryValue[99] = 'SAU'
countryDisplay[99] = 'Saudi Arabia'
countryRegion[100] = 11
countryValue[100] = 'SEN'
countryDisplay[100] = 'Senegal'
countryRegion[101] = 13
countryValue[101] = 'SYC'
countryDisplay[101] = 'Seychelles'
countryRegion[102] = 11
countryValue[102] = 'SLE'
countryDisplay[102] = 'Sierra Leone'
countryRegion[103] = 32
countryValue[103] = 'SGP'
countryDisplay[103] = 'Singapore'
countryRegion[104] = 22
countryValue[104] = 'SLB'
countryDisplay[104] = 'Solomon Islands'
countryRegion[105] = 12
countryValue[105] = 'SOM'
countryDisplay[105] = 'Somalia'
countryRegion[106] = 12
countryValue[106] = 'ZAF'
countryDisplay[106] = 'South Africa'
countryRegion[107] = 32
countryValue[107] = 'SPR'
countryDisplay[107] = 'Spratly Islands'
countryRegion[108] = 31
countryValue[108] = 'LKA'
countryDisplay[108] = 'Sri Lanka'
countryRegion[109] = 43
countryValue[109] = 'GLP_SBA'
countryDisplay[109] = 'St. Barthélemy'
countryRegion[110] = 43
countryValue[110] = 'KNA'
countryDisplay[110] = 'St. Kitts and Nevis'
countryRegion[111] = 43
countryValue[111] = 'LCA'
countryDisplay[111] = 'St. Lucia'
countryRegion[112] = 43
countryValue[112] = 'VCT'
countryDisplay[112] = 'St. Vincent and the Grenadines'
countryRegion[113] = 52
countryValue[113] = 'SDN'
countryDisplay[113] = 'Sudan'
countryRegion[114] = 33
countryValue[114] = 'TWN'
countryDisplay[114] = 'Taiwan'
countryRegion[115] = 12
countryValue[115] = 'TZA'
countryDisplay[115] = 'Tanzania'
countryRegion[116] = 32
countryValue[116] = 'THA'
countryDisplay[116] = 'Thailand'
countryRegion[117] = 24
countryValue[117] = 'TKL'
countryDisplay[117] = 'Tokelau'
countryRegion[118] = 24
countryValue[118] = 'TON'
countryDisplay[118] = 'Tonga'
countryRegion[119] = 21
countryValue[119] = 'AUS_GBR'
countryDisplay[119] = 'Torres Strait & Great Barrier Reef'
countryRegion[120] = 43
countryValue[120] = 'TTO'
countryDisplay[120] = 'Trinidad and Tobago'
countryRegion[121] = 45
countryValue[121] = 'TCA'
countryDisplay[121] = 'Turks and Caicos Islands'
countryRegion[122] = 22
countryValue[122] = 'TUV'
countryDisplay[122] = 'Tuvalu'
countryRegion[123] = 51
countryValue[123] = 'ARE'
countryDisplay[123] = 'United Arab Emirates'
countryRegion[124] = 41
countryValue[124] = 'USA'
countryDisplay[124] = 'United States'
countryRegion[125] = 22
countryValue[125] = 'VUT'
countryDisplay[125] = 'Vanuatu'
countryRegion[126] = 44
countryValue[126] = 'VEN'
countryDisplay[126] = 'Venezuela'
countryRegion[127] = 32
countryValue[127] = 'VNM'
countryDisplay[127] = 'Vietnam'
countryRegion[128] = 43
countryValue[128] = 'VBG'
countryDisplay[128] = 'Virgin Islands (British)'
countryRegion[129] = 41
countryValue[129] = 'VIR'
countryDisplay[129] = 'Virgin Islands (U.S.)'
countryRegion[130] = 25
countryValue[130] = 'UMI_WAK'
countryDisplay[130] = 'Wake Island'
countryRegion[131] = 24
countryValue[131] = 'WLF'
countryDisplay[131] = 'Wallis and Futuna'
countryRegion[132] = 52
countryValue[132] = 'YEM'
countryDisplay[132] = 'Yemen'
countryRegion[133] = 41
countryValue[133] = 'USA_GME'
countryDisplay[133] = 'Gulf of Mexico (USA)'

//for session


//for form
function getformcountry(strformname)
{
//alert (queryString('countrycode'));
    var cval = document.forms[strformname].formregion.options[document.forms[strformname].formregion.selectedIndex].value;
    if (cval != '')
    {
         document.forms[strformname].formcountry.disabled = false;
         document.forms[strformname].formcountry.length = 0;
         
         var counter = 0
         document.forms[strformname].formcountry.options[counter] = new Option('All Countries in selected region', '');
         document.forms[strformname].formcountry.options[counter].selected = true;
         counter++
         document.forms[strformname].formcountry.options[counter] = new Option('--------------------------------', '');
         counter++ 
         var strTemp = Request.QueryString('formcountry');
         strTemp = strTemp.toString();
         strTemp = strTemp.toUpperCase();
         for(i=0;i<countryRegion.length;i++)
         {
             if (cval == countryRegion[i]) {
               document.forms[strformname].formcountry.options[counter] = new Option(countryDisplay[i],countryValue[i]);
               if (strTemp == countryValue[i].toUpperCase()) {
                 document.forms[strformname].formcountry.options[counter].selected = true;
                 //alert (queryString('countrycode').toLowerCase());
              }
               counter++;
             }
             //document.frm.country.options[i] = new Option(eval(""+cval+"option["+i+"]"),eval(""+cval+"id["+i+"]"));
              
         }
    }
    else
    {
         document.forms[strformname].formcountry.length = 0;
         document.forms[strformname].formcountry.options[0] = new Option('All Countries in selected region','');
         document.forms[strformname].formcountry.disabled = true;     
    }
    
}

function changeregion()
{
    var rval = document.frm.country.options[document.frm.country.selectedIndex].value;
    document.frm.country.options[0] = new Option("Select Region","0");
    for(j=0;j<document.frm.Region.length;j++)
    if(rval.indexOf(',') != -1)
    {
         rval = rval.split(',');
         for(j=0;j<document.frm.Region.length;j++)
         {
              if(document.frm.Region.options[j].value == rval[1])
              {
                   document.frm.Region.options[j].selected = true;
                   break;
              }               
         }
    }
}