
function submitCheckAvailability()
{$(document).ready(function()
{$.blockUI({message:'<div style="padding: 5px;"><strong><img src="/application/media/booking/busy.gif" /> Please wait...</strong></div>'});$("#<%=FORM_NAME%>").submit();});};function cascadeDDL(granu,sel)
{if(granu=='hotel')
{var valueArray=(sel.value).split(",");document.getElementById("SelectCity_<%=FORM_NAME%>").value=valueArray[1]+","+valueArray[2];document.getElementById("SelectCountry_<%=FORM_NAME%>").value=valueArray[2];}
else if(granu=='city')
{var valueArray=(sel.value).split(",");document.getElementById("SelectCountry_<%=FORM_NAME%>").value=valueArray[1];var hotelSel=document.getElementById("SelectHotel_<%=FORM_NAME%>");for(var i=0;i<hotelSel.options.length;i++)
{if(hotelSel.options[i].value.match(valueArray[1])!="")
{}}}}
$(document).ready(function()
{$("#oneDDLfield_CheckAvailabilityForm").hide();$("#searchfield_CheckAvailabilityForm").show();$("#threeDDLfields_CheckAvailabilityForm").hide();$("#SearchOrList_CheckAvailabilityForm").val("Search");$("#checkjs_CheckAvailabilityForm").attr("value","F122");$("#noOfNights").text("<%=daysOffset%>");updateNumberOfNights("","");var d1="#SelectCountry_CheckAvailabilityForm";var d2="#SelectCity_CheckAvailabilityForm";var d3="#SelectHotel_CheckAvailabilityForm";var CountryDDL=$(d1).html();var defCountryDDL=$(d1+" > option").eq(0).clone();var CityDDL=$(d2).html();var defCityDDL=$(d2+" > option").eq(0).clone();var HotelDDL=$(d3).html();var defHotelDDL=$(d3+" > option").eq(0).clone();$(d3).attr('onchange','').unbind('change',cascadeDDL).bind('change',function()
{if(this.value!="")
{var hotel=this.value;var country=this.value.split(",")[2];var city=this.value.split(",")[1];$(d3).html(HotelDDL);$(d2).html(CityDDL);$(d2+" > option:not([value*="+country+"])").remove();$(d2).prepend(defCityDDL);$(d3+" > option:not([value*="+city+"])").remove();$(d3).prepend(defHotelDDL);$(d3+" > option:[value="+hotel+"]").attr('selected',true);$(d2+" > option:[value*="+city+"]").attr('selected',true);$(d1+" > option:[value*="+country+"]").attr('selected',true);}});$(d2).attr('onchange','').unbind('change',cascadeDDL).bind('change',function()
{var country=this.value.split(",")[1];var city=this.value.split(",")[0];$(d3).html(HotelDDL);if(this.value!="")
{$(d1).html(CountryDDL);$(d2+" > option:not([value$="+country+"])").remove();$(d2).prepend(defCityDDL);}
$(d3+" > option:not([value*="+city+"])").remove();if(this.value!="")$(d3).prepend(defHotelDDL);if($(d3+" > option").length==2)$(d3+" > option").eq(1).attr('selected',true);else $(d3+" > option").eq(0).attr('selected',true);if(country)
if(country.length>0)
$(d1+" > option:[value*="+country+"]").attr('selected',true);});$(d1).attr('onchange','').unbind('change',cascadeDDL).bind('change',function()
{var country=this.value;$(d3).html(HotelDDL);$(d2).html(CityDDL);$(d2+" > option:not([value*="+country+"])").remove();$(d2).prepend(defCityDDL);$(d2+" > option").eq(0).attr('selected',true);});});