function ShowDateicker(){$(window).scrollTop(0);$("[id$='txtinDateShow']").focus();return}function valid(n,t){window.event&&(t=window.event);(t.which||t.keyCode)&&(t.which==13||t.keyCode==13)&&CheckDates(!0)}function DatePickerMouseOver(n,t,i){var f,r,u;$("#txtinDateShow").val()!=""&&(r="",f=new Date(localStorage.CallFrom=="IN"?new Date(i,t,n):$("#txtinDateShow").val()),r=new Date(localStorage.CallFrom=="OUT"?new Date(i,t,n):$("#txtoutDateShow").val()),u=dateOvered(f,r),u!=""&&$(".dateSummary").html(u))}function dateOvered(n,t){var r="",u,i;if(n&&t)return u=t.getTime()-n.getTime(),i=u/864e5,i>0&&(localStorage.DiifDays=i,r="from <b>"+n.format("ddd, dd MMM")+"<\/b> to <b>"+t.format("ddd, dd MMM yyyy")+"<\/b> ("+i+(i>1?"-nights stay":"-night stay")+")"),r}function FCheckAllChildAges(){var u,i,n,r,t,f;if($("#FddlRooms").val()=="5"){u=$("#FddlRoomsNew").val();i=!0;n:for(n=1;n<=u;n++)if(r=$("#FddlChilds_"+n).val(),r>0)for(t=1;t<=r;t++)if($("#FddlChildAge_"+n+"_"+t).val()>=0)$("#FtdChildAge_"+n+"_"+t).css("display","none"),$("#dvMsgF").css("display","none"),$("#FErrorMsg").html("");else{f=n;$("#FtdChildAge_"+n+"_"+t).css("display","block");$("[id$='dvMsgF']").css("display","block");$("#dvCityMsgF").css("display","none");$("#FErrorMsg").html("Please enter the age of each child");i=!1;break n}return i==!0?!0:!1}return!0}function FGetFinalURLtoGo(n){var o="",ft="",ct="",d=0,lt="",g=!1,wt=window.location.search,bt=decodeURIComponent(wt.substring(1)),at=bt.split("&"),st=null,ht=[],p="",et,l,i,b,t,nt,u,r,s,k,c,rt,h,kt,pt;for($(window).width()>500?$("[id$='ulCurrency']").each(function(){$(this).find("a").each(function(){if($(this).hasClass("CurActive")){var n=$(this).attr("id");p=n.replace("Cura","")}})}):$("[id$='licurrency']").each(function(){$(this).find("a").each(function(){if($(this).hasClass("CurActive")){var n=$(this).attr("id");p=n.replace("Cura","")}})}),et=0;et<at.length;et++)st=at[et].split("="),ht[st[0]]=st[1];if(ht.AffID!=null&&(ct="&AffID="+ht.AffID),$("#dvMsgF").css("display","none"),$("#dvCityMsgF").css("display","none"),l=$("#FddlRoomsNew").val(),d=parseInt($("#FddlAdults").val()),i=$("#FddlChildren").val(),ft="&no_rooms="+l,b="",i>0)for(t=0;t<=i;t++)$("#FddlChildAge_"+t).val()>=0&&(b+=$("#FddlChildAge_"+t).val()+",",lt+="&age="+$("#FddlChildAge_"+t).val());if(ft+="&group_adults="+d+"&group_children="+i+lt,parseInt(l)>1&&parseInt(l)<=parseInt(d)){o="&roomscount="+l;var vt=0,w=0,dt=i,ot=b.substring(0,b.length-1).split(",");for(t=0;t<parseInt(l);t++)if(parseInt(l)==t+1)if(nt=parseInt(d)-vt,o+="&rooms["+t+"].adultsCount="+nt+"",parseInt(i)>0&&w!=i&&parseInt(l)<parseInt(i)){for(u=parseInt(i)-w,r="",s=0;s<u;s++)r+=ot.splice(0,1)+",";o+="&rooms["+t+"].childrenCount="+u+"&rooms["+t+"].childAges="+r.substring(0,r.length-1)}else if(parseInt(i)>0&&w!=i){for(u=parseInt(i),w+=u,r="",s=0;s<u;s++)r+=ot.splice(0,1)+",";o+="&rooms["+t+"].childrenCount="+u+"&rooms["+t+"].childAges="+r.substring(0,r.length-1)}else o+="&rooms["+t+"].childrenCount=0";else if(nt=parseInt(parseInt(d)/parseInt(l)),vt+=nt,o+="&rooms["+t+"].adultsCount="+nt+"",parseInt(i)>0&&w!=i&&parseInt(l)<parseInt(i)){for(u=parseInt(parseInt(i)/parseInt(l)),w+=u,r="",s=0;s<u;s++)r+=ot.splice(0,1)+",";o+="&rooms["+t+"].childrenCount="+u+"&rooms["+t+"].childAges="+r.substring(0,r.length-1)}else if(parseInt(i)>0&&w!=i){for(u=parseInt(i),w+=u,r="",s=0;s<u;s++)r+=ot.splice(0,1)+",";o+="&rooms["+t+"].childrenCount="+u+"&rooms["+t+"].childAges="+r.substring(0,r.length-1)}else o+="&rooms["+t+"].childrenCount=0"}else o="&roomscount=1&rooms[0].adultsCount="+d+"&rooms[0].childrenCount="+i+(b!=""?"&rooms[0].childAges="+b.substring(0,b.length-1):"");$("[id$='chkDates']").is(":checked")&&(k=new Date,k.setDate(k.getDate()+30),$("[id$='txtinDateShow']").val(k.format("ddd, dd MMM yyyy")),k.setDate(k.getDate()+1),$("[id$='txtoutDateShow']").val(k.format("ddd, dd MMM yyyy")));var yt=new Date,v=$("#txtinDateShow").val()!=""?new Date($("#txtinDateShow").val()):(g=!0,new Date((new Date).setDate(yt.getDate()+30))),f=v.format("yyyy/MM/dd"),y=$("#txtoutDateShow").val()!=""?new Date($("#txtoutDateShow").val()):(g=!0,new Date((new Date).setDate(yt.getDate()+31))),e=y.format("yyyy/MM/dd"),a="",tt="",it="",ut="";if($("[id$='hdnAffCategory']").length>0&&(ut=$("[id$='hdnAffCategory']").val()),$("#c_searchcategory :checked").each(function(){it+=$(this).val()+",";ut+=$(this)[0].className!=null?$(this)[0].className:""}),$("#c_searchrating :checked").each(function(){tt+=$(this).val()+",";ut+=$(this)[0].className!=null?$(this)[0].className:""}),it!=""&&tt!=""?a="&flt=||"+tt.replace(/,\s*$/,"")+"||"+it.replace(/,\s*$/,"")+"||":it!=""&&tt==""?a="&flt=||||"+it.replace(/,\s*$/,"")+"||":it==""&&tt!=""&&(a="&flt=||"+tt.replace(/,\s*$/,"")+"||||"),$("[id$='dvShowCategory']").css("display")=="block"&&$("[id$='rbtnCategory']").is(":checked")&&(a=($("[id$='hdnCategory']").val().toLowerCase().indexOf("-street")!=-1?"&flt=|||||"+$("[id$='hdnCategory']").val().toLowerCase().replace("-street","")+"|":$("[id$='hdnCategory']").val().toLowerCase().indexOf(" star")!=-1?"&flt=||"+$("[id$='hdnCategory']").val().toLowerCase()+"||||":$("[id$='hdnSuburbCat']").val()!=null?"&flt=|||"+$("[id$='hdnSuburbCat']").val()+"|"+$("[id$='hdnCategory']").val()+"||":"&flt=||||"+$("[id$='hdnCategory']").val()+"||")+("&categorytitle="+$("[id$='hdnCategoryTitle']").val())),$("[id$='hdnBrand']").length>0&&$("[id$='rbtnBrand']").is(":checked")&&(a=a!=""?a+"|"+$("[id$='rbtnBrand']").val():"&flt=|||||||"+$("[id$='hdnBrand']").val()),$("[id$='hdnSuburb']").length>0&&(a=$("[id$='hdnCategory']").length>0?"&flt=|||"+$("[id$='hdnSuburb']").val()+"|"+$("[id$='hdnCategory']").val()+"||":"&flt=|||"+$("[id$='hdnSuburb']").val()+"|||"),o+=a,o+=ct,window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.host),c=n==!0?$("[id$='FCity']").val():"",($("[id$='hdnAffUrl']").val()!=""||$("[id$='hdnCityUrl']").val()!="")&&c.indexOf(",")!=-1){rt="";$("[id$='hdnCityUrl']").val($("[id$='hdnCityUrl']").val().replace("HotelID","hotelid").replace("cby","Cby"));rt=c.indexOf(", Country")!=-1||c.indexOf(", street")!=-1||c.indexOf(", Regions")!=-1?$("[id$='hdnCityUrl']").val():$("[id$='hdnAffUrl']").val().indexOf("http://www1.hotel.com.au")!=-1&&ut!=""?$("[id$='hdnAffUrl']").val()+(g==!1?"&checkin_monthday="+v.format("dd")+"&checkin_year_month="+v.format("yyyy-MM")+"&checkout_monthday="+y.format("dd")+"&checkout_year_month="+y.format("yyyy-MM"):"")+ft+"&nflt="+ut.replace("=","%3D").replace(";","%3B")+($("[id$='hdnWom']").val()!=""?"&label="+$("[id$='hdnWom']").val():"")+"&lang=en-gb&selected_currency="+p:$("[id$='hdnAffUrl']").val().indexOf("http://www1.hotel.com.au/")!=-1&&a==""?$("[id$='hdnAffUrl']").val()+(g==!1?"&checkin_monthday="+v.format("dd")+"&checkin_year_month="+v.format("yyyy-MM")+"&checkout_monthday="+y.format("dd")+"&checkout_year_month="+y.format("yyyy-MM"):"")+ft+($("[id$='hdnWom']").val()!=""?"&label="+$("[id$='hdnWom']").val():"")+"&lang=en-gb&selected_currency="+p:$("[id$='hdnCityUrl']").val().toLowerCase().indexOf("hotelsin")!=-1?($("[id$='hdnCityUrl']").val()!=""&&$("[id$='hdnCityUrl']").val()!=undefined&&$("[id$='hdnCityUrl']").val()!="undefined"?$("[id$='hdnCityUrl']").val():$("[id$='hdnAffUrl']").val())+(g==!1?"&Checkin="+f+"&Checkout="+e:"")+"&Currency="+p+o:($("[id$='hdnCityUrl']").val()!=""&&$("[id$='hdnCityUrl']").val()!=undefined&&$("[id$='hdnCityUrl']").val()!="undefined"?$("[id$='hdnCityUrl']").val():$("[id$='hdnAffUrl']").val())+(g==!1?"&Checkin="+f+"&Checkout="+e:"")+o;OpenPartnerSite(c,f,e);$("#FbtnGo").val("Processing...");SaveSearchTerms(rt,f,e);return}if($("#hdnLatitude").val()!=null&&$("#hdnLongitude").val()!=""&&c=="")rt="/accommodation/Hotelsin.htm?City=MyLocation&latitude="+$("#hdnLatitude").val()+"&longitude="+$("#hdnLongitude").val()+"&Checkin="+f+"&Checkout="+e+"&Currency="+p+o,OpenPartnerSite(c,f,e),$("#FbtnGo").val("Processing..."),SaveSearchTerms(rt,f,e);else{if(h=c.toLowerCase(),h.replace("australia","").trim()=="victoria"||h.replace("australia","").trim()=="vic"){SaveSearchTerms("../Australia/Victoria.htm",f,e);return}if(h.replace("australia","").trim()=="new south wales"||h.replace("australia","").trim()=="nsw"){SaveSearchTerms("../Australia/New-South-Wales.htm",f,e);return}if(h.replace("australia","").trim()=="tasmania"||h.replace("australia","").trim()=="tas"){SaveSearchTerms("../Australia/Tasmania.htm",f,e);return}if(h.trim()=="western australia"||h.replace("australia","").trim()=="wa"){SaveSearchTerms("../Australia/Western-Australia.htm",f,e);return}if(h.replace("australia","").trim()=="queensland"||h.replace("australia","").trim()=="qld"){SaveSearchTerms("../Australia/Queensland.htm",f,e);return}if(h.replace("australia","").trim()=="northern territory"||h.replace("australia","").trim()=="nt"){SaveSearchTerms("../Australia/Northern-Territory.htm",f,e);return}if(h.trim()=="australian capital terrioty"||h.replace("australia","").trim()=="act"){SaveSearchTerms("../Australia/Australian-Capital.htm",f,e);return}OpenPartnerSite(c,f,e);kt=c.replace("Search more options for ","");pt=$("#hdnUrlSearch").val().replace("AAAAAAAA",$("#FCity").val().replace(/[^a-zA-Z0-9 - ’ ' ]/g,"")).replace("?type=","?type=searchterm");$.ajax({type:"GET",crossDomain:!0,url:pt,contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){if(n!=null&&n!=""){var s="",t="",i="",r="",u="";$("[id$='hdnAffCategory']").length>0&&(u=$("[id$='hdnAffCategory']").val());$("#c_searchcategory :checked").each(function(){r+=$(this).val()+",";u+=$(this)[0].className!=null?$(this)[0].className:""});$("#c_searchrating :checked").each(function(){i+=$(this).val()+",";u+=$(this)[0].className!=null?$(this)[0].className:""});r!=""&&i!=""?t="&flt=||"+i.replace(/,\s*$/,"")+"||"+r.replace(/,\s*$/,"")+"||":r!=""&&i==""?t="&flt=||||"+r.replace(/,\s*$/,"")+"||":r==""&&i!=""&&(t="&flt=||"+i.replace(/,\s*$/,"")+"||||");$("[id$='dvShowCategory']").css("display")=="block"&&$("[id$='rbtnCategory']").is(":checked")&&(t=($("[id$='hdnCategory']").val().toLowerCase().indexOf("star")!=-1?"&flt=||"+$("[id$='hdnCategory']").val().toLowerCase().replace(" star","")+"||||":$("[id$='hdnCategory']").val().toLowerCase().indexOf("-street")!=-1?"&flt=|||||"+$("[id$='hdnCategory']").val().toLowerCase().replace("-street","")+"|":"&flt=||||"+$("[id$='hdnCategory']").val()+"||")+("&categorytitle="+$("[id$='hdnCategoryTitle']").val()));$("[id$='hdnBrand']").length>0&&$("[id$='rbtnBrand']").is(":checked")&&(t=t!=""?t+"|"+$("[id$='rbtnBrand']").val():"&flt=|||||||"+$("[id$='hdnBrand']").val());s=n.SearchResult[0].AffUrl!=null&&n.SearchResult[0].AffUrl.indexOf("http://www1.hotel.com.au/searchresults.html")!=-1&&u!=""?n.SearchResult[0].AffUrl+"&checkin_monthday="+v.format("dd")+"&checkin_year_month="+v.format("yyyy-MM")+"&checkout_monthday="+y.format("dd")+"&checkout_year_month="+y.format("yyyy-MM")+"&nflt="+u.replace("=","%3D").replace(";","%3B")+($("[id$='hdnWom']").val()!=null?"&label="+$("[id$='hdnWom']").val():"")+"&lang=en-gb&selected_currency="+p:n.SearchResult[0].AffUrl!=null&&n.SearchResult[0].AffUrl.indexOf("http://www1.hotel.com.au/searchresults.html")!=-1&&t==""?n.SearchResult[0].AffUrl+"&checkin_monthday="+v.format("dd")+"&checkin_year_month="+v.format("yyyy-MM")+"&checkout_monthday="+y.format("dd")+"&checkout_year_month="+y.format("yyyy-MM")+($("[id$='hdnWom']").val()!=null?"&label="+$("[id$='hdnWom']").val():"")+"&lang=en-gb&selected_currency="+p:window.location.origin+n.SearchResult[0].Url.replace("PageNameURL","/Searchresult.htm")+"&CheckIn="+f+"&CheckOut="+e+o;$("#FbtnGo").val("Processing...");SaveSearchTerms(s,f,e)}else alert("Upps error! please try again or reload the page.")},error:function(){}})}}function FGetFinalURLtoGo_1(n){var o="",ft="",ct="",d=0,lt="",g=!1,wt=window.location.search,bt=decodeURIComponent(wt.substring(1)),at=bt.split("&"),st=null,ht=[],p="",et,l,i,b,t,nt,u,r,s,k,c,rt,h,kt,pt;for($(window).width()>500?$("[id$='ulCurrency']").each(function(){$(this).find("a").each(function(){if($(this).hasClass("CurActive")){var n=$(this).attr("id");p=n.replace("Cura","")}})}):$("[id$='licurrency']").each(function(){$(this).find("a").each(function(){if($(this).hasClass("CurActive")){var n=$(this).attr("id");p=n.replace("Cura","")}})}),et=0;et<at.length;et++)st=at[et].split("="),ht[st[0]]=st[1];if(ht.AffID!=null&&(ct="&AffID="+ht.AffID),$("#dvMsgF").css("display","none"),$("#dvCityMsgF").css("display","none"),l=$("#FddlRoomsNew_1").val(),d=parseInt($("#FddlAdults_1").val()),i=$("#FddlChildren_1").val(),ft="&no_rooms="+l,b="",i>0)for(t=0;t<=i;t++)$("#FddlChildAge_"+t).val()>=0&&(b+=$("#FddlChildAge_"+t).val()+",",lt+="&age="+$("#FddlChildAge_"+t).val());if(ft+="&group_adults="+d+"&group_children="+i+lt,parseInt(l)>1&&parseInt(l)<=parseInt(d)){o="&roomscount="+l;var vt=0,w=0,dt=i,ot=b.substring(0,b.length-1).split(",");for(t=0;t<parseInt(l);t++)if(parseInt(l)==t+1)if(nt=parseInt(d)-vt,o+="&rooms["+t+"].adultsCount="+nt+"",parseInt(i)>0&&w!=i&&parseInt(l)<parseInt(i)){for(u=parseInt(i)-w,r="",s=0;s<u;s++)r+=ot.splice(0,1)+",";o+="&rooms["+t+"].childrenCount="+u+"&rooms["+t+"].childAges="+r.substring(0,r.length-1)}else if(parseInt(i)>0&&w!=i){for(u=parseInt(i),w+=u,r="",s=0;s<u;s++)r+=ot.splice(0,1)+",";o+="&rooms["+t+"].childrenCount="+u+"&rooms["+t+"].childAges="+r.substring(0,r.length-1)}else o+="&rooms["+t+"].childrenCount=0";else if(nt=parseInt(parseInt(d)/parseInt(l)),vt+=nt,o+="&rooms["+t+"].adultsCount="+nt+"",parseInt(i)>0&&w!=i&&parseInt(l)<parseInt(i)){for(u=parseInt(parseInt(i)/parseInt(l)),w+=u,r="",s=0;s<u;s++)r+=ot.splice(0,1)+",";o+="&rooms["+t+"].childrenCount="+u+"&rooms["+t+"].childAges="+r.substring(0,r.length-1)}else if(parseInt(i)>0&&w!=i){for(u=parseInt(i),w+=u,r="",s=0;s<u;s++)r+=ot.splice(0,1)+",";o+="&rooms["+t+"].childrenCount="+u+"&rooms["+t+"].childAges="+r.substring(0,r.length-1)}else o+="&rooms["+t+"].childrenCount=0"}else o="&roomscount=1&rooms[0].adultsCount="+d+"&rooms[0].childrenCount="+i+(b!=""?"&rooms[0].childAges="+b.substring(0,b.length-1):"");$("[id$='chkDates']").is(":checked")&&(k=new Date,k.setDate(k.getDate()+30),$("[id$='txtinDateShow']").val(k.format("ddd, dd MMM yyyy")),k.setDate(k.getDate()+1),$("[id$='txtoutDateShow']").val(k.format("ddd, dd MMM yyyy")));var yt=new Date,v=$("#txtinDateShow").val()!=""?new Date($("#txtinDateShow").val()):(g=!0,new Date((new Date).setDate(yt.getDate()+30))),f=v.format("yyyy/MM/dd"),y=$("#txtoutDateShow").val()!=""?new Date($("#txtoutDateShow").val()):(g=!0,new Date((new Date).setDate(yt.getDate()+31))),e=y.format("yyyy/MM/dd"),a="",tt="",it="",ut="";if($("[id$='hdnAffCategory']").length>0&&(ut=$("[id$='hdnAffCategory']").val()),$("#c_searchcategory :checked").each(function(){it+=$(this).val()+",";ut+=$(this)[0].className!=null?$(this)[0].className:""}),$("#c_searchrating :checked").each(function(){tt+=$(this).val()+",";ut+=$(this)[0].className!=null?$(this)[0].className:""}),it!=""&&tt!=""?a="&flt=||"+tt.replace(/,\s*$/,"")+"||"+it.replace(/,\s*$/,"")+"||":it!=""&&tt==""?a="&flt=||||"+it.replace(/,\s*$/,"")+"||":it==""&&tt!=""&&(a="&flt=||"+tt.replace(/,\s*$/,"")+"||||"),$("[id$='dvShowCategory']").css("display")=="block"&&$("[id$='rbtnCategory']").is(":checked")&&(a=($("[id$='hdnCategory']").val().toLowerCase().indexOf("-street")!=-1?"&flt=|||||"+$("[id$='hdnCategory']").val().toLowerCase().replace("-street","")+"|":$("[id$='hdnCategory']").val().toLowerCase().indexOf(" star")!=-1?"&flt=||"+$("[id$='hdnCategory']").val().toLowerCase()+"||||":$("[id$='hdnSuburbCat']").val()!=null?"&flt=|||"+$("[id$='hdnSuburbCat']").val()+"|"+$("[id$='hdnCategory']").val()+"||":"&flt=||||"+$("[id$='hdnCategory']").val()+"||")+("&categorytitle="+$("[id$='hdnCategoryTitle']").val())),$("[id$='hdnBrand']").length>0&&$("[id$='rbtnBrand']").is(":checked")&&(a=a!=""?a+"|"+$("[id$='rbtnBrand']").val():"&flt=|||||||"+$("[id$='hdnBrand']").val()),$("[id$='hdnSuburb']").length>0&&(a=$("[id$='hdnCategory']").length>0?"&flt=|||"+$("[id$='hdnSuburb']").val()+"|"+$("[id$='hdnCategory']").val()+"||":"&flt=|||"+$("[id$='hdnSuburb']").val()+"|||"),o+=a,o+=ct,window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.host),c=n==!0?$("[id$='FCity']").val():"",($("[id$='hdnAffUrl']").val()!=""||$("[id$='hdnCityUrl']").val()!="")&&c.indexOf(",")!=-1){rt="";$("[id$='hdnCityUrl']").val($("[id$='hdnCityUrl']").val().replace("HotelID","hotelid").replace("cby","Cby"));rt=c.indexOf(", Country")!=-1||c.indexOf(", street")!=-1||c.indexOf(", Regions")!=-1?$("[id$='hdnCityUrl']").val():$("[id$='hdnAffUrl']").val().indexOf("http://www1.hotel.com.au")!=-1&&ut!=""?$("[id$='hdnAffUrl']").val()+(g==!1?"&checkin_monthday="+v.format("dd")+"&checkin_year_month="+v.format("yyyy-MM")+"&checkout_monthday="+y.format("dd")+"&checkout_year_month="+y.format("yyyy-MM"):"")+ft+"&nflt="+ut.replace("=","%3D").replace(";","%3B")+($("[id$='hdnWom']").val()!=""?"&label="+$("[id$='hdnWom']").val():"")+"&lang=en-gb&selected_currency="+p:$("[id$='hdnAffUrl']").val().indexOf("http://www1.hotel.com.au/")!=-1&&a==""?$("[id$='hdnAffUrl']").val()+(g==!1?"&checkin_monthday="+v.format("dd")+"&checkin_year_month="+v.format("yyyy-MM")+"&checkout_monthday="+y.format("dd")+"&checkout_year_month="+y.format("yyyy-MM"):"")+ft+($("[id$='hdnWom']").val()!=""?"&label="+$("[id$='hdnWom']").val():"")+"&lang=en-gb&selected_currency="+p:$("[id$='hdnCityUrl']").val().toLowerCase().indexOf("hotelsin")!=-1?($("[id$='hdnCityUrl']").val()!=""&&$("[id$='hdnCityUrl']").val()!=undefined&&$("[id$='hdnCityUrl']").val()!="undefined"?$("[id$='hdnCityUrl']").val():$("[id$='hdnAffUrl']").val())+(g==!1?"&Checkin="+f+"&Checkout="+e:"")+"&Currency="+p+o:($("[id$='hdnCityUrl']").val()!=""&&$("[id$='hdnCityUrl']").val()!=undefined&&$("[id$='hdnCityUrl']").val()!="undefined"?$("[id$='hdnCityUrl']").val():$("[id$='hdnAffUrl']").val())+(g==!1?"&Checkin="+f+"&Checkout="+e:"")+o;OpenPartnerSite(c,f,e);$("#FbtnGo").val("Processing...");SaveSearchTerms(rt,f,e);return}if($("#hdnLatitude").val()!=null&&$("#hdnLongitude").val()!=""&&c=="")rt="/accommodation/Hotelsin.htm?City=MyLocation&latitude="+$("#hdnLatitude").val()+"&longitude="+$("#hdnLongitude").val()+"&Checkin="+f+"&Checkout="+e+"&Currency="+p+o,OpenPartnerSite(c,f,e),$("#FbtnGo").val("Processing..."),SaveSearchTerms(rt,f,e);else{if(h=c.toLowerCase(),h.replace("australia","").trim()=="victoria"||h.replace("australia","").trim()=="vic"){SaveSearchTerms("../Australia/Victoria.htm",f,e);return}if(h.replace("australia","").trim()=="new south wales"||h.replace("australia","").trim()=="nsw"){SaveSearchTerms("../Australia/New-South-Wales.htm",f,e);return}if(h.replace("australia","").trim()=="tasmania"||h.replace("australia","").trim()=="tas"){SaveSearchTerms("../Australia/Tasmania.htm",f,e);return}if(h.trim()=="western australia"||h.replace("australia","").trim()=="wa"){SaveSearchTerms("../Australia/Western-Australia.htm",f,e);return}if(h.replace("australia","").trim()=="queensland"||h.replace("australia","").trim()=="qld"){SaveSearchTerms("../Australia/Queensland.htm",f,e);return}if(h.replace("australia","").trim()=="northern territory"||h.replace("australia","").trim()=="nt"){SaveSearchTerms("../Australia/Northern-Territory.htm",f,e);return}if(h.trim()=="australian capital terrioty"||h.replace("australia","").trim()=="act"){SaveSearchTerms("../Australia/Australian-Capital.htm",f,e);return}OpenPartnerSite(c,f,e);kt=c.replace("Search more options for ","");pt=$("#hdnUrlSearch").val().replace("AAAAAAAA",$("#FCity").val().replace(/[^a-zA-Z0-9 - ’ ' ]/g,"")).replace("?type=","?type=searchterm");$.ajax({type:"GET",crossDomain:!0,url:pt,contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){if(n!=null&&n!=""){var s="",t="",i="",r="",u="";$("[id$='hdnAffCategory']").length>0&&(u=$("[id$='hdnAffCategory']").val());$("#c_searchcategory :checked").each(function(){r+=$(this).val()+",";u+=$(this)[0].className!=null?$(this)[0].className:""});$("#c_searchrating :checked").each(function(){i+=$(this).val()+",";u+=$(this)[0].className!=null?$(this)[0].className:""});r!=""&&i!=""?t="&flt=||"+i.replace(/,\s*$/,"")+"||"+r.replace(/,\s*$/,"")+"||":r!=""&&i==""?t="&flt=||||"+r.replace(/,\s*$/,"")+"||":r==""&&i!=""&&(t="&flt=||"+i.replace(/,\s*$/,"")+"||||");$("[id$='dvShowCategory']").css("display")=="block"&&$("[id$='rbtnCategory']").is(":checked")&&(t=($("[id$='hdnCategory']").val().toLowerCase().indexOf("star")!=-1?"&flt=||"+$("[id$='hdnCategory']").val().toLowerCase().replace(" star","")+"||||":$("[id$='hdnCategory']").val().toLowerCase().indexOf("-street")!=-1?"&flt=|||||"+$("[id$='hdnCategory']").val().toLowerCase().replace("-street","")+"|":"&flt=||||"+$("[id$='hdnCategory']").val()+"||")+("&categorytitle="+$("[id$='hdnCategoryTitle']").val()));$("[id$='hdnBrand']").length>0&&$("[id$='rbtnBrand']").is(":checked")&&(t=t!=""?t+"|"+$("[id$='rbtnBrand']").val():"&flt=|||||||"+$("[id$='hdnBrand']").val());s=n.SearchResult[0].AffUrl!=null&&n.SearchResult[0].AffUrl.indexOf("http://www1.hotel.com.au/searchresults.html")!=-1&&u!=""?n.SearchResult[0].AffUrl+"&checkin_monthday="+v.format("dd")+"&checkin_year_month="+v.format("yyyy-MM")+"&checkout_monthday="+y.format("dd")+"&checkout_year_month="+y.format("yyyy-MM")+"&nflt="+u.replace("=","%3D").replace(";","%3B")+($("[id$='hdnWom']").val()!=null?"&label="+$("[id$='hdnWom']").val():"")+"&lang=en-gb&selected_currency="+p:n.SearchResult[0].AffUrl!=null&&n.SearchResult[0].AffUrl.indexOf("http://www1.hotel.com.au/searchresults.html")!=-1&&t==""?n.SearchResult[0].AffUrl+"&checkin_monthday="+v.format("dd")+"&checkin_year_month="+v.format("yyyy-MM")+"&checkout_monthday="+y.format("dd")+"&checkout_year_month="+y.format("yyyy-MM")+($("[id$='hdnWom']").val()!=null?"&label="+$("[id$='hdnWom']").val():"")+"&lang=en-gb&selected_currency="+p:window.location.origin+n.SearchResult[0].Url.replace("PageNameURL","/Searchresult.htm")+"&CheckIn="+f+"&CheckOut="+e+o;$("#FbtnGo").val("Processing...");SaveSearchTerms(s,f,e)}else alert("Upps error! please try again or reload the page.")},error:function(){}})}}function SaveSearchTerms(n,t,i){$.ajax({url:"/Home/SaveSearchTermAndUrl",data:'{ "SearchTerm": "'+($("[id$='FCity']").is(":visible")?$("[id$='FCity']").val():$("[id$='FHotel']").val())+'","CheckIn": "'+t+'","CheckOut": "'+i+'","Url": "'+escape(n)+'"}',contentType:"application/json; charset=utf-8",type:"POST",dataType:"json"}).done(function(){window.location.href=n})}function FCreateRoomDetail(n){var n=$("#"+n.id).val();FCreate(n)}function FCreate(n){var f=n,i,t,u,r;for($("#FtdDetailContainer").html(""),i=window.location.href.toLowerCase(),i=i.substring(i.length-1)=="/"?i.substring(0,i.length-1):i,t="",u=0;u<=f-1;u++)r=u+1,t+="<div class='room_wrap'>",t+="<div style='color:white;' class='"+(i=="http://m.hotel.com.au/"||i=="http://m.hotel.com.au"||i=="m.hotel.com.au"||i=="https://www.hotel.com.au/default.htm"||i=="https://www.hotel.com.au"||i=="www.hotel.com.au"||i=="http://localhost:10555/default.htm"||i=="http://localhost:10555"||i=="localhost:10555"?"room_num":"room_no")+"'>",t+="Room"+r+"<\/div>",t+="<div class='room_detail'>",t+="<div class='input_box'>",t+="Adults",t+="<br />",t+="<select class='re_select' id='FddlAdults_"+r+"'>",t+="<option value='1'>1<\/option>",t+="<option selected='True' value='2'>2<\/option>",t+="<option value='3'>3<\/option>",t+="<option value='4'>4<\/option>",t+="<\/select>",t+="<\/div>",t+="<div class='input_box'>",t+="Children",t+="<br />",t+="<select class='re_select' id='FddlChilds_"+r+"' onchange='return FShowChildAges(this,"+r+")'>",t+="<option selected='True' value='0'>0<\/option>",t+="<option value='1'>1<\/option>",t+="<option value='2'>2<\/option>",t+="<option value='3'>3<\/option>",t+="<\/select>",t+="<\/div>",t+="<div class='input_box'>",t+="Child 1",t+="<select id='FddlChildAge_"+r+"_1' style='display: block;' disabled='true'>",t+="<option value='-1' selected='True'>age<\/option>",t+="<option value='0'><1<\/option>",t+="<option value='1'>1<\/option>",t+="<option value='2'>2<\/option>",t+="<option value='3'>3<\/option>",t+="<option value='4'>4<\/option>",t+="<option value='5'>5<\/option>",t+="<option value='6'>6<\/option>",t+="<option value='7'>7<\/option>",t+="<option value='8'>8<\/option>",t+="<option value='9'>9<\/option>",t+="<option value='10'>10<\/option>",t+="<option value='11'>11<\/option>",t+="<option value='12'>12<\/option>",t+="<option value='13'>13<\/option>",t+="<option value='14'>14<\/option>",t+="<option value='15'>15<\/option>",t+="<option value='16'>16<\/option>",t+="<option value='17'>17<\/option>",t+="<\/select>",t+="<\/div>",t+="<div class='input_box'>",t+="Child 2",t+="<select id='FddlChildAge_"+r+"_2' style='display: block;' disabled='true'>",t+="<option value='-1' selected='True'>age<\/option>",t+="<option value='0'><1<\/option>",t+="<option value='1'>1<\/option>",t+="<option value='2'>2<\/option>",t+="<option value='3'>3<\/option>",t+="<option value='4'>4<\/option>",t+="<option value='5'>5<\/option>",t+="<option value='6'>6<\/option>",t+="<option value='7'>7<\/option>",t+="<option value='8'>8<\/option>",t+="<option value='9'>9<\/option>",t+="<option value='10'>10<\/option>",t+="<option value='11'>11<\/option>",t+="<option value='12'>12<\/option>",t+="<option value='13'>13<\/option>",t+="<option value='14'>14<\/option>",t+="<option value='15'>15<\/option>",t+="<option value='16'>16<\/option>",t+="<option value='17'>17<\/option>",t+="<\/select>",t+="<\/div>",t+="<div class='input_box'>",t+="Child 3",t+="<select id='FddlChildAge_"+r+"_3' style='display: block;' disabled='true'>",t+="<option value='-1' selected='True'>age<\/option>",t+="<option value='0'><1<\/option>",t+="<option value='1'>1<\/option>",t+="<option value='2'>2<\/option>",t+="<option value='3'>3<\/option>",t+="<option value='4'>4<\/option>",t+="<option value='5'>5<\/option>",t+="<option value='6'>6<\/option>",t+="<option value='7'>7<\/option>",t+="<option value='8'>8<\/option>",t+="<option value='9'>9<\/option>",t+="<option value='10'>10<\/option>",t+="<option value='11'>11<\/option>",t+="<option value='12'>12<\/option>",t+="<option value='13'>13<\/option>",t+="<option value='14'>14<\/option>",t+="<option value='15'>15<\/option>",t+="<option value='16'>16<\/option>",t+="<option value='17'>17<\/option>",t+="<\/select>",t+="<\/div>",t+="<div class='clear'>",t+="<\/div>",t+="<\/div>",t+="<\/div>";t+="<div class='clear'>";t+="<\/div>";$("#FtdDetailContainer").append(t);t=null}function FShowChildAges(){var i=$("#FddlChildren").val(),n,t;if(i>0){for($("#childAge").css("visibility","visible"),$("#childAge").html(""),n="",n="<span class='children_age_label'>Age of children<\/span>",t=0;t<i;t++)n+="<select id='FddlChildAge_"+t+"' class='age_select'>",n+="<option value='12'><\/option>",n+="<option value='0'>0<\/option>",n+="<option value='1'>1<\/option>",n+="<option value='2'>2<\/option>",n+="<option value='3'>3<\/option>",n+="<option value='4'>4<\/option>",n+="<option value='5'>5<\/option>",n+="<option value='6'>6<\/option>",n+="<option value='7' selected>7<\/option>",n+="<option value='8'>8<\/option>",n+="<option value='9'>9<\/option>",n+="<option value='10'>10<\/option>",n+="<option value='11'>11<\/option>",n+="<option value='12'>12<\/option>",n+="<option value='13'>13<\/option>",n+="<option value='14'>14<\/option>",n+="<option value='15'>15<\/option>",n+="<option value='16'>16<\/option>",n+="<option value='17'>17<\/option>",n+="<\/select>";$("#childAge").append(n);n=null}else $("#childAge").html(""),$("#childAge").css("visibility","hidden")}function FShowChildAges_1(){var i=$("#FddlChildren_1").val(),n,t;if(i>0){for($("#childAge_1").css("visibility","visible"),$("#childAge_1").html(""),n="",n="<span class='children_age_label'>Age of children<\/span>",t=0;t<i;t++)n+="<select id='FddlChildAge_"+t+"' class='age_select'>",n+="<option value='12'><\/option>",n+="<option value='0'>0<\/option>",n+="<option value='1'>1<\/option>",n+="<option value='2'>2<\/option>",n+="<option value='3'>3<\/option>",n+="<option value='4'>4<\/option>",n+="<option value='5'>5<\/option>",n+="<option value='6'>6<\/option>",n+="<option value='7' selected>7<\/option>",n+="<option value='8'>8<\/option>",n+="<option value='9'>9<\/option>",n+="<option value='10'>10<\/option>",n+="<option value='11'>11<\/option>",n+="<option value='12'>12<\/option>",n+="<option value='13'>13<\/option>",n+="<option value='14'>14<\/option>",n+="<option value='15'>15<\/option>",n+="<option value='16'>16<\/option>",n+="<option value='17'>17<\/option>",n+="<\/select>";$("#childAge_1").append(n);n=null}else $("#childAge_1").html(""),$("#childAge_1").css("visibility","hidden")}function FGetQueryStringValue(){var l=window.location.search,u,e,i,t;if(l!=""){var v=decodeURIComponent(l.substring(1).toLowerCase()),a=v.split("&"),o=null,n=[];for(t=0;t<a.length;t++)o=a[t].split("="),n[o[0]]=o[1];if(n.CheckIn!=null){var r=new Date,y=r.getMonth().length+1===1?r.getMonth()+1:"0"+(r.getMonth()+1),p=r.getDate().length+1===1?r.getDate()+1:"0"+r.getDate(),w=r.getFullYear()+"/"+y+"/"+p;n.CheckIn<w&&($("[id$='txtinDateShow']").val(""),$("[id$='txtoutDateShow']").val(""),$("[id$='txtinDateShow']").prop("placeholder","Enter Check in"),$("[id$='txtoutDateShow']").prop("placeholder","Enter Check out"))}n.term!=null&&$("[id$='Cityname']").val(decodeURI(n.term));u=0;u=n.roomscount===undefined?1:n.roomscount;$("#FddlRoomsNew").val(u);var s=0,h=0,f="",c="";for(e=1;e<=u;e++)i=e-1,n["rooms["+i+"].adultscount"]!=null&&(s+=parseInt(n["rooms["+i+"].adultscount"])),n["rooms["+i+"].childrencount"]!=null&&n["rooms["+i+"].childrencount"]!="0"&&(h+=parseInt(n["rooms["+i+"].childrencount"]),n["rooms["+i+"].childrencount"]!=null&&n["rooms["+i+"].childrencount"]!="0"&&(f+=n["rooms["+i+"].childages"]+","));if($("#FddlAdults").val(s>0?s:2),$("#FddlChildren").val(h>0?h:0),FShowChildAges(),f!="")for(c=f.substring(0,f.length-1).split(","),t=0;t<c.length;t++)$("#FddlChildAge_"+t).val(c[t])}}function FetchRecentlyViewedHotels(){$.ajax({type:"POST",crossDomain:!0,url:"/accommodation/FetchRecentlyViewedHotels",contentType:"application/json; charset=utf-8",success:function(n){n!=null&&n!=""?$("[id$='dvrecenthotellist']").html(n):($("[id$='dvrecenthotellist']").html("No record found, please reload page again."),$("[id$='dvrecenthotellist']").css("color","red"))},error:function(){$("[id$='dvrecenthotellist']").html("Error! please load page again.")}})}function validateEmail(n){return/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/.test(n)?!0:!1}function validateMultipleEmailsCommaSeparated(){var i=$("[id$='txtEmailHotelList']").val().trim(),t,n;if(i!="")for(t=i.split(","),n=0;n<t.length;n++)if(t[n]!=""&&!validateEmail(t[n]))return $("[id$='spnReviewResultHotelList']").text("Please check, '"+t[n]+"' email addresses not valid."),!1;return!0}function SendRecentlyViewedHotelListmobile(){var i="false",r="",t,n,u;for(i=$("[id$='ChkHotelList']").is(":checked")?"true":"false",t=$("[id$='hdnComments']").val().substring(0,$("[id$='hdnComments']").val().length-1).split("|"),n=0;n<t.length;n++)r+=$("#"+t[n]).val()+"|";$("[id$='spnReviewResultHotelList']").text("");$("[id$='txtEmailHotelList']").val().trim()!=""?(u=new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i),validateMultipleEmailsCommaSeparated($("[id$='txtEmailHotelList']"),",")&&($("[id$='txtRFirstNameHotelList']").val()!=""?grecaptcha.execute():$("[id$='spnReviewResultHotelList']").text("Please enter first name."))):$("[id$='spnReviewResultHotelList']").text("Please enter email.")}function OpenPartnerSite(n,t,i){if($(window).width()>480&&$("[id$='ischk']").is(":checked")){var r="http://compare.hotel.com.au/Search.aspx?search="+n+"&languageCode=EN&Rooms=1&adults_1=2&Checkin="+t+"&Checkout="+i+"&force=1";win2=window.open(r,"","location=0,status=0,menubar=0,scrollbars=1,toolbar=0,,directories=0,width=800,height=600");win2.blur();window.focus()}}function DeleteRecentlyViewedHotels(n,t){$("[id$='dvrecenthotellistpopup']").html("Deleting recently viewed hotel...");$.ajax({type:"POST",crossDomain:!0,url:"/accommodation/DeleteRecentlyViewedHotels",data:'{ "HotelId": "'+n+'", "Cby": "'+t+'" }',contentType:"application/json; charset=utf-8",success:function(n){n!=null&&n!=""?($("[id$='dvrecenthotellistpopup']").html(n),$.ajax({type:"POST",crossDomain:!0,url:"/accommodation/GetRecentlyViewedHotels",contentType:"application/json; charset=utf-8",success:function(n){n!=null&&n!=""?($("[id$='dvourCustomer']").nextAll("div").remove(),$("[id$='dvourCustomer']").after(n)):$("[id$='dvourCustomer']").nextAll("div").remove()},error:function(){$("[id$='dvourCustomer']").nextAll("div").remove()}})):($("[id$='dvrecenthotellistpopup']").html("please load page again to view hotels"),$("[id$='dvourCustomer']").nextAll("div").remove())},error:function(){$("[id$='dvrecenthotellistpopup']").html("Error! please load page again.")}})}function DeleteRecentlyViewedHotelsmobile(n,t){$("[id$='dvrecenthotellist']").html("Deleting recently viewed hotel...");$.ajax({type:"POST",crossDomain:!0,url:"/accommodation/DeleteRecentlyViewedHotelsmobile",data:'{ "HotelId": "'+n+'", "Cby": "'+t+'" }',contentType:"application/json; charset=utf-8",success:function(n){n!=null&&n!=""?($("[id$='dvrecenthotellist']").html(n),$.ajax({type:"POST",crossDomain:!0,url:"/accommodation/GetRecentlyViewedHotels",contentType:"application/json; charset=utf-8",success:function(n){n!=null&&n!=""?($("[id$='dvourCustomer']").nextAll("div").remove(),$("[id$='dvourCustomer']").after(n)):$("[id$='dvourCustomer']").nextAll("div").remove()},error:function(){$("[id$='dvourCustomer']").nextAll("div").remove()}})):($("[id$='dvrecenthotellist']").html("please load page again to view hotels"),$("[id$='dvourCustomer']").nextAll("div").remove())},error:function(){$("[id$='dvrecenthotellist']").html("Error! please load page again.")}})}var cookies=[],onClick;$(document).ready(function(){function n(){var n=$("[id$='txtinDateShow']").datepicker("getDate"),t=$("[id$='txtoutDateShow']").datepicker("getDate"),r,i;if(n&&t)return r=t.getTime()-n.getTime(),i=r/864e5,datediff="from <b>"+n.format("ddd, dd MMM")+"<\/b> to <b>"+t.format("ddd, dd MMM yyyy")+"<\/b> ("+i+(i>1?"-nights stay":"-night stay")+")"}var t="";$("#FCity").autocomplete({source:function(n,i){var r,u;$.browser.msie&&window.XDomainRequest&&parseInt($.browser.version,10)<10?window.XDomainRequest&&(u=$("#hdnUrlSearch").val().replace("AAAAAAAA",$("#FCity").val().replace(/[^a-zA-Z0-9, -]/g,"")),r=new XDomainRequest,r&&(r.onload=function(){var u,e;t=n.term;data=$.parseXML(r.responseText);var f=[],o=data.getElementsByTagName("a:BookingRequest.DetailsSearch"),s=data.getElementsByTagName("a:Name"),h=data.getElementsByTagName("a:Number"),c=data.getElementsByTagName("a:Url"),l=data.getElementsByTagName("a:type"),a=data.getElementsByTagName("a:AffUrl"),v=data.getElementsByTagName("a:City");for(u=0;u<o.length;u++)e={value:s[u].textContent.toString(),URL:c[u].textContent.toString(),Number:h[u].textContent.toString(),Type:l[u].textContent.toString(),AffURL:a[u].textContent.toString(),City:v[u].textContent.toString()},f.push(e);i(f)},r.onerror=function(){},r.open("GET",u),r.send())):(u=$("#hdnUrlSearch").val().replace("AAAAAAAA",$("#FCity").val().replace(/[^a-zA-Z0-9 - ’ ' ]/g," ")),$.ajax({type:"GET",crossDomain:!0,url:u,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t){var u,o,s,e;if(t!=null){var r=t.SearchResult,f=[],h=0;for(u=0;u<r.length;u++)r[u].type=="More"&&r.length==1?($.ajaxSetup({error:function(){var n;n={value:r[0].Name,URL:r[0].Url,Number:r[0].Number,Type:r[0].type,AffURL:r[0].AffUrl,City:r[0].City};f.push(n)}}),e="https://maps.googleapis.com/maps/api/geocode/json?address="+n.term+"&sensor=false&key=AIzaSyBv_LOOcnTkKkc_mDAz6l8D3mjm9k9P4M4",$.getJSON(e,function(n){var t,e,o,u;if(n.results.length>0)for(t=0;t<n.results.length;t++)e=n.results[t].formatted_address,o="http://www1.hotel.com.au/searchresults.html?ss="+e+"&si=ai,co,ci,re,di"+(n.results[0].place_id!=null?"&place_id="+n.results[0].place_id:"")+(n.results[0].geometry.location.lat!=null?"&place_id_lat="+n.results[0].geometry.location.lat:"")+(n.results[0].geometry.location.lng!=null?"&place_id_lon="+n.results[0].geometry.location.lng:"")+"&dest_type="+(n.results[0].types[0]=="locality"?"city":n.results[0].types[0]=="route"?"bus_station":"")+($("[id$='hdnWom']").val()!=null?"&label="+$("[id$='hdnWom']").val():""),u={value:e,URL:o,Number:"",Type:"Google",AffURL:o,Lat:n.results[0].geometry.location.lat,Long:n.results[0].geometry.location.lng},f.push(u);else u={value:r[0].Name,URL:r[0].Url,Number:r[0].Number,Type:r[0].type,AffURL:r[0].AffUrl,City:r[0].City};i(f.length>0?f:cookies)})):(u==0&&(cookies=[]),r[u].type=="City"&&(h=1),o={value:r[u].Name,URL:r[u].Url,Number:r[u].Number,Type:r[u].type,AffURL:r[u].AffUrl,City:r[u].City},f.push(o),cookies.push(o),i(f));h==0&&r.length!=1&&(s=[],e="https://maps.googleapis.com/maps/api/geocode/json?address="+n.term+"&sensor=false&key=AIzaSyBv_LOOcnTkKkc_mDAz6l8D3mjm9k9P4M4",$.getJSON(e,function(n){var t,e,o,u;if(n.results.length>0)for(t=0;t<n.results.length;t++)e=n.results[t].formatted_address,o="http://www1.hotel.com.au/searchresults.html?ss="+e+"&si=ai,co,ci,re,di"+(n.results[0].place_id!=null?"&place_id="+n.results[0].place_id:"")+(n.results[0].geometry.location.lat!=null?"&place_id_lat="+n.results[0].geometry.location.lat:"")+(n.results[0].geometry.location.lng!=null?"&place_id_lon="+n.results[0].geometry.location.lng:"")+"&dest_type="+(n.results[0].types[0]=="locality"?"city":n.results[0].types[0]=="route"?"bus_station":"")+($("[id$='hdnWom']").val()!=null?"&label="+$("[id$='hdnWom']").val():""),u={value:e,URL:o,Number:"",Type:"Google",AffURL:o,Lat:n.results[0].geometry.location.lat,Long:n.results[0].geometry.location.lng},s.push(u);else u={value:r[0].Name,URL:r[0].Url,Number:r[0].Number,Type:r[0].type,AffURL:r[0].AffUrl,City:r[0].City};f=$.merge(s,f);i(f)}))}},error:function(){}}))},matchContains:!0,minChars:0,maxItemsToShow:10,open:function(){$(this).removeClass("wait")},search:function(){$(this).addClass("wait")},minLength:3,select:function(n,t){if(t.item.Type=="More"){var r=$("[id$='txtinDateShow']").val()==""?new Date((new Date).valueOf()+864e5):new Date($("[id$='txtinDateShow']").val()),u=r.format("yyyy/MM/dd"),f=$("[id$='txtoutDateShow']").val()==""?new Date((new Date).valueOf()+1728e5):new Date($("[id$='txtoutDateShow']").val()),e=f.format("yyyy/MM/dd"),i=$("#FCity").val().toLowerCase();if(i.replace("australia","").trim()=="victoria"||i.replace("australia","").trim()=="vic"){window.location.href="../Australia/Victoria.htm";return}if(i.replace("australia","").trim()=="new south wales"||i.replace("australia","").trim()=="nsw"){window.location.href="../Australia/New-South-Wales.htm";return}if(i.replace("australia","").trim()=="tasmania"||i.replace("australia","").trim()=="tas"){window.location.href="../Australia/Tasmania.htm";return}if(i.trim()=="western australia"||i.replace("australia","").trim()=="wa"){window.location.href="../Australia/Western-Australia.htm";return}if(i.replace("australia","").trim()=="queensland"||i.replace("australia","").trim()=="qld"){window.location.href="../Australia/Queensland.htm";return}if(i.replace("australia","").trim()=="northern territory"||i.replace("australia","").trim()=="nt"){window.location.href="../Australia/Northern-Territory.htm";return}if(i.trim()=="australian capital terrioty"||i.replace("australia","").trim()=="act"){window.location.href="../Australia/Australian-Capital.htm";return}window.location.href="../searchresult.htm?result="+$("#FCity").val().replace(/[^a-zA-Z0-9 ]/g,"").replace("Search more options for ","")+"&CheckIn="+u+"&CheckOut="+e+"&roomscount=1&rooms[0].adultsCount=2&rooms[0].childrenCount=0"}else t.item.Type=="Google"?($("[id$='hdnLatitude']").val(t.item.Lat),$("[id$='hdnLongitude']").val(t.item.Long),$("[id$='hdnCityUrl']").val(t.item.URL),$("[id$='FCity']").val(t.item.value),$("[id$='hdnAffUrl']").val(t.item.AffURL)):($("[id$='FCity']").val(t.item.value),$("[id$='hdnCityUrl']").val(t.item.URL),$("[id$='hdnAffUrl']").val(t.item.AffURL),$("[id$='hdnCity']").val(t.item.Type=="Hotel"?t.item.City:t.item.value))},change:function(){try{}catch(n){$("[id$='FCity']").val("")}}}).data("ui-autocomplete")._renderItemData=function(n,t){var r=$(window).width()-($("#FCity").offset().left+$("#FCity").outerWidth()-10);$(".imgcancel").css("display","block");$(".imgcancel").css("right",r+"px");var u=this.term.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),f=$.trim(u).replace("  "," ").split(" ").join("|"),e=new RegExp("("+f+")","gi"),i=t.value.replace(e,"<strong>$1<\/strong>");return t.Number=="1"?$("<li class='newType'><\/li>").data("ui-autocomplete-item",t).append("<a><span class='hc_icon_"+t.Type+"'><\/span><em>"+t.Type+"<\/em>"+i+"<\/a>").appendTo(n):$("<li><\/li>").data("ui-autocomplete-item",t).append("<a>"+i+"<\/a>").appendTo(n)};$("#FHotel").val()!=undefined&&($("#FHotel").autocomplete({source:function(n,i){var r,u;$.browser.msie&&window.XDomainRequest&&parseInt($.browser.version,10)<10?window.XDomainRequest&&(u=$("#hdnUrlSearch").val().replace("AAAAAAAA",$("#FHotel").val().replace(/[^a-zA-Z0-9, -]/g,"")),r=new XDomainRequest,r&&(r.onload=function(){var u,e;t=n.term;data=$.parseXML(r.responseText);var f=[],o=data.getElementsByTagName("a:BookingRequest.DetailsSearch"),s=data.getElementsByTagName("a:Name"),h=data.getElementsByTagName("a:Number"),c=data.getElementsByTagName("a:Url"),l=data.getElementsByTagName("a:type"),a=data.getElementsByTagName("a:AffUrl"),v=data.getElementsByTagName("a:City");for(u=0;u<o.length;u++)e={value:s[u].textContent.toString(),URL:c[u].textContent.toString(),Number:h[u].textContent.toString(),Type:l[u].textContent.toString(),AffURL:a[u].textContent.toString(),City:v[u].textContent.toString()},f.push(e);i(f)},r.onerror=function(){},r.open("GET",u),r.send())):(u=$("#hdnUrlSearch").val().replace("AAAAAAAA",$("#FHotel").val().replace(/[^a-zA-Z0-9 - ’ ' ]/g," ")),$.ajax({type:"GET",crossDomain:!0,url:u,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t){var r,f,u,e,o;if(t!=null)for(r=t.SearchResult,f=[],u=0;u<r.length;u++)r[u].type=="More"&&r.length==1?($.ajaxSetup({error:function(){var n;n={value:r[0].Name,URL:r[0].Url,Number:r[0].Number,Type:r[0].type,AffURL:r[0].AffUrl,City:r[0].City};f.push(n)}}),e="https://maps.googleapis.com/maps/api/geocode/json?address="+n.term+"&sensor=false&key=AIzaSyBv_LOOcnTkKkc_mDAz6l8D3mjm9k9P4M4",$.getJSON(e,function(n){var t,e,o,u;if(n.results.length>0)for(t=0;t<n.results.length;t++)e=n.results[t].formatted_address,o="http://www1.hotel.com.au/searchresults.html?ss="+e+"&si=ai,co,ci,re,di"+(n.results[0].place_id!=null?"&place_id="+n.results[0].place_id:"")+(n.results[0].geometry.location.lat!=null?"&place_id_lat="+n.results[0].geometry.location.lat:"")+(n.results[0].geometry.location.lng!=null?"&place_id_lon="+n.results[0].geometry.location.lng:"")+"&dest_type="+(n.results[0].types[0]=="locality"?"city":n.results[0].types[0]=="route"?"bus_station":""),u={value:e,URL:o,Number:"",Type:"Google",AffURL:o,Lat:n.results[0].geometry.location.lat,Long:n.results[0].geometry.location.lng},f.push(u);else u={value:r[0].Name,URL:r[0].Url,Number:r[0].Number,Type:r[0].type,AffURL:r[0].AffUrl,City:r[0].City},f.push(u);i(f)})):(o={value:r[u].Name,URL:r[u].Url,Number:r[u].Number,Type:r[u].type,AffURL:r[u].AffUrl,City:r[u].City},f.push(o),i(f))},error:function(){}}))},matchContains:!0,minChars:0,maxItemsToShow:10,open:function(){$(this).removeClass("wait")},search:function(){$(this).addClass("wait")},minLength:3,select:function(n,t){if(t.item.Type=="More"){var r=$("[id$='txtinDateShow']").val()==""?new Date((new Date).valueOf()+864e5):new Date($("[id$='txtinDateShow']").val()),u=r.format("yyyy/MM/dd"),f=$("[id$='txtoutDateShow']").val()==""?new Date((new Date).valueOf()+1728e5):new Date($("[id$='txtoutDateShow']").val()),e=f.format("yyyy/MM/dd"),i=$("#FCity").val().toLowerCase();if(i.replace("australia","").trim()=="victoria"||i.replace("australia","").trim()=="vic"){window.location.href="../Australia/Victoria.htm";return}if(i.replace("australia","").trim()=="new south wales"||i.replace("australia","").trim()=="nsw"){window.location.href="../Australia/New-South-Wales.htm";return}if(i.replace("australia","").trim()=="tasmania"||i.replace("australia","").trim()=="tas"){window.location.href="../Australia/Tasmania.htm";return}if(i.trim()=="western australia"||i.replace("australia","").trim()=="wa"){window.location.href="../Australia/Western-Australia.htm";return}if(i.replace("australia","").trim()=="queensland"||i.replace("australia","").trim()=="qld"){window.location.href="../Australia/Queensland.htm";return}if(i.replace("australia","").trim()=="northern territory"||i.replace("australia","").trim()=="nt"){window.location.href="../Australia/Northern-Territory.htm";return}if(i.trim()=="australian capital terrioty"||i.replace("australia","").trim()=="act"){window.location.href="../Australia/Australian-Capital.htm";return}window.location.href="../searchresult.htm?result="+$("#FCity").val().replace(/[^a-zA-Z0-9 ]/g,"").replace("Search more options for ","")+"&CheckIn="+u+"&CheckOut="+e+"&roomscount=1&rooms[0].adultsCount=2&rooms[0].childrenCount=0"}else t.item.Type=="Google"?($("[id$='hdnLatitude']").val(t.item.Lat),$("[id$='hdnLongitude']").val(t.item.Long),$("[id$='hdnCityUrl']").val(t.item.URL),$("[id$='FCity']").val(t.item.value),$("[id$='hdnAffUrl']").val(t.item.AffURL)):($("[id$='FCity']").val(t.item.value),$("[id$='hdnCityUrl']").val(t.item.URL),$("[id$='hdnAffUrl']").val(t.item.AffURL),$("[id$='hdnCity']").val(t.item.City))},change:function(){try{}catch(n){$("[id$='FCity']").val("")}}}).data("ui-autocomplete")._renderItemData=function(n,t){var r=$(window).width()-($("#FCity").offset().left+$("#FCity").outerWidth()-10);$(".imgcancel").css("display","block");$(".imgcancel").css("right",r+"px");var u=this.term.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),f=$.trim(u).replace("  "," ").split(" ").join("|"),e=new RegExp("("+f+")","gi"),i=t.value.replace(e,"<strong>$1<\/strong>");return t.Number=="1"?$("<li class='newType'><\/li>").data("ui-autocomplete-item",t).append("<a><span class='hc_icon_"+t.Type+"'><\/span><em>"+t.Type+"<\/em>"+i+"<\/a>").appendTo(n):$("<li><\/li>").data("ui-autocomplete-item",t).append("<a>"+i+"<\/a>").appendTo(n)});$("#txtdestCity").val()!=undefined&&($("#txtdestCity").autocomplete({source:function(n,i){var r,u;$.browser.msie&&window.XDomainRequest&&parseInt($.browser.version,10)<10?window.XDomainRequest&&(u=$("#hdnUrlSearch").val().replace("AAAAAAAA",$("#FHotel").val().replace(/[^a-zA-Z0-9, -]/g,"")),r=new XDomainRequest,r&&(r.onload=function(){var u,e;t=n.term;data=$.parseXML(r.responseText);var f=[],o=data.getElementsByTagName("a:BookingRequest.DetailsSearch"),s=data.getElementsByTagName("a:Name"),h=data.getElementsByTagName("a:Number"),c=data.getElementsByTagName("a:Url"),l=data.getElementsByTagName("a:type"),a=data.getElementsByTagName("a:AffUrl"),v=data.getElementsByTagName("a:City");for(u=0;u<o.length;u++)e={value:s[u].textContent.toString(),URL:c[u].textContent.toString(),Number:h[u].textContent.toString(),Type:l[u].textContent.toString(),AffURL:a[u].textContent.toString(),City:v[u].textContent.toString()},f.push(e);i(f)},r.onerror=function(){},r.open("GET",u),r.send())):(u=$("#hdnUrlSearch").val().replace("AAAAAAAA",$("#txtdestCity").val().replace(/[^a-zA-Z0-9 - ’ ' ]/g," ")),$.ajax({type:"GET",crossDomain:!0,url:u,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t){var r,f,u,e,o;if(t!=null)for(r=t.SearchResult,f=[],u=0;u<r.length;u++)r[u].type=="More"&&r.length==1?($.ajaxSetup({error:function(){var n;n={value:r[0].Name,URL:r[0].Url,Number:r[0].Number,Type:r[0].type,AffURL:r[0].AffUrl,City:r[0].City};f.push(n)}}),e="https://maps.googleapis.com/maps/api/geocode/json?address="+n.term+"&sensor=false&key=AIzaSyBv_LOOcnTkKkc_mDAz6l8D3mjm9k9P4M4",$.getJSON(e,function(n){var t,e,o,u;if(n.results.length>0)for(t=0;t<n.results.length;t++)e=n.results[t].formatted_address,o="http://www1.hotel.com.au/searchresults.html?ss="+e+"&si=ai,co,ci,re,di"+(n.results[0].place_id!=null?"&place_id="+n.results[0].place_id:"")+(n.results[0].geometry.location.lat!=null?"&place_id_lat="+n.results[0].geometry.location.lat:"")+(n.results[0].geometry.location.lng!=null?"&place_id_lon="+n.results[0].geometry.location.lng:"")+"&dest_type="+(n.results[0].types[0]=="locality"?"city":n.results[0].types[0]=="route"?"bus_station":""),u={value:e,URL:o,Number:"",Type:"Google",AffURL:o,Lat:n.results[0].geometry.location.lat,Long:n.results[0].geometry.location.lng},f.push(u);else u={value:r[0].Name,URL:r[0].Url,Number:r[0].Number,Type:r[0].type,AffURL:r[0].AffUrl,City:r[0].City},f.push(u);i(f)})):(o={value:r[u].Name,URL:r[u].Url,Number:r[u].Number,Type:r[u].type,AffURL:r[u].AffUrl,City:r[0].City},f.push(o),i(f))},error:function(){}}))},matchContains:!0,minChars:0,maxItemsToShow:10,open:function(){$(this).removeClass("wait")},search:function(){$(this).addClass("wait")},minLength:3,select:function(n,t){if(t.item.Type=="More"){var r=$("[id$='txtinDateShow']").val()==""?new Date((new Date).valueOf()+864e5):new Date($("[id$='txtinDateShow']").val()),u=r.format("yyyy/MM/dd"),f=$("[id$='txtoutDateShow']").val()==""?new Date((new Date).valueOf()+1728e5):new Date($("[id$='txtoutDateShow']").val()),e=f.format("yyyy/MM/dd"),i=$("#FCity").val().toLowerCase();if(i.replace("australia","").trim()=="victoria"||i.replace("australia","").trim()=="vic"){window.location.href="../Australia/Victoria.htm";return}if(i.replace("australia","").trim()=="new south wales"||i.replace("australia","").trim()=="nsw"){window.location.href="../Australia/New-South-Wales.htm";return}if(i.replace("australia","").trim()=="tasmania"||i.replace("australia","").trim()=="tas"){window.location.href="../Australia/Tasmania.htm";return}if(i.trim()=="western australia"||i.replace("australia","").trim()=="wa"){window.location.href="../Australia/Western-Australia.htm";return}if(i.replace("australia","").trim()=="queensland"||i.replace("australia","").trim()=="qld"){window.location.href="../Australia/Queensland.htm";return}if(i.replace("australia","").trim()=="northern territory"||i.replace("australia","").trim()=="nt"){window.location.href="../Australia/Northern-Territory.htm";return}if(i.trim()=="australian capital terrioty"||i.replace("australia","").trim()=="act"){window.location.href="../Australia/Australian-Capital.htm";return}window.location.href="../searchresult.htm?result="+$("#FCity").val().replace(/[^a-zA-Z0-9 ]/g,"").replace("Search more options for ","")+"&CheckIn="+u+"&CheckOut="+e+"&roomscount=1&rooms[0].adultsCount=2&rooms[0].childrenCount=0"}else t.item.Type=="Google"?($("[id$='hdnLatitude']").val(t.item.Lat),$("[id$='hdnLongitude']").val(t.item.Long),$("[id$='hdnCityUrl']").val(t.item.URL),$("[id$='FCity']").val(t.item.value),$("[id$='hdnAffUrl']").val(t.item.AffURL)):($("[id$='FCity']").val(t.item.value),$("[id$='hdnCityUrl']").val(t.item.URL),$("[id$='hdnAffUrl']").val(t.item.AffURL),$("[id$='hdnCity']").val(t.item.City))},change:function(){try{}catch(n){$("[id$='FCity']").val("")}}}).data("ui-autocomplete")._renderItemData=function(n,t){var r=$(window).width()-($("#FCity").offset().left+$("#FCity").outerWidth()-10);$(".imgcancel").css("display","block");$(".imgcancel").css("right",r+"px");var u=this.term.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),f=$.trim(u).replace("  "," ").split(" ").join("|"),e=new RegExp("("+f+")","gi"),i=t.value.replace(e,"<strong>$1<\/strong>");return t.Number=="1"?$("<li class='newType'><\/li>").data("ui-autocomplete-item",t).append("<a><span class='hc_icon_"+t.Type+"'><\/span><em>"+t.Type+"<\/em>"+i+"<\/a>").appendTo(n):$("<li><\/li>").data("ui-autocomplete-item",t).append("<a>"+i+"<\/a>").appendTo(n)});$.ajax({async:!0,cache:!1,url:"/home/getsetsessionvalue?checkin="+$("[id$='txtinDateShow']").val()+"&checkout="+$("[id$='txtoutDateShow']").val(),contentType:"application/json; charset=utf-8",success:function(n){if(n!=""){var i=n.split("|"),t=new Date(i[0]);$("[id$='txtinDateShow']").val(t.format("ddd, dd MMM yyyy"));t=new Date(i[1]);$("[id$='txtoutDateShow']").val(t.format("ddd, dd MMM yyyy"))}}});$.ajax({async:!0,cache:!1,url:"/home/GetSetHistoryCookiesValue",contentType:"application/json; charset=utf-8",success:function(n){if(n!="")if(n.match("search_history_box_ipad"))n.match("search_history_box_ipad")?($("[id$='dvSearchHistoryIpad']").css("display","inline-block"),$("[id$='dvSearchHistoryIpad']").html(n)):$("[id$='dvSearchHistoryIpad']").css("display","none");else if(n.match("search_history_box")){$("[id$='dvSearchHistory']").css("display","inline-block");$("[id$='dvSearchHistory']").html(n);var t=$("#hdn_SearchDataValue").val()==undefined?$("#hdn_myCookie").val()==undefined?"":$("#hdn_myCookie").val():$("#hdn_SearchDataValue").val()==undefined?"":$("#hdn_SearchDataValue").val(),i=t.indexOf("aid")>-1?"hdnAffUrl":"hdnCityUrl";$("#"+i).val(t)}else $("[id$='dvSearchHistory']").css("display","none")}});$(window).width()>700?($("[id$='txtinDateShow']").datepicker({onSelect:function(t){var i=new Date(t),r,u;$("[id$='txtinDateShow']").val(i.format("ddd, dd MMM yyyy"));i.setDate(i.getDate()+parseInt(localStorage.DiifDays==undefined||localStorage.DiifDays=="undefined"?1:localStorage.DiifDays));r=$(this).datepicker("getDate");r.setDate(r.getDate()+1);$(".spnNoOfNights").html(localStorage.DiifDays==undefined||localStorage.DiifDays=="undefined"?"1-night stay":localStorage.DiifDays+"-nights stay");localStorage.removeItem("DiifDays");u=$(this).datepicker("getDate");u.setDate(u.getDate()+30);$("input#txtoutDateShow").datepicker("setDate",null);$("input#txtoutDateShow").datepicker("option","minDate",r);$("input#txtoutDateShow").datepicker("option","maxDate",u);$("input#txtoutDateShow").datepicker("setDate",i);n()},beforeShow:function(){localStorage.CallFrom="IN";setTimeout(function(){ddiff=n();ddiff!=undefined&&$(".ui-datepicker-buttonpane").append('<span class="dateSummary">'+ddiff+"<\/span>")},1)},changeMonth:!0,changeYear:!0,yearRange:"2017:2018",numberOfMonths:$(window).width()>700?2:1,showAnim:"fadeIn",showon:"button",showButtonPanel:!0,buttonText:"",minDate:"+0D",maxDate:"+12M",dateFormat:"D, d M yy",altField:"#inDate",altFormat:"yy-mm-dd",closeText:"x Close"}),$("[id$='txtoutDateShow']").datepicker({changeMonth:!0,changeYear:!0,yearRange:"2017:2018",numberOfMonths:2,showAnim:"fadeIn",showButtonPanel:!0,minDate:"+2D",maxDate:"+12M",dateFormat:"D, d M yy",altField:"#outDate",altFormat:"yy-mm-dd",closeText:"x Close",onSelect:function(t){var e=new Date(t),i,r,f,u;$("[id$='txtoutDateShow']").val(e.format("ddd, dd MMM yyyy"));n();i=$("[id$='txtinDateShow']").datepicker("getDate");r=$("[id$='txtoutDateShow']").datepicker("getDate");i&&r&&(f=r.getTime()-i.getTime(),u=f/864e5,$(".spnNoOfNights").html(u+(u>1?"-nights stay":"-night stay")))},beforeShow:function(){localStorage.CallFrom="OUT";setTimeout(function(){ddiff=n();ddiff!=undefined&&$(".ui-datepicker-buttonpane").append('<span class="dateSummary">'+ddiff+"<\/span>")},1)}})):($("[id$='txtinDateShow']").datepicker({onSelect:function(t){var i=new Date(t),r,u;$("[id$='txtinDateShow']").val(i.format("ddd, dd MMM yyyy"));i.setDate(i.getDate()+parseInt(localStorage.DiifDays==undefined||localStorage.DiifDays=="undefined"?1:localStorage.DiifDays));r=$(this).datepicker("getDate");r.setDate(r.getDate()+1);$(".spnNoOfNights").html(localStorage.DiifDays==undefined||localStorage.DiifDays=="undefined"?"1-night stay":localStorage.DiifDays+"-nights stay");localStorage.removeItem("DiifDays");u=$(this).datepicker("getDate");u.setDate(u.getDate()+30);$("#txtoutDateShow").datepicker("setDate",null);$("#txtoutDateShow").datepicker("option","minDate",r);$("#txtoutDateShow").datepicker("option","maxDate",u);$("#txtoutDateShow").datepicker("setDate",i);$(".spnNoOfNights").html(localStorage.DiifDays==undefined||localStorage.DiifDays=="undefined"?"1-night stay":localStorage.DiifDays+"-nights stay");n()},beforeShow:function(t,i){localStorage.CallFrom="IN";var r=t.getBoundingClientRect();setTimeout(function(){i.dpDiv.css({top:r.top+30});ddiff=n();ddiff!=undefined&&$(".ui-datepicker-buttonpane").append('<span class="dateSummary">'+ddiff+"<\/span>")},0)},changeMonth:!0,changeYear:!0,yearRange:"2017:2018",numberOfMonths:1,showAnim:"fadeIn",showon:"button",showButtonPanel:!0,buttonText:"",minDate:"+0D",maxDate:"+12M",dateFormat:"D, d M yy",altField:"#inDate",altFormat:"yy-mm-dd",closeText:"x Close"}),$("[id$='txtoutDateShow']").datepicker({changeMonth:!0,changeYear:!0,yearRange:"2017:2018",numberOfMonths:$(window).width()>700?2:1,showAnim:"fadeIn",showButtonPanel:!0,minDate:"+2D",maxDate:"+12M",dateFormat:"D, d M yy",altField:"#outDate",altFormat:"yy-mm-dd",closeText:"x Close",onSelect:function(t){var e=new Date(t),i,r,f,u;$("[id$='txtoutDateShow']").val(e.format("ddd, dd MMM yyyy"));n();i=$("[id$='txtinDateShow']").datepicker("getDate");r=$("[id$='txtoutDateShow']").datepicker("getDate");i&&r&&(f=r.getTime()-i.getTime(),u=f/864e5,$(".spnNoOfNights").html(u+(u>1?"-nights stay":"-night stay")))},beforeShow:function(t,i){localStorage.CallFrom="OUT";var r=t.getBoundingClientRect();setTimeout(function(){i.dpDiv.css({top:r.top+30});ddiff=n();ddiff!=undefined&&$(".ui-datepicker-buttonpane").append('<span class="dateSummary">'+ddiff+"<\/span>")},0)}}));$.datepicker._gotoToday=function(){var n=new Date;$("div.bgimage > [id$='txtinDateShow']").val(n.format("ddd, dd MMM yyyy")).datepicker("hide");n.setDate(n.getDate()+30);$("div.bgimage > [id$='txtoutDateShow']").datepicker("option","minDate",n);$("div.bgimage > [id$='txtoutDateShow']").datepicker("setDate",n);$("div#orangebox_flotter > [id$='txtinDateShow']").val(n.format("ddd, dd MMM yyyy")).datepicker("hide");n.setDate(n.getDate()+30);$("div#orangebox_flotter > [id$='txtoutDateShow']").datepicker("option","minDate",n);$("div#orangebox_flotter > [id$='txtoutDateShow']").datepicker("setDate",n)}});onClick=!1