var xmlHttp;var bizActionMode;function getHotelLodging(A,B){document.cityHotelListDetailForm.hotelid.value=A;document.cityHotelListDetailForm.supplier_name.value=B;document.cityHotelListDetailForm.submit()}function getHotelSearchPage(A,B){document.cityHotelListBookForm.hotelName.value=A;document.cityHotelListBookForm.filterHotelStarRating.value=B;document.cityHotelListBookForm.submit()}function doPagination(E,C,H,J,D){var K=parseInt(document.cityHotelListPaginationForm.iFromCount.value,10);var B=parseInt(document.cityHotelListPaginationForm.iToCount.value,10);var I=parseInt(document.getElementById("pageCounter").innerHTML,10);if(E=="FIRST"){K="0";B=H;I="1"}else{if(E=="PREVIOUS"){if(I>1){K=K-parseInt(H,10);B=B-parseInt(H,10);I=I-1}}else{if(E=="NEXT"){if(I<J){K=K+parseInt(H,10);B=B+parseInt(H,10);I=I+1}}else{if(E=="LAST"){K=parseInt(H,10)*(parseInt(J,10)-1);B=parseInt(H,10)*parseInt(J,10);I=J}}}}document.cityHotelListPaginationForm.iFromCount.value=K;document.cityHotelListPaginationForm.iToCount.value=B;document.getElementById("pageCounter").innerHTML=I;var A="GET";var G=true;URL=D+"/pages/service/hotel/list/cityhotellistpagination.jsp?BIZ_ACTION_MODE=GET_HOTEL_LIST_PAGINATION&iFromCount="+K+"&iToCount="+B+"&hotelcountry="+document.getElementById("hotelcountry").value+"&hotelcity="+document.getElementById("hotelcity").value+"&actiontype="+document.getElementById("actiontype").value+"&nextpagetype="+document.getElementById("nextpagetype").value+"&hoteldesc="+document.getElementById("hoteldesc").value;try{if(xmlHttp!=null){try{xmlHttp.abort()}catch(F){}}xmlHttp=GetXmlHttpObject();if(xmlHttp){xmlHttp.open(A,URL,G);xmlHttp.onreadystatechange=populateAjaxDataDiv;xmlHttp.send(null)}}catch(F){}}function populateAjaxDataDiv(){try{if(xmlHttp.readyState==4&&xmlHttp.status==200){var A=document.getElementById("ajaxDataDiv");A.innerHTML=xmlHttp.responseText}}catch(B){}}function getmorepackages(){document.frmcountrypackages.submit()}function loadpackage(C,A,F,E,B){var D=B+"package/"+A+"/"+F+"/"+C+"/"+E+"/";document.frmcountrypackages.action=D;document.frmcountrypackages.submit()}function getPackageCities(D){var B=document.getElementById("selectpackagecountry").value;var A=document.getElementById("clientId").value;var E=document.getElementById("selectpackagecity");E.options.length=0;E.options[0]=new Option("Choose a City","Choose a City");bizActionMode="GET_PACKAGE_CITY_ALL";var F="POST";var C=true;xmlHttp=GetXmlHttpObject();document.frmcountrypackages.clientId.value=A;if(xmlHttp==null){alert(ajaxmessage)}else{action="bookingreview.ajax";paramString="BIZ_ACTION_MODE="+bizActionMode+"&packagecountry="+B+"&clientId="+A;ConnectServer(action,F,C,paramString)}}function processResponse(){try{if(xmlHttp.readyState==4){if(xmlHttp.status==200){if("GET_PACKAGE_CITY_ALL"==bizActionMode){populate_package_city_list(xmlHttp.responseText)}else{if("GET_DEAL_CITY_ALL"==bizActionMode){populate_deals_city_list(xmlHttp.responseText)}}}}}catch(A){alert("ERORR!!!!  ::: "+A)}}function populate_package_city_list(B){var D=B.parseJSON();var C=document.getElementById("selectpackagecity");var A=0;if(C!=null){for(i=0;i<D.length;i++){SCity_name=D[A].city;SCity_code=D[A].cityCode;A++;C.options[A]=new Option(SCity_name,SCity_name+"-"+SCity_code)}}}function getMorePackages(B){var A=document.getElementById("selectpackagecountry").value;var C=document.getElementById("selectpackagecity").value;if(A=="Choose a Country"){alert("Select a Country in Featured Packages")}else{if(C==""||C==null||C=="Choose a City"){document.frmcountrypackages.packagecountry.value=A;document.frmcountrypackages.packagecountryName.value=A.substring(0,A.lastIndexOf("-"));document.frmcountrypackages.packagecityName.value="ALL";document.frmcountrypackages.BIZ_ACTION_MODE.value="GET_MORE_PACKAGES";document.frmcountrypackages.action=B+"countrycityhotellisting.do"}else{document.frmcountrypackages.packagecountry.value=A;document.frmcountrypackages.packagecountryName.value=A.substring(0,A.lastIndexOf("-"));document.frmcountrypackages.packagecity.value=C;document.frmcountrypackages.packagecityName.value=C.substring(0,C.lastIndexOf("-"));document.frmcountrypackages.BIZ_ACTION_MODE.value="GET_MORE_PACKAGES";document.frmcountrypackages.action=B+"countrycityhotellisting.do"}document.frmcountrypackages.submit()}}function loadDeals(){var B=document.getElementById("selectdealcountry").value;var A=document.getElementById("selectdealcity").value;if(A=="Choose a City"){A="ALL"}document.frmcountrydeals.dealcountry.value=B;document.frmcountrydeals.dealcity.value=A;document.frmcountrydeals.action="main.do?BIZ_ACTION_MODE=SEARCHDEALS";if(B=="Choose a Country"){alert("Select a Country to Search Deals")}else{document.frmcountrydeals.submit()}}function doPaginationDeals(E,C,H,J,D){var K=parseInt(document.cityHotelDealsListPaginationForm.iFromCount.value,10);var B=parseInt(document.cityHotelDealsListPaginationForm.iToCount.value,10);var I=parseInt(document.getElementById("pageCountertop").innerHTML,10);if(E=="FIRST"){K="0";B=H;I="1"}else{if(E=="PREVIOUS"){if(I>1){K=K-parseInt(H,10);B=B-parseInt(H,10);I=I-1}}else{if(E=="NEXT"){if(I<J){K=K+parseInt(H,10);B=B+parseInt(H,10);I=I+1}}else{if(E=="LAST"){K=parseInt(H,10)*(parseInt(J,10)-1);B=parseInt(H,10)*parseInt(J,10);I=J}}}}document.cityHotelDealsListPaginationForm.iFromCount.value=K;document.cityHotelDealsListPaginationForm.iToCount.value=B;document.getElementById("pageCountertop").innerHTML=I;document.getElementById("pageCounterbottom").innerHTML=I;var A="GET";var G=true;URL=D+"/pages/service/hotel/list/dealshotellistpagination.jsp?BIZ_ACTION_MODE=GET_HOTEL_DEALS_LIST_PAGINATION&iFromCount="+K+"&iToCount="+B+"&hotelcountry="+document.getElementById("hotelcountry").value+"&hotelcity="+document.getElementById("hotelcity").value+"&actiontype="+document.getElementById("actiontype").value+"&nextpagetype="+document.getElementById("nextpagetype").value+"&hoteldesc="+document.getElementById("hoteldesc").value;try{if(xmlHttp!=null){try{xmlHttp.abort()}catch(F){}}xmlHttp=GetXmlHttpObject();if(xmlHttp){xmlHttp.open(A,URL,G);xmlHttp.onreadystatechange=populateAjaxDataDiv;xmlHttp.send(null)}}catch(F){}}function populate_deals_city_list(B){var D=B.parseJSON();var C=document.getElementById("selectdealcity");var A=0;if(C!=null){for(i=0;i<D.length;i++){SCity_name=D[A].city;SCity_code=D[A].cityCode;A++;C.options[A]=new Option(SCity_name,SCity_name+"-"+SCity_code)}}}function getDealCities(D){var B=document.getElementById("selectdealcountry").value;var A=document.getElementById("clientId").value;var E=document.getElementById("selectdealcity");E.options.length=0;E.options[0]=new Option("Choose a City","Choose a City");bizActionMode="GET_DEAL_CITY_ALL";var F="POST";var C=true;xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert(ajaxmessage)}else{action="bookingreview.ajax";paramString="BIZ_ACTION_MODE="+bizActionMode+"&dealcountry="+B+"&clientId="+A;ConnectServer(action,F,C,paramString)}}function loaddeals(C,A,F,E,B){var D=B+"hotel/"+A+"/"+F+"/"+C+"/"+E+"/";document.frmcountrydeals.action=D;document.frmcountrydeals.submit()};
