function regionItem(regionString, startIdx, stopIdx) {
this.regionString = regionString; this.startIdx = startIdx;
this.stopIdx = stopIdx;}

function countryItem(countryString, countryID) {
this.countryString = countryString;
this.countryID = countryID;}

var regionArray  = new Array(regionItem);
var countryArray = new Array(countryItem);
countryArray[0]  = new countryItem("All Countries", 0);
regionArray[0]   = new regionItem("All Regions", 0, 0);

regionArray[1] = new regionItem("Africa", 1, 53);
countryArray[1] = new countryItem("All of Africa", 0);
countryArray[2] = new countryItem("Algeria", 1205);
countryArray[3] = new countryItem("Angola", 1214);
countryArray[4] = new countryItem("Benin", 2);
countryArray[5] = new countryItem("Botswana", 3);
countryArray[6] = new countryItem("Burkina Faso", 4);
countryArray[7] = new countryItem("Burundi", 1234);
countryArray[8] = new countryItem("Cameroon", 5);
countryArray[9] = new countryItem("Cape Verde", 6);
countryArray[10] = new countryItem("Central African Republic", 1236);
countryArray[11] = new countryItem("Chad", 1237);
countryArray[12] = new countryItem("Comoros", 1241);
countryArray[13] = new countryItem("Congo, Democratic Republic of (Zaire)", 1242);
countryArray[14] = new countryItem("Congo, Republic of", 1243);
countryArray[15] = new countryItem("Cote d'Ivoire", 7);
countryArray[16] = new countryItem("Djibouti", 1248);
countryArray[17] = new countryItem("Egypt", 8);
countryArray[18] = new countryItem("Equatorial Guinea", 1251);
countryArray[19] = new countryItem("Eritrea", 9);
countryArray[20] = new countryItem("Ethiopia", 10);
countryArray[21] = new countryItem("Gabon", 1256);
countryArray[22] = new countryItem("Gambia, The", 1258);
countryArray[23] = new countryItem("Ghana", 11);
countryArray[24] = new countryItem("Guinea", 1261);
countryArray[25] = new countryItem("Guinea-Bissau", 1262);
countryArray[26] = new countryItem("Kenya", 12);
countryArray[27] = new countryItem("Liberia", 1279);
countryArray[28] = new countryItem("Libya", 1280);
countryArray[29] = new countryItem("Madagascar", 13);
countryArray[30] = new countryItem("Malawi", 14);
countryArray[31] = new countryItem("Mali", 15);
countryArray[32] = new countryItem("Mauritania", 1294);
countryArray[33] = new countryItem("Mauritius", 16);
countryArray[34] = new countryItem("Morocco", 17);
countryArray[35] = new countryItem("Mozambique", 18);
countryArray[36] = new countryItem("Namibia", 19);
countryArray[37] = new countryItem("Niger", 1318);
countryArray[38] = new countryItem("Nigeria", 1319);
countryArray[39] = new countryItem("Rwanda", 1344);
countryArray[40] = new countryItem("Sao Tome and Principe", 1347);
countryArray[41] = new countryItem("Senegal", 20);
countryArray[42] = new countryItem("Seychelles", 21);
countryArray[43] = new countryItem("Sierra Leone", 1351);
countryArray[44] = new countryItem("Somalia", 1353);
countryArray[45] = new countryItem("South Africa", 22);
countryArray[46] = new countryItem("Sudan", 1359);
countryArray[47] = new countryItem("Swaziland", 1360);
countryArray[48] = new countryItem("Tanzania", 23);
countryArray[49] = new countryItem("Togo", 24);
countryArray[50] = new countryItem("Tunisia", 25);
countryArray[51] = new countryItem("Uganda", 26);
countryArray[52] = new countryItem("Zambia", 27);
countryArray[53] = new countryItem("Zimbabwe", 28);

regionArray[29] = new regionItem("Antarctica", 54, 54);
countryArray[54] = new countryItem("All of Antarctica", 0);

regionArray[30] = new regionItem("Australia and the South Pacific", 55, 73);
countryArray[55] = new countryItem("All of Australia and the South Pacific", 0);
countryArray[56] = new countryItem("American Samoa", 31);
countryArray[57] = new countryItem("Australia", 32);
countryArray[58] = new countryItem("Cook Islands", 33);
countryArray[59] = new countryItem("Fiji", 34);
countryArray[60] = new countryItem("French Polynesia", 35);
countryArray[61] = new countryItem("Guam", 70);
countryArray[62] = new countryItem("Kiribati", 37);
countryArray[63] = new countryItem("Marshall Islands", 38);
countryArray[64] = new countryItem("Micronesia", 39);
countryArray[65] = new countryItem("New Caledonia", 40);
countryArray[66] = new countryItem("New Zealand", 41);
countryArray[67] = new countryItem("Northern Mariana Islands", 1323);
countryArray[68] = new countryItem("Palau", 42);
countryArray[69] = new countryItem("Papua New Guinea", 43);
countryArray[70] = new countryItem("Solomon Islands", 44);
countryArray[71] = new countryItem("Tonga", 45);
countryArray[72] = new countryItem("Vanuatu", 46);
countryArray[73] = new countryItem("Western Samoa", 47);

regionArray[48] = new regionItem("Caribbean", 74, 101);
countryArray[74] = new countryItem("All of Caribbean", 0);
countryArray[75] = new countryItem("Anguilla", 1215);
countryArray[76] = new countryItem("Antigua and Barbuda", 49);
countryArray[77] = new countryItem("Aruba", 1221);
countryArray[78] = new countryItem("Bahamas", 50);
countryArray[79] = new countryItem("Barbados", 51);
countryArray[80] = new countryItem("Bermuda", 1229);
countryArray[81] = new countryItem("Bonaire", 52);
countryArray[82] = new countryItem("British Virgin Islands", 53);
countryArray[83] = new countryItem("Cayman Islands", 54);
countryArray[84] = new countryItem("Cuba", 55);
countryArray[85] = new countryItem("Curacao", 1246);
countryArray[86] = new countryItem("Dominica", 56);
countryArray[87] = new countryItem("Dominican Republic", 57);
countryArray[88] = new countryItem("Grenada", 58);
countryArray[89] = new countryItem("Guadeloupe", 59);
countryArray[90] = new countryItem("Haiti", 1264);
countryArray[91] = new countryItem("Jamaica", 60);
countryArray[92] = new countryItem("Martinique", 61);
countryArray[93] = new countryItem("Montserrat", 1302);
countryArray[94] = new countryItem("Puerto Rico", 62);
countryArray[95] = new countryItem("Sint Maarten", 65);
countryArray[96] = new countryItem("St. Kitts and Nevis", 63);
countryArray[97] = new countryItem("St. Lucia", 64);
countryArray[98] = new countryItem("St. Vincent and the Grenadines", 66);
countryArray[99] = new countryItem("Trinidad and Tobago", 67);
countryArray[100] = new countryItem("Turks and Caicos", 68);
countryArray[101] = new countryItem("U.S. Virgin Islands", 69);

regionArray[71] = new regionItem("Central and South America", 102, 123);
countryArray[102] = new countryItem("All of Central and South America", 0);
countryArray[103] = new countryItem("Argentina", 72);
countryArray[104] = new countryItem("Belize", 73);
countryArray[105] = new countryItem("Bolivia", 74);
countryArray[106] = new countryItem("Brazil", 75);
countryArray[107] = new countryItem("Chile", 76);
countryArray[108] = new countryItem("Colombia", 77);
countryArray[109] = new countryItem("Costa Rica", 78);
countryArray[110] = new countryItem("Ecuador", 79);
countryArray[111] = new countryItem("El Salvador", 1250);
countryArray[112] = new countryItem("Falkland Islands", 80);
countryArray[113] = new countryItem("French Guiana", 1255);
countryArray[114] = new countryItem("Guatemala", 81);
countryArray[115] = new countryItem("Guyana", 1263);
countryArray[116] = new countryItem("Honduras", 82);
countryArray[117] = new countryItem("Nicaragua", 83);
countryArray[118] = new countryItem("Panama", 84);
countryArray[119] = new countryItem("Paraguay", 1335);
countryArray[120] = new countryItem("Peru", 85);
countryArray[121] = new countryItem("Suriname", 86);
countryArray[122] = new countryItem("Uruguay", 1370);
countryArray[123] = new countryItem("Venezuela", 87);

regionArray[88] = new regionItem("Europe", 124, 169);
countryArray[124] = new countryItem("All of Europe", 0);
countryArray[125] = new countryItem("Albania", 1203);
countryArray[126] = new countryItem("Andorra", 1212);
countryArray[127] = new countryItem("Austria", 89);
countryArray[128] = new countryItem("Belarus", 1228);
countryArray[129] = new countryItem("Belgium", 90);
countryArray[130] = new countryItem("Bosnia-Herzegovina", 1231);
countryArray[131] = new countryItem("Bulgaria", 1233);
countryArray[132] = new countryItem("Croatia", 92);
countryArray[133] = new countryItem("Czech Republic", 91);
countryArray[134] = new countryItem("Denmark", 94);
countryArray[135] = new countryItem("Estonia", 1252);
countryArray[136] = new countryItem("Finland", 96);
countryArray[137] = new countryItem("France", 97);
countryArray[138] = new countryItem("Germany", 99);
countryArray[139] = new countryItem("Greece", 100);
countryArray[140] = new countryItem("Hungary", 101);
countryArray[141] = new countryItem("Iceland", 102);
countryArray[142] = new countryItem("Ireland", 103);
countryArray[143] = new countryItem("Italy", 104);
countryArray[144] = new countryItem("Latvia", 1278);
countryArray[145] = new countryItem("Liechtenstein", 1281);
countryArray[146] = new countryItem("Lithuania", 1282);
countryArray[147] = new countryItem("Luxembourg", 1285);
countryArray[148] = new countryItem("Macedonia", 1286);
countryArray[149] = new countryItem("Malta", 105);
countryArray[150] = new countryItem("Moldava", 1299);
countryArray[151] = new countryItem("Monaco", 1300);
countryArray[152] = new countryItem("Netherlands", 106);
countryArray[153] = new countryItem("Northern Ireland", 107);
countryArray[154] = new countryItem("Norway", 108);
countryArray[155] = new countryItem("Poland", 109);
countryArray[156] = new countryItem("Portugal", 110);
countryArray[157] = new countryItem("Romania", 1343);
countryArray[158] = new countryItem("Russia", 111);
countryArray[159] = new countryItem("Slovakia", 1352);
countryArray[160] = new countryItem("Slovenia", 113);
countryArray[161] = new countryItem("Spain", 114);
countryArray[162] = new countryItem("Sweden", 115);
countryArray[163] = new countryItem("Switzerland", 116);
countryArray[164] = new countryItem("Ukraine", 1366);
countryArray[165] = new countryItem("United Kingdom", 1369);
countryArray[166] = new countryItem("--England", 95);
countryArray[167] = new countryItem("--Northern Ireland", 107);
countryArray[168] = new countryItem("--Scotland", 112);
countryArray[169] = new countryItem("--Wales", 117);

regionArray[118] = new regionItem("Far East", 170, 178);
countryArray[170] = new countryItem("All of Far East", 0);
countryArray[171] = new countryItem("China", 119);
countryArray[172] = new countryItem("--Hong Kong", 120);
countryArray[173] = new countryItem("--Tibet", 1363);
countryArray[174] = new countryItem("Japan", 121);
countryArray[175] = new countryItem("Mongolia", 122);
countryArray[176] = new countryItem("North Korea", 1322);
countryArray[177] = new countryItem("South Korea", 123);
countryArray[178] = new countryItem("Taiwan", 124);

regionArray[125] = new regionItem("Middle East", 179, 203);
countryArray[179] = new countryItem("All of Middle East", 0);
countryArray[180] = new countryItem("Afghanistan", 1201);
countryArray[181] = new countryItem("Armenia", 1220);
countryArray[182] = new countryItem("Azerbaijan", 1223);
countryArray[183] = new countryItem("Bahrain", 1224);
countryArray[184] = new countryItem("Cyprus", 93);
countryArray[185] = new countryItem("Georgia (Caucasus)", 98);
countryArray[186] = new countryItem("Iran", 126);
countryArray[187] = new countryItem("Iraq", 1270);
countryArray[188] = new countryItem("Israel", 127);
countryArray[189] = new countryItem("Jordan", 128);
countryArray[190] = new countryItem("Kazakhstan", 129);
countryArray[191] = new countryItem("Kuwait", 1276);
countryArray[192] = new countryItem("Kyrgyz Republic", 130);
countryArray[193] = new countryItem("Lebanon", 131);
countryArray[194] = new countryItem("Oman", 132);
countryArray[195] = new countryItem("Qatar", 1340);
countryArray[196] = new countryItem("Saudi Arabia", 1349);
countryArray[197] = new countryItem("Syria", 133);
countryArray[198] = new countryItem("Tajikistan", 134);
countryArray[199] = new countryItem("Turkey", 135);
countryArray[200] = new countryItem("Turkmenistan", 136);
countryArray[201] = new countryItem("United Arab Emirates", 137);
countryArray[202] = new countryItem("Uzbekistan", 138);
countryArray[203] = new countryItem("Yemen", 139);

regionArray[140] = new regionItem("North America", 204, 271);
countryArray[204] = new countryItem("All of North America", 0);
countryArray[205] = new countryItem("Canada", 141);
countryArray[206] = new countryItem("--Alberta", 1204);
countryArray[207] = new countryItem("--British Columbia", 1232);
countryArray[208] = new countryItem("--Manitoba", 1290);
countryArray[209] = new countryItem("--New Brunswick", 1311);
countryArray[210] = new countryItem("--Newfoundland", 1316);
countryArray[211] = new countryItem("--Northwest Territories", 1326);
countryArray[212] = new countryItem("--Nova Scotia", 1327);
countryArray[213] = new countryItem("--Nunavut", 1328);
countryArray[214] = new countryItem("--Ontario", 1332);
countryArray[215] = new countryItem("--Prince Edward Island", 1338);
countryArray[216] = new countryItem("--Quebec", 1341);
countryArray[217] = new countryItem("--Saskatchewan", 1348);
countryArray[218] = new countryItem("--Yukon Territory", 1382);
countryArray[219] = new countryItem("Greenland", 142);
countryArray[220] = new countryItem("Mexico", 143);
countryArray[221] = new countryItem("United States", 144);
countryArray[222] = new countryItem("--Alabama", 1202);
countryArray[223] = new countryItem("--Alaska", 169);
countryArray[224] = new countryItem("--Arizona", 1218);
countryArray[225] = new countryItem("--Arkansas", 1219);
countryArray[226] = new countryItem("--California", 1235);
countryArray[227] = new countryItem("--Colorado", 1240);
countryArray[228] = new countryItem("--Connecticut", 1244);
countryArray[229] = new countryItem("--Delaware", 1247);
countryArray[230] = new countryItem("--Florida", 1254);
countryArray[231] = new countryItem("--Georgia (US State)", 1259);
countryArray[232] = new countryItem("--Hawaii", 170);
countryArray[233] = new countryItem("--Idaho", 1266);
countryArray[234] = new countryItem("--Illinois", 1267);
countryArray[235] = new countryItem("--Indiana", 1268);
countryArray[236] = new countryItem("--Iowa", 1269);
countryArray[237] = new countryItem("--Kansas", 1274);
countryArray[238] = new countryItem("--Kentucky", 1275);
countryArray[239] = new countryItem("--Louisiana", 1284);
countryArray[240] = new countryItem("--Maine", 1288);
countryArray[241] = new countryItem("--Maryland", 1291);
countryArray[242] = new countryItem("--Massachusetts", 1293);
countryArray[243] = new countryItem("--Michigan", 1295);
countryArray[244] = new countryItem("--Minnesota", 1296);
countryArray[245] = new countryItem("--Mississippi", 1297);
countryArray[246] = new countryItem("--Missouri", 1298);
countryArray[247] = new countryItem("--Montana", 1301);
countryArray[248] = new countryItem("--Nebraska", 1308);
countryArray[249] = new countryItem("--Nevada", 1310);
countryArray[250] = new countryItem("--New Hampshire", 1312);
countryArray[251] = new countryItem("--New Jersey", 1313);
countryArray[252] = new countryItem("--New Mexico", 1314);
countryArray[253] = new countryItem("--New York", 1315);
countryArray[254] = new countryItem("--North Carolina", 1320);
countryArray[255] = new countryItem("--North Dakota", 1321);
countryArray[256] = new countryItem("--Ohio", 1329);
countryArray[257] = new countryItem("--Oklahoma", 1331);
countryArray[258] = new countryItem("--Oregon", 1333);
countryArray[259] = new countryItem("--Pennsylvania", 1337);
countryArray[260] = new countryItem("--Rhode Island", 1342);
countryArray[261] = new countryItem("--South Carolina", 1354);
countryArray[262] = new countryItem("--South Dakota", 1355);
countryArray[263] = new countryItem("--Tennessee", 1361);
countryArray[264] = new countryItem("--Texas", 1362);
countryArray[265] = new countryItem("--Utah", 1371);
countryArray[266] = new countryItem("--Vermont", 1372);
countryArray[267] = new countryItem("--Virginia", 1374);
countryArray[268] = new countryItem("--Washington", 1375);
countryArray[269] = new countryItem("--West Virginia", 1376);
countryArray[270] = new countryItem("--Wisconsin", 1377);
countryArray[271] = new countryItem("--Wyoming", 1378);

regionArray[145] = new regionItem("South and Southeast Asia", 272, 290);
countryArray[272] = new countryItem("All of South and Southeast Asia", 0);
countryArray[273] = new countryItem("Bangladesh", 1227);
countryArray[274] = new countryItem("Bhutan", 146);
countryArray[275] = new countryItem("Brunei", 147);
countryArray[276] = new countryItem("Burma(Myanmar)", 148);
countryArray[277] = new countryItem("Cambodia", 149);
countryArray[278] = new countryItem("India", 150);
countryArray[279] = new countryItem("Indonesia", 151);
countryArray[280] = new countryItem("--Bali", 1226);
countryArray[281] = new countryItem("Laos", 152);
countryArray[282] = new countryItem("Malaysia", 153);
countryArray[283] = new countryItem("Maldives", 154);
countryArray[284] = new countryItem("Nepal", 155);
countryArray[285] = new countryItem("Pakistan", 156);
countryArray[286] = new countryItem("Philippines", 157);
countryArray[287] = new countryItem("Singapore", 158);
countryArray[288] = new countryItem("Sri Lanka", 159);
countryArray[289] = new countryItem("Thailand", 160);
countryArray[290] = new countryItem("Vietnam", 161);
function fillSelects() {changeSelects(0);}

function changeSelects(regionIdx) {
clearSelect();
counterIdx = regionArray[regionIdx].startIdx;
endCounterIdx = regionArray[regionIdx].stopIdx;
i = 0;
while (counterIdx <= endCounterIdx) {
document.tripSearch.countries.options[i] = 
new Option(countryArray[counterIdx].countryString, 
countryArray[counterIdx].countryID);
i++;
counterIdx++;}
document.tripSearch.countries.selectedIndex = 0;}

function clearSelect(){
endCounterIdx = document.tripSearch.countries.length;
counterIdx = 0;
while (counterIdx <= endCounterIdx) {
document.tripSearch.countries.options[endCounterIdx] = null;
endCounterIdx--;}}

