var gs_currency = '<option value=EUR  selected >EUR</option><option value=GBP >GBP</option><option value=USD >USD</option><option value=KES >KES</option>';
var gs_country = new Array();
var gs_nRooms = new Array();
gs_nRooms[1] = "1";
gs_nRooms[2] = "2";
gs_nRooms[3] = "3";
gs_nRooms[4] = "4";
gs_nRooms[5] = "5";
gs_nRooms[6] = "6";

var gs_ageGroup = new Array();
gs_ageGroup[1] = "1";
gs_ageGroup[2] = "2";
gs_ageGroup[3] = "3";
gs_ageGroup[4] = "4";
gs_ageGroup[5] = "5";
gs_ageGroup[6] = "6";
gs_ageGroup[7] = "7";
gs_ageGroup[8] = "8";
gs_ageGroup[9] = "9";
gs_ageGroup[10] = "10";
gs_ageGroup[11] = "11";
gs_ageGroup[12] = "12";
gs_ageGroup[13] = "13";
gs_ageGroup[14] = "14";
gs_ageGroup[15] = "15";
gs_ageGroup[16] = "16";
gs_ageGroup[17] = "17";
gs_ageGroup[18] = "18";
gs_ageGroup[19] = "19";
gs_ageGroup[20] = "20";
gs_ageGroup[21] = "21";


gs_country[1] = "Afghanistan";
gs_country[23] = "Aland Island";
gs_country[24] = "Albania";
gs_country[25] = "Algeria";
gs_country[137] = "Andorra";
gs_country[27] = "Angola";
gs_country[30] = "Anguilla";
gs_country[31] = "Antartica";
gs_country[32] = "Antigua And Barbuda";
gs_country[33] = "Argentina";
gs_country[34] = "Armenia";
gs_country[35] = "Aruba";
gs_country[36] = "Ascension Island/St. Helena";
gs_country[37] = "Australia";
gs_country[38] = "Austria";
gs_country[39] = "Azerbaijan";
gs_country[40] = "Bahamas";
gs_country[41] = "Bahrain";
gs_country[42] = "Bangladesh";
gs_country[43] = "Barbados";
gs_country[44] = "Belarus";
gs_country[45] = "Belgium";
gs_country[46] = "Belize";
gs_country[47] = "Benin";
gs_country[48] = "Bermuda";
gs_country[49] = "Bhutan";
gs_country[50] = "Bolivia";
gs_country[51] = "Bosnia Herzegovina";
gs_country[52] = "Botswana";
gs_country[53] = "Bouvet Island";
gs_country[54] = "Brazil";
gs_country[55] = "British Indian Ocean Territory";
gs_country[56] = "British Virgin Islands";
gs_country[57] = "Brunei";
gs_country[58] = "Bulgaria";
gs_country[59] = "Burkina Faso";
gs_country[60] = "Burundi";
gs_country[61] = "Cambodia";
gs_country[62] = "Cameroon, United Republic Of";
gs_country[63] = "Canada";
gs_country[64] = "Cape Verde, Republic Of";
gs_country[65] = "Cayman Islands";
gs_country[66] = "Central African Republic";
gs_country[67] = "Chad";
gs_country[68] = "Chile";
gs_country[69] = "China";
gs_country[70] = "Christmas Island";
gs_country[71] = "Cocos Islands";
gs_country[72] = "Colombia";
gs_country[73] = "Comoros";
gs_country[74] = "Congo";
gs_country[75] = "Congo Democratic Republic Of";
gs_country[76] = "Cook Islands";
gs_country[77] = "Costa Rica";
gs_country[78] = "Croatia";
gs_country[79] = "Cuba";
gs_country[80] = "Cyprus";
gs_country[81] = "Czech Republic";
gs_country[82] = "Denmark";
gs_country[83] = "Djibouti";
gs_country[84] = "Dominica";
gs_country[85] = "Dominican Republic";
gs_country[86] = "Ecuador";
gs_country[87] = "Egypt";
gs_country[88] = "El Salvador";
gs_country[89] = "Equatorial Guinea";
gs_country[90] = "Eritrea";
gs_country[91] = "Estonia";
gs_country[92] = "Ethiopia";
gs_country[93] = "Faeroe Islands";
gs_country[94] = "Falkland Islands";
gs_country[95] = "Fiji Islands";
gs_country[96] = "Finland";
gs_country[97] = "France";
gs_country[98] = "French Guiana";
gs_country[99] = "French Polynesia";
gs_country[100] = "French Southern Territories";
gs_country[101] = "Gabon";
gs_country[102] = "Gambia";
gs_country[103] = "Georgia";
gs_country[104] = "Germany";
gs_country[105] = "Ghana";
gs_country[106] = "Gibraltar";
gs_country[107] = "Greece";
gs_country[108] = "Greenland";
gs_country[109] = "Grenada";
gs_country[110] = "Guadeloupe";
gs_country[111] = "Guam";
gs_country[112] = "Guatemala";
gs_country[113] = "Guernsey";
gs_country[114] = "Guinea";
gs_country[115] = "Guinea Bissau";
gs_country[116] = "Guyana";
gs_country[117] = "Haiti";
gs_country[118] = "Heard Island and McDonald Islands";
gs_country[119] = "Honduras";
gs_country[120] = "Hong Kong";
gs_country[121] = "Hungary";
gs_country[122] = "Iceland";
gs_country[123] = "India";
gs_country[124] = "Indonesia";
gs_country[125] = "Iran";
gs_country[126] = "Iraq";
gs_country[127] = "Ireland, Republic Of";
gs_country[128] = "Isle Of Man";
gs_country[129] = "Israel";
gs_country[130] = "Italy";
gs_country[131] = "Ivory Coast";
gs_country[132] = "Jamaica";
gs_country[133] = "Japan";
gs_country[134] = "Jersey Island";
gs_country[135] = "Jordan";
gs_country[136] = "Kazakstan";
gs_country[26] = "Kenya";
gs_country[138] = "Kiribati";
gs_country[139] = "Korea, Democratic Peoples Republic";
gs_country[140] = "Korea, Republic Of";
gs_country[141] = "Kuwait";
gs_country[142] = "Kyrgyzstan";
gs_country[143] = "Lao, People's Dem. Rep.";
gs_country[144] = "Latvia";
gs_country[145] = "Lebanon";
gs_country[146] = "Lesotho";
gs_country[147] = "Liberia";
gs_country[148] = "Libyan Arab Jamahiriya";
gs_country[149] = "Liechtenstein";
gs_country[150] = "Lithuania";
gs_country[151] = "Luxembourg";
gs_country[152] = "Macau";
gs_country[153] = "Macedonia";
gs_country[154] = "Madagascar (Malagasy)";
gs_country[155] = "Malawi";
gs_country[156] = "Malaysia";
gs_country[157] = "Maldives";
gs_country[158] = "Mali";
gs_country[159] = "Malta";
gs_country[160] = "Marianna Islands";
gs_country[161] = "Marshall Islands";
gs_country[162] = "Martinique";
gs_country[163] = "Mauritania";
gs_country[164] = "Mauritius";
gs_country[165] = "Mayotte";
gs_country[166] = "Mexico";
gs_country[167] = "Micronesia";
gs_country[168] = "Moldova";
gs_country[169] = "Monaco";
gs_country[170] = "Mongolia";
gs_country[171] = "Montenegro";
gs_country[172] = "Montserrat";
gs_country[173] = "Morocco";
gs_country[174] = "Mozambique";
gs_country[175] = "Myanmar";
gs_country[176] = "Namibia";
gs_country[177] = "Nauru";
gs_country[178] = "Nepal";
gs_country[179] = "Netherland Antilles";
gs_country[180] = "Netherlands";
gs_country[181] = "New Caledonia";
gs_country[182] = "New Zealand";
gs_country[183] = "Nicaragua";
gs_country[184] = "Niger";
gs_country[185] = "Nigeria";
gs_country[186] = "Niue";
gs_country[187] = "Norfolk Island";
gs_country[188] = "Norway";
gs_country[189] = "Occupied Palestinian Territory";
gs_country[190] = "Oman, Sultanate Of";
gs_country[191] = "Pakistan";
gs_country[192] = "Palau";
gs_country[193] = "Panama";
gs_country[194] = "Papua New Guinea (Niugini)";
gs_country[195] = "Paraguay";
gs_country[196] = "Peru";
gs_country[197] = "Philippines";
gs_country[198] = "Pitcairn";
gs_country[199] = "Poland";
gs_country[200] = "Portugal";
gs_country[201] = "Qatar";
gs_country[202] = "Reunion";
gs_country[203] = "Romania";
gs_country[204] = "Russian Federation";
gs_country[205] = "Rwanda";
gs_country[206] = "Saint Lucia";
gs_country[207] = "Saint Vincent And The Grenadines";
gs_country[208] = "Samoa, American";
gs_country[209] = "Samoa, Independent State Of";
gs_country[210] = "San Marino";
gs_country[211] = "Sao Tome & Principe";
gs_country[212] = "Saudi Arabia";
gs_country[213] = "Senegal";
gs_country[214] = "Serbia";
gs_country[215] = "Serbia And Montenegro";
gs_country[216] = "Seychelles Islands";
gs_country[217] = "Sierra Leone";
gs_country[218] = "Singapore";
gs_country[219] = "Slovakia";
gs_country[220] = "Slovenia";
gs_country[221] = "Solomon Islands";
gs_country[222] = "Somalia";
gs_country[223] = "South Africa";
gs_country[224] = "South Georgia And S Sandwich Island";
gs_country[225] = "Spain";
gs_country[226] = "Sri Lanka";
gs_country[227] = "St. Kitts - Nevis";
gs_country[228] = "St. Pierre & Miquelon";
gs_country[229] = "Sudan";
gs_country[230] = "Suriname";
gs_country[231] = "Svalbard And Jan Mayen Is";
gs_country[232] = "Swaziland";
gs_country[233] = "Sweden";
gs_country[234] = "Switzerland";
gs_country[235] = "Syrian Arab Rep.";
gs_country[236] = "Taiwan, Republic of China";
gs_country[237] = "Tajikistan";
gs_country[238] = "Tanzania";
gs_country[268] = "test";
gs_country[239] = "Thailand";
gs_country[240] = "Timor Leste";
gs_country[241] = "Togo";
gs_country[242] = "Tokelau";
gs_country[243] = "Tonga";
gs_country[244] = "Trinidad & Tobago";
gs_country[245] = "Tunisia";
gs_country[246] = "Turkey";
gs_country[247] = "Turkmenistan";
gs_country[248] = "Turks And Caicos Islands";
gs_country[249] = "Tuvalu";
gs_country[250] = "Uganda";
gs_country[251] = "Ukraine";
gs_country[252] = "United Arab Emirates";
gs_country[253] = "United Kingdom";
gs_country[254] = "United States";
gs_country[255] = "United States Minor Outlying Islnds";
gs_country[256] = "Uruguay";
gs_country[257] = "Uzbekistan Sum";
gs_country[258] = "Vanuatu";
gs_country[259] = "Vatican City State";
gs_country[260] = "Venezuela";
gs_country[261] = "Vietnam";
gs_country[262] = "Wallis & Futuna Islands";
gs_country[263] = "Western Sahara";
gs_country[264] = "Yemen, Republic Of";
gs_country[265] = "Yugoslavia";
gs_country[266] = "Zambia";
gs_country[267] = "Zimbabwe";

function addOption(selectbox,value,text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);

}

function addOption_list(){
cnt= gs_country.length;
for( i =1;i<cnt-1;i++ ){
if(gs_country[i]!= undefined)
{
	addOption(document.search_hotel.country, i, gs_country[i]);
}
}
document.search_hotel.country.options[5].selected = true;
}

function addOption_list_car(){

cnt= gs_country.length;
for( i =1;i<cnt-1;i++ ){
if(gs_country[i]!= undefined)
	{
		addOption(document.search_car.country, i, gs_country[i]);
	}
}
document.search_car.country.options[4].selected = true;
}

function addOption_list_ins(){

cnt= gs_country.length;
for( i =1; i<cnt-1; i++){
		if(gs_country[i]!= undefined)
		{
			addOption(document.search_ins.country, i, gs_country[i]);
			addOption(document.search_ins.arrivalcountry, i, gs_country[i]);

		}
	}
}

function display(service){

       if (service=="hotel")
       {
            document.getElementById("hotel").style.display="inline";
            document.getElementById("flight").style.display="none";
            document.getElementById("insurance").style.display="none";
            document.getElementById("car").style.display="none";                   
            addOption_list();
            setup_DefaultDate(document.getElementById('departureDate'), document.getElementById('returnDate'));
       }else if(service=="flight")
       {
            document.getElementById("flight").style.display="inline";
            document.getElementById("hotel").style.display="none";
            document.getElementById("insurance").style.display="none";
            document.getElementById("car").style.display="none";
            setup_DefaultDate(document.getElementById('departureDatef'), document.getElementById('returnDatef'));
       }else if(service=="insurance"){
            document.getElementById("insurance").style.display="inline";
            document.getElementById("hotel").style.display="none";
            document.getElementById("flight").style.display="none";
            document.getElementById("car").style.display="none";
            setup_DefaultDate(document.getElementById('departurei'), document.getElementById('returnDatei'));
            addOption_list_ins();
       }else if(service=="car"){

            document.getElementById("car").style.display="inline";
            document.getElementById("hotel").style.display="none";
            document.getElementById("flight").style.display="none";
            document.getElementById("insurance").style.display="none";
            setup_DefaultDate(document.getElementById('departureDatec'), document.getElementById('returnDatec'));
            addOption_list_car();
       }

}
function setup_DefaultDate(objD,objR){
   
    var today=new Date();
    var tomorrow=new Date(today.getTime() + 86400000);
    var dd,mm,yyyy;
    dd=today.getDate();
    mm=(today.getMonth() + 1);
    yyyy=today.getFullYear();
    ddr=tomorrow.getDate();
    mmr=(tomorrow.getMonth() + 1);
    yyyyr=tomorrow.getFullYear();

    var dateD=mm + '/' + dd + '/' + yyyy;
    var dateR=mmr + '/' + ddr + '/' + yyyyr;
    if (objD.value==""){
        objD.value=dateD;
    }
    if (objR.value==""){
        objR.value=dateR;
    }
}

   function pad(num){
	    var str = "" + num;


	    if(str.length == 1)
		str = '0'+str;
	    return str;
	}
function RemoveAll(select)
{
 select.options.length = 0;
}
