function showWait(){$(".EtWaitingPageOverlay, .EtWaitingPageWrapper").fadeIn(300)}function hideWait(){$(".EtWaitingPageOverlay, .EtWaitingPageWrapper").fadeOut(500)}function showhideWait(n,t,i){n<0&&(fin=300);t<0&&(t=300);i<0&&(i=300);$(".EtWaitingPageOverlay, .EtWaitingPageWrapper").fadeIn(n).delay(t).fadeOut(i)}function verticalScroll(n){$("html, body").stop().animate({scrollTop:$(n).offset().top},1e3)}function horizontalScroll(){$(".EtRightPanel").stop().animate({scrollLeft:800},1e3)}function rightScroll(){$(".EtRightPanel").stop().animate({scrollLeft:-800},1e3)}function validateEmail(n){var t=new RegExp(/^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$/i);return t.test(n)?!0:!1}function getUrlVars(){for(var t=[],n,r=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i=0;i<r.length;i++)n=r[i].split("="),t.push(n[0]),t[n[0]]=n[1];return t}function cleanModel(n,t){return n=="FaviconHTML"?undefined:n=="FaviconHTMLWithFullPath"?undefined:n=="Content"?undefined:n=="Products"?undefined:t}function getStartDateTime(n){var t=new Date;return t.setTime(t.getTime()+n*864e5),t}function ObtieneDays(n,t,i){return date=new Date($(n).datepicker("getDate")),t=="add"&&date.setDate(date.getDate()+i),t=="less"&&date.setDate(date.getDate()-i),date}function ObtieneISO(n){var t=$(n).datepicker("getDate"),i=t.getDate(),r=t.getMonth()+1,u=t.getFullYear(),f=u+"-"+r+"-"+i;$(n+"ISO").val(f)}function calculatePeriods(n,t,i,r){var e=new Date($(n).datepicker("getDate")),f=new Date($(t).datepicker("getDate")),o=new Date,u;i=="add"&&(e>f||e.toString()==f.toString())&&(u=$(n).datepicker("getDate"),u.setDate(u.getDate()+r),$(t).datepicker("setDate",u),ObtieneISO(t));i=="less"&&(e>f||e.toString()==f.toString())&&(u=$(t).datepicker("getDate"),u.setDate(u.getDate()-r),f>o?$(n).datepicker("setDate",u):$(n).datepicker("setDate",o),ObtieneISO(n))}function getStartDateTimeFlights(n){var t=new Date;return t.setTime(t.getTime()+n*864e5),t}function childrenComboChange(){for(var t=$("#EtNRooms").val(),n=1;n<=t;n++)$("#EtNumChild"+n).trigger("change")}function ObtieneDays(n,t,i){return date=new Date($(n).datepicker("getDate")),t=="add"&&date.setDate(date.getDate()+i),t=="less"&&date.setDate(date.getDate()-i),date}function ObtieneISO(n){var t=$(n).datepicker("getDate"),i=t.getDate(),r=t.getMonth()+1,u=t.getFullYear(),f=u+"-"+r+"-"+i;$(n+"ISO").val(f)}function replacer(n,t){return n=="FaviconHTML"?undefined:n=="FaviconHTMLWithFullPath"?undefined:n=="Content"?undefined:n=="ResponsePage"?undefined:t}function PopulateHotelForm(){for(var u,i,t,f,r,e=$("#EtNRooms").val(),n=1;n<=e;n++)u=$("#NoAd"+n).val(),i=$("#NoCh"+n).val(),$("#EtNumAdults"+n+" option:selected").removeAttr("selected"),$("#EtNumAdults"+n+" option[value='"+u+"']").attr("selected","selected"),$("#EtNumChild"+n+" option[value='"+i+"']").attr("selected","selected"),i>0&&(t=1,$("#EtPkNumAges"+n).val($("#AgeCh"+n).val()),f=$("#AgeCh"+n).val(),r=[],r=f.split(","),$.each(r,function(i,r){$("#EtPkNumAges"+n+"_Cbo"+t+" option[value='"+r+"']").attr("selected","selected");$("#EtPkNumAges"+n+"_Cbo"+t).show();t++}),$("#EtBxAgeChild"+n).show()),$("#EtHab"+n).show()}function FormatPrice(n){var t=HtmlHelpers.getQueryStringValue(ParametersKeys.Language)||"undefined",i=t=="undefined"?",":t.toLowerCase()=="por"?".":",";return opts={format:"%s%v",decimal:".",thousand:i},negative=n<0?"-":"",base=parseInt(Math.abs(n||0),10)+"",mod=base.length>3?base.length%3:0,negative+(mod?base.substr(0,mod)+opts.thousand:"")+base.substr(mod).replace(/(\d{3})(?=\d)/g,"$1"+opts.thousand)}function resetFilters(n){$("#EtHotelFilter").length&&(n=="D"?($("#EtHotelFilter").hide()&&($("#EtTypeSearch").val()=="L"?$("#EtHotelFilter").show():$("#EtTypeSearch").val("L")),$(".EtFilterChange").hide()):$("#EtHotelFilter").hide(),CleanFilters())}function PostAJAX(n,t){var u=$("#CatDesde").val()+"|"+$("#CatHasta").val()+"|"+$("#preciode").val()+"|"+$("#preciohasta").val()+"|"+$("#MealId").val()+"|"+$("#LocationHotel").val()+"|"+$("#typeHotel").val()+"|"+(typeof $(".EtSelectOrder").val()=="undefined"?"":$(".EtSelectOrder").val())+"|"+(typeof $(".EtSelectPages").val()=="undefined"?"":$(".EtSelectPages").val()),i,r;$("#FilterOptions").val(u);i={model:JSON.stringify(Hotel.Model,replacer)};r="/SparksVista/HotelListQuoteAjax?"+App.Configuration.BuildParamsKeys+"&"+ParametersKeys.StartDate+"="+$("input[name = '"+ParametersKeys.StartDate+"']").val()+"&"+ParametersKeys.EndDate+"="+$("input[name = '"+ParametersKeys.EndDate+"']").val()+"&"+ParametersKeys.DestinationID+"="+$("input[name = '"+ParametersKeys.DestinationID+"']").val()+"&"+ParametersKeys.CityName+"="+$("input[name = '"+ParametersKeys.CityName+"']").val()+"&"+ParametersKeys.Coupon+"="+$("input[name = '"+ParametersKeys.Coupon+"']").val()+"&"+ParametersKeys.NoRooms+"="+$("select[name = '"+ParametersKeys.NoRooms+"']").val()+"&"+ParametersKeys.Adults+1+"="+$("select[name = '"+ParametersKeys.Adults+1+"']").val()+"&"+ParametersKeys.Childrens+1+"="+$("select[name = '"+ParametersKeys.Childrens+1+"']").val()+"&"+ParametersKeys.AgeChildren+1+"="+$("input[name = '"+ParametersKeys.AgeChildren+1+"']").val()+"&"+ParametersKeys.Adults+2+"="+$("select[name = '"+ParametersKeys.Adults+2+"']").val()+"&"+ParametersKeys.Childrens+2+"="+$("select[name = '"+ParametersKeys.Childrens+2+"']").val()+"&"+ParametersKeys.AgeChildren+2+"="+$("input[name = '"+ParametersKeys.AgeChildren+2+"']").val()+"&"+ParametersKeys.Adults+3+"="+$("select[name = '"+ParametersKeys.Adults+3+"']").val()+"&"+ParametersKeys.Childrens+3+"="+$("select[name = '"+ParametersKeys.Childrens+3+"']").val()+"&"+ParametersKeys.AgeChildren+3+"="+$("input[name = '"+ParametersKeys.AgeChildren+3+"']").val()+"&"+ParametersKeys.Adults+4+"="+$("select[name = '"+ParametersKeys.Adults+4+"']").val()+"&"+ParametersKeys.Childrens+4+"="+$("select[name = '"+ParametersKeys.Childrens+4+"']").val()+"&"+ParametersKeys.AgeChildren+4+"="+$("input[name = '"+ParametersKeys.AgeChildren+4+"']").val()+"&"+ParametersKeys.Adults+5+"="+$("select[name = '"+ParametersKeys.Adults+5+"']").val()+"&"+ParametersKeys.Childrens+5+"="+$("select[name = '"+ParametersKeys.Childrens+5+"']").val()+"&"+ParametersKeys.AgeChildren+5+"="+$("input[name = '"+ParametersKeys.AgeChildren+5+"']").val()+"&"+ParametersKeys.OrderList+"="+$("input[name = '"+ParametersKeys.OrderList+"']").val()+"&"+ParametersKeys.SortList+"="+$("input[name = '"+ParametersKeys.SortList+"']").val()+"&"+ParametersKeys.Records+"="+$("input[name = '"+ParametersKeys.Records+"']").val()+"&"+ParametersKeys.NoPage+"="+$("input[name = '"+ParametersKeys.NoPage+"']").val()+"&"+ParametersKeys.FilterOptions+"="+$("input[name = '"+ParametersKeys.FilterOptions+"']").val()+"&"+ParametersKeys.PromoCouponCode+"="+($("input[name = '"+ParametersKeys.PromoCouponCode+"']").val()?$("input[name = '"+ParametersKeys.PromoCouponCode+"']").val():"")+"&"+ParametersKeys.CouponNetRate+"="+($("input[name = '"+ParametersKeys.CouponNetRate+"']").val()?$("input[name = '"+ParametersKeys.CouponNetRate+"']").val():"");$.ajax({type:"POST",url:r,data:i,beforeSend:function(){var n=Hotel.Settings.HideUrgencyMessageHotelListPromo;n||Hotel.Promo.StopProccess();showWait()},success:function(n){try{SessionManager.extend()}catch(r){}$("#productList").html(n);hideWait();$("#EtDestinyHtl").length>0?($(".EtRutas").html($("#EtDestinyHtl").val()),$("#DestinyNameSearched").val($("#EtDestinyHtl").val())):($(".EtRutas").html($("#EtDestinySelectHtl option:selected").text()),$("#DestinyNameSearched").val($("#EtDestinySelectHtl option:selected").text()));responseListOfferOfTheDay=$("#hotelListOfferOfTheDay > div.Hotel.ProductBox");responseListCoupon=$("#hotelListCoupon > div.Hotel.ProductBox");responseList=$("#hotelList > div.Hotel.ProductBox");filteredList=jQuery.extend(!0,{},responseList);filteredListCoupon=jQuery.extend(!0,{},responseListCoupon);filteredListOfferOfTheDay=jQuery.extend(!0,{},responseListOfferOfTheDay);Zion.fn.Products.Hotel.InitializateImageLoader();Zion.fn.Products.Hotel.Pagination.NumPage=1;var i=Hotel.Settings.HideUrgencyMessageHotelListPromo;i||Hotel.Promo.StartProccess();i=Hotel.Settings.HideUrgencyMessageHotelListPromo;i||Hotel.Alerts.GetLatestReservations();$("#EtHotelFilter").length&&$("#HotelBoxList").length&&t=="Filter"&&$.ajax({type:"POST",url:"/SparksVista/HotelFilterQuote?"+App.Configuration.BuildParamsKeys+"&"+ParametersKeys.StartDate+"="+$("input[name = '"+ParametersKeys.StartDate+"']").val()+"&"+ParametersKeys.EndDate+"="+$("input[name = '"+ParametersKeys.EndDate+"']").val()+"&"+ParametersKeys.DestinationID+"="+$("input[name = '"+ParametersKeys.DestinationID+"']").val()+"&"+ParametersKeys.Coupon+"="+$("input[name = '"+ParametersKeys.Coupon+"']").val()+"&"+ParametersKeys.NoRooms+"="+$("select[name = '"+ParametersKeys.NoRooms+"']").val()+"&"+ParametersKeys.Adults+1+"="+$("select[name = '"+ParametersKeys.Adults+1+"']").val()+"&"+ParametersKeys.Childrens+1+"="+$("select[name = '"+ParametersKeys.Childrens+1+"']").val()+"&"+ParametersKeys.AgeChildren+1+"="+$("input[name = '"+ParametersKeys.AgeChildren+1+"']").val()+"&"+ParametersKeys.Adults+2+"="+$("select[name = '"+ParametersKeys.Adults+2+"']").val()+"&"+ParametersKeys.Childrens+2+"="+$("select[name = '"+ParametersKeys.Childrens+2+"']").val()+"&"+ParametersKeys.AgeChildren+2+"="+$("input[name = '"+ParametersKeys.AgeChildren+2+"']").val()+"&"+ParametersKeys.Adults+3+"="+$("select[name = '"+ParametersKeys.Adults+3+"']").val()+"&"+ParametersKeys.Childrens+3+"="+$("select[name = '"+ParametersKeys.Childrens+3+"']").val()+"&"+ParametersKeys.AgeChildren+3+"="+$("input[name = '"+ParametersKeys.AgeChildren+3+"']").val()+"&"+ParametersKeys.Adults+4+"="+$("select[name = '"+ParametersKeys.Adults+4+"']").val()+"&"+ParametersKeys.Childrens+4+"="+$("select[name = '"+ParametersKeys.Childrens+4+"']").val()+"&"+ParametersKeys.AgeChildren+4+"="+$("input[name = '"+ParametersKeys.AgeChildren+4+"']").val()+"&"+ParametersKeys.Adults+5+"="+$("select[name = '"+ParametersKeys.Adults+5+"']").val()+"&"+ParametersKeys.Childrens+5+"="+$("select[name = '"+ParametersKeys.Childrens+5+"']").val()+"&"+ParametersKeys.AgeChildren+5+"="+$("input[name = '"+ParametersKeys.AgeChildren+5+"']").val()+"&"+ParametersKeys.OrderList+"="+$("input[name = '"+ParametersKeys.OrderList+"']").val()+"&"+ParametersKeys.SortList+"="+$("input[name = '"+ParametersKeys.SortList+"']").val()+"&"+ParametersKeys.Records+"="+$("input[name = '"+ParametersKeys.Records+"']").val()+"&"+ParametersKeys.NoPage+"="+$("input[name = '"+ParametersKeys.NoPage+"']").val()+"&"+ParametersKeys.FilterOptions+"="+$("input[name = '"+ParametersKeys.FilterOptions+"']").val()+"&"+ParametersKeys.PromoCouponCode+"="+($("input[name = '"+ParametersKeys.PromoCouponCode+"']").val()?$("input[name = '"+ParametersKeys.PromoCouponCode+"']").val():"")+"&"+ParametersKeys.CouponNetRate+"="+($("input[name = '"+ParametersKeys.CouponNetRate+"']").val()?$("input[name = '"+ParametersKeys.CouponNetRate+"']").val():"")+"&"+ParametersKeys.HotelThemeFilter+"="+$("input[name = '"+ParametersKeys.HotelThemeFilter+"']").val(),data:{model:JSON.stringify(Hotel.Model,replacer)},beforeSend:function(){Hotel.ShowFilterWait("#EtHotelFilter","medium")},success:function(n){try{$("#EtHotelFilter").html(n);$("#EtHotelFilter").show();Zion.fn.Products.Hotel.fillAllCountersFilter()}catch(t){}},complete:function(){}});typeof Coupon!="undefined"&&Coupon!=null&&typeof Coupon.Apply!="undefined"&&Coupon.Apply!=null&&Coupon.Apply&&saveOnly($("#hotelSearchBox input[name='@ParametersKeys.CouponNetRate']"))}})}function PostAJAXRates(n,t){$.ajax({type:"POST",url:"/SparksVista/HotelRatesQuote?"+App.Configuration.BuildParamsKeys+"&"+ParametersKeys.HotelID+"="+n+"&"+ParametersKeys.StartDate+"="+$("input[name='"+ParametersKeys.StartDate+"']").val()+"&"+ParametersKeys.EndDate+"="+$("input[name='"+ParametersKeys.EndDate+"']").val()+"&"+ParametersKeys.DestinationID+"="+$("input[name='"+ParametersKeys.DestinationID+"']").val()+"&"+ParametersKeys.Coupon+"="+$("input[name='"+ParametersKeys.Coupon+"']").val()+"&"+ParametersKeys.NoRooms+"="+$("select[name='"+ParametersKeys.NoRooms+"']").val()+"&"+ParametersKeys.Adults+1+"="+$("select[name='"+ParametersKeys.Adults+1+"']").val()+"&"+ParametersKeys.Childrens+1+"="+$("select[name='"+ParametersKeys.Childrens+1+"']").val()+"&"+ParametersKeys.AgeChildren+1+"="+$("input[name='"+ParametersKeys.AgeChildren+1+"']").val()+"&"+ParametersKeys.Adults+2+"="+$("select[name='"+ParametersKeys.Adults+2+"']").val()+"&"+ParametersKeys.Childrens+2+"="+$("select[name='"+ParametersKeys.Childrens+2+"']").val()+"&"+ParametersKeys.AgeChildren+2+"="+$("input[name='"+ParametersKeys.AgeChildren+2+"']").val()+"&"+ParametersKeys.Adults+3+"="+$("select[name='"+ParametersKeys.Adults+3+"']").val()+"&"+ParametersKeys.Childrens+3+"="+$("select[name='"+ParametersKeys.Childrens+3+"']").val()+"&"+ParametersKeys.AgeChildren+3+"="+$("input[name='"+ParametersKeys.AgeChildren+3+"']").val()+"&"+ParametersKeys.Adults+4+"="+$("select[name='"+ParametersKeys.Adults+4+"']").val()+"&"+ParametersKeys.Childrens+4+"="+$("select[name='"+ParametersKeys.Childrens+4+"']").val()+"&"+ParametersKeys.AgeChildren+4+"="+$("input[name='"+ParametersKeys.AgeChildren+4+"']").val()+"&"+ParametersKeys.Adults+5+"="+$("select[name='"+ParametersKeys.Adults+5+"']").val()+"&"+ParametersKeys.Childrens+5+"="+$("select[name='"+ParametersKeys.Childrens+5+"']").val()+"&"+ParametersKeys.AgeChildren+5+"="+$("input[name='"+ParametersKeys.AgeChildren+5+"']").val()+"&"+ParametersKeys.PromoCouponCode+"="+($("input[name = '"+ParametersKeys.PromoCouponCode+"']").val()?$("input[name = '"+ParametersKeys.PromoCouponCode+"']").val():"")+"&"+ParametersKeys.CouponNetRate+"="+($("input[name = '"+ParametersKeys.CouponNetRate+"']").val()?$("input[name = '"+ParametersKeys.CouponNetRate+"']").val():""),data:{model:JSON.stringify(Hotel.Model,replacer)},beforeSend:function(){showWait()},success:function(n){$("#productRates").html(n);$("#productRates").fadeIn();t==!0&&(verticalScroll(".EtRightPanel"),horizontalScroll("#productRates"),$("#productList").fadeOut())},complete:function(){hideWait()}})}function resetFilters(){$("#FilterOptions").val("");$("#CatDesde").val("20");$("#CatHasta").val("60");$("#preciode").val("0");$("#preciohasta").val("0");$("#MealId").val("");$("#LocationHotel").val("");$("#typeHotel").val("")}function loadGoogleMapsScript(){if(GMapsStatus.scriptstatus==="none"){try{gMapsKey=Hotel.Settings.GoogleMapsKey===""?"":"&key="+Hotel.Settings.GoogleMapsKey;var n=document.createElement("script");n.setAttribute("src","https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language="+Resources.General.LanguageGoogleMaps+gMapsKey);document.head.appendChild(n)}catch(t){console.log(t)}GMapsStatus.scriptstatus="loaded"}}function initGoogleMaps(){var t,i,n;try{for(t={center:new google.maps.LatLng(Zion.fn.Products.Hotel.HotelListInfo[0].Latitude,Zion.fn.Products.Hotel.HotelListInfo[0].Longitude),zoom:11,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:!1,styles:[{featureType:"poi",stylers:[{visibility:"off"}]}]},Zion.fn.Products.Hotel.ListMap.map=new google.maps.Map(document.getElementById(Zion.fn.Products.Hotel.ListMap.container),t),i=new google.maps.InfoWindow({maxWidth:540}),n=0;n<Zion.fn.Products.Hotel.HotelListInfo.length;n++)Zion.fn.Products.Hotel.ListMap.addMarkerWithInfo({map:Zion.fn.Products.Hotel.ListMap.map,infoWindow:i,latitude:Zion.fn.Products.Hotel.HotelListInfo[n].Latitude,longitude:Zion.fn.Products.Hotel.HotelListInfo[n].Longitude,title:Zion.fn.Products.Hotel.HotelListInfo[n].Name,id:Zion.fn.Products.Hotel.HotelListInfo[n].Id,available:Zion.fn.Products.Hotel.HotelListInfo[n].Available})}catch(r){console.log(r)}GMapsStatus.initmapstatus="loaded"}function hideList(){$("#HotelListWrap").hide()}function showList(){$("#HotelListWrap").show();$("#showList").addClass("selected");$("#showMap").removeClass("selected");Zion.fn.Products.Hotel.CleanFilters();Zion.fn.Products.Hotel.LoadFilters();Zion.fn.Products.Hotel.ApplyFilters()}function hideMap(){$("#HotelMapInfo").hide();$("#cmbOrderBy").parent().show()}function showMap(){$("#HotelMapInfo").show();$("#showList").removeClass("selected");$("#showMap").addClass("selected");Zion.fn.Products.Hotel.ListMap.InitializeMap();$("#cmbOrderBy").parent().hide();$("#destinationResume").html().length>0?$("#titleMap").html(Resources.Pages.HotelsIn+" "+$("#destinationResume").html()+" "+Resources.Pages.AndSurroundings):$("#EtDestinyHtl").length&&$("#titleMap").html(Resources.Pages.HotelsIn+" "+$("#EtDestinyHtl").val()+" "+Resources.Pages.AndSurroundings)}function copyToResume(){var n,t,i,r;Hotel.onlyAdults==="true"&&($("#noKidsResume").parent().hide(),$("#separator").hide());$("#EtDestinyHtl").length?$("#destinationResume").html($("#EtDestinyHtl").val()):$("#EtDestinySelectHtl").length?$("#destinationResume").html($("#EtDestinySelectHtl").children("option:selected").text()):$("#destinationResume").html($("#EtDestHtl").text());$("#noAdultsResume").html(getSumPeople("EtNumAdults",$("#EtNRooms").val()));$("#noKidsResume").html(getSumPeople("EtNumChild",$("#EtNRooms").val()));$("#noRoomsResume").html($("#EtNRooms").val());n=$("#EtDateFromHotelISO").val().split("-");t=new Date(n[0],parseInt(n[1])-1,parseInt(n[2]));t=$.datepicker.formatDate("dd MM yy",t);$("#fromDateResume").html(t);i=$("#EtDateToHotelISO").val().split("-");r=new Date(i[0],parseInt(i[1])-1,parseInt(i[2]));r=$.datepicker.formatDate("dd MM yy",r);$("#toDateResume").html(r)}function getSumPeople(n,t){var r=0;for(i=1;i<=parseInt(t);i++)r+=parseInt($("#"+n+i.toString()).val());return r}function CleanFilters(){var n=$("#EtPriceRange").slider("option","min"),t=$("#EtPriceRange").slider("option","max"),i,r;$("#EtCategoryRange").slider("option","values",[2,6]);$("#EtStarRange").text("2 - 6");$("#CatDesde").val(20);$("#CatHasta").val(60);$("#EtPriceRange").slider("option","values",[n,t]);$("#EtSpnPriceRangeMin").text($("#EtSpnPriceRangeMinBase").text());$("#EtSpnPriceRangeMax").text($("#EtSpnPriceRangeMaxBase").text());$("#preciode").val(n.toLocaleCurrency());$("#preciohasta").val(t.toLocaleCurrency());$("#EtSelectMealPlan option[value='']").attr("selected",!0);$(".EtInpTypeHotel").removeAttr("checked");$("#EtSelectTypeLocation option[value='']").attr("selected",!0);$("#MealId, #typeHotel, #LocationHotel").val("");$("input[name='"+ParametersKeys.NoPage+"']").val("1");$("#EtHotelName, #hotelIdFilter").val("");$(".EtInpServiceHotel, .EtInpLocationHotel, .EtInpMealplanHotel, .EtInpChainHotel").removeAttr("checked");$("#serviceHotel, #chainHotel").val("");i=$("#EtTripAdvisorRange").slider("option","min");r=$("#EtTripAdvisorRange").slider("option","max");$("#EtTripAdvisorRange").slider("option","values",[i,r]);$("#TADesde").val("2");$("#TAHasta").val("5");$("#LocTypeId").val("");$("#mealplanHotel").val("");$("#HotelType").val("")}var responseList,filteredList,Zion,GMapsStatus,Hotel;$(".EtRightPanel").on("click",".EtSeekSearchBox",function(n){n.preventDefault();verticalScroll(".EtRightPanel");$(".EtBxSearch").addClass("zIndex1500");$(".EtWaitingPageOverlay").fadeIn().delay(700).fadeOut(function(){$(".EtBxSearch").removeClass("zIndex1500")})});$(".filterBox a").click(function(n){n.preventDefault();$(this).is(".OpenCloseFilter")?($(this).removeClass("OpenCloseFilter"),$(this).addClass("icoCloseFilter"),$(this).parent(".filterBox").removeClass("open"),$(this).parent(".filterBox").addClass("close")):($(this).removeClass("icoCloseFilter"),$(this).addClass("OpenCloseFilter"),$(this).parent(".filterBox").removeClass("close"),$(this).parent(".filterBox").addClass("open"))});$("#BusSearchBox .EtNumChild").change(function(){var r=$(this).attr("id"),i=$(this).val(),n=r.replace("EtNumChild",""),t;if(NameIndSel="EtPkNumAges"+n+"_Cbo",i>0){for($("#BusSearchBox #EtBxAgeChild"+n+" .childrenAgesSelectors select").hide(),t="",x=1;x<=i;x++)$("#BusSearchBox #"+NameIndSel+x).show(),t=t+$("#"+NameIndSel+x).val()+",";$("#BusSearchBox #EtBxAgeChild").show();$("#BusSearchBox #EtBxAgeChild"+n).show();$("#BusSearchBox #EtPkNumAges"+n).val(t)}else $("#BusSearchBox #EtBxAgeChild").hide(),$("#BusSearchBox #EtBxAgeChild"+n).hide()});$("#BusSearchBox .childrenAgesSelectors select").change(function(){var i=$(this).attr("name"),n="",t="";$("#BusSearchBox  #"+i+" .childrenAgesSelectors select").each(function(){$(this).is(":visible")&&(n=n+$(this).val()+",",t=$(this).attr("id"))});t=t.split("_")[0];n=n.substring(0,n.length-1);$("#BusSearchBox  #"+t).val(n)});$("body").on("focusin",".inptBx input",function(){$(this).parent().addClass("FocusIconAnimation")});$("body").on("focusout",".inptBx input",function(){$(this).parent().removeClass("FocusIconAnimation")});$(".Et_InputBox input").focusin(function(){$(this).parent().addClass("Et_AsocMainColorBrdr");$(this).parent().find("i.ico").addClass("Et_AsocMainColorFont")}).focusout(function(){$(this).parent().removeClass("Et_AsocMainColorBrdr");$(this).parent().find("i.ico").removeClass("Et_AsocMainColorFont")});$(".ToggleCloseFilterTour").click(function(){$(".Et_collapsibleContent").toggle()});$("body").on("click",".collapsibleTrigger",function(){var n=$(this).attr("id").replace("collapsible_","");$("#info-toggle_"+n).slideToggle(500)});$("body").on("click",".Et_collapsibleTrigger",function(){$(this).parent().toggleClass("closed");$(this).parent().next(".Et_collapsibleContent").toggle();$(this).parent().children(".Et_collapsibleContent").toggle()});$("body").on("click",".filterBox .Et_collapsibleTrigger",function(){$(this).parent(".filterBox").toggleClass("close")});$("body").on("click",".filterBox .Et_collapsibleTrigger",function(){$(this).parent().toggleClass("closed")});$("#EtPackageFilter, #EtHotelFilter, #tourfilters").on("click","._seeMore, ._showLess",function(){var i=$(this).closest(".filterContent"),t=$("ul li",i),n;if($(this).slideUp("fast"),$(this).hasClass("_seeMore")){for(n=3;n<t.length;n++)$(t[n]).slideDown();$("._showLess",i).slideDown("fast")}else{for(n=3;n<t.length;n++)$(t[n]).slideUp();$("._seeMore",i).slideDown("fast")}});$(".Et_collapsibleTrigger").click(function(){$(this).parent().next(".Et_collapsibleContent").toggle();$(this).parent().children(".Et_collapsibleContent").toggle()});$(".Et_collapsibleTriggerInside").click(function(){$(this).parents(".Et_collapsibleContent").toggle()});$(".Et_summary .Et_collapsibleTrigger").click(function(){$(this).toggle();$(this).parent().children(".Et_collapsibleContent").toggle();$(this).parent().parent().addClass("open")});$(".Et_summary .Et_collapsibleContent .closeBtn").click(function(){$(this).parent().parent().parent().removeClass("open");$(this).parent().parent().children(".Et_collapsibleTrigger").toggle()});$(".eraseProduct").click(function(){$(this).parent().parent(".productSummaryRow").addClass("erasing").fadeOut();$(this).parent().next(".productSummaryRow").addClass("Et_noBorder")});$("body").on("click",".Et_summary .Et_collapsibleTriggerAddons",function(){$(this).toggle();$(this).parent().children(".Et_collapsibleContent").toggle();$(this).parent().parent().addClass("open")});$("body").on("click",".Et_summary .Et_collapsibleContent .closeBtn",function(){$(this).parent().parent().parent().removeClass("open");$(this).parent().parent().children(".Et_collapsibleTriggerAddons").toggle();$(this).parent().toggle()});$("body").on("click",".toggleFlightInfo",function(){var t=$(this).parent().children("div").children("div.toggleFlightDetail"),n;$(t).length<=0&&(n=responseList.find("div#flightInfo_0").children("div").children("div.toggleFlightDetail").clone(),$(this).parent().children(".toogleDetailContainer").prepend(n))});$("body").on("click",".toggleBusInfo",function(){var t=$(this).parent().children("div").children("div.toggleBusDetail"),n;$(t).length<=0&&(n=$(responseList).find("div#busInfo_0").children("div").children("div.toggleBusDetail").clone(),$(this).parent().children(".toogleDetailContainer").prepend(n))});$("body").on("click",".kdo-flight--info--more-info-toggle, .kdo-bus--info--more-info-toggle",function(){$(this).parent().hasClass("is-merchant")?($(this).parent().children(".kdo-flight--info--merchant-content").slideToggle(),$(this).parent().children("div:first").slideToggle(),$(this).parent().addClass("is-open").removeClass("is-merchant"),$(this).parent().children(".kdo-flight--info--merchant-toggle").find("i:last").removeClass("icono-toggle-arriba").addClass("icono-toggle-abajo")):($(this).parent().children("div:first").slideToggle(),$(this).parent().toggleClass("is-open"));details=$(this).find("i.kdo-flight--info--more-info-toggle-icon,i.kdo-bus--info--more-info-toggle-icon");$(details).hasClass("icono-toggle-abajo")?$(details).removeClass("icono-toggle-abajo").addClass("icono-toggle-arriba"):$(details).removeClass("icono-toggle-arriba").addClass("icono-toggle-abajo")});$("body").on("click",".kdo-flight--info--merchant-toggle",function(){details=$(this).find("i:last");$(this).parent().hasClass("is-open")?($(this).parent().children(".kdo-flight--info--merchant-content").slideToggle(),$(this).parent().children("div:first").slideToggle(),$(this).parent().find("i.kdo-flight--info--more-info-toggle-icon").removeClass("icono-toggle-arriba").addClass("icono-toggle-abajo"),$(this).parent().removeClass("is-open").addClass("is-merchant")):($(this).parent().children(".kdo-flight--info--merchant-content").fadeToggle(),$(this).parent().toggleClass("is-merchant"));$(details).hasClass("icono-toggle-abajo")?$(details).removeClass("icono-toggle-abajo").addClass("icono-toggle-arriba"):$(details).removeClass("icono-toggle-arriba").addClass("icono-toggle-abajo")});$(document).on("click",".toggleAdvancedInfo",function(){var n=$(this).parent().children(".EtBxContainer"),t=$(this).children("i");n.css("display")=="none"?t.removeClass("icono-toggle-abajo").addClass("icono-toggle-arriba"):(t.removeClass("icono-toggle-arriba").addClass("icono-toggle-abajo"),$(n).find(".inptBx input").val(""));n.slideToggle()});$.fn.serializeObject=function(){var n={},t=this.serializeArray();return $.each(t,function(){n[this.name]!==undefined?(n[this.name].push||(n[this.name]=[n[this.name]]),n[this.name].push(this.value||"")):n[this.name]=this.value||""}),n};$(document).ready(function(){$("#EtDateIn").datepicker({showOn:"both",buttonImageOnly:!0,buttonText:"",maxDate:"18M",showButtonPanel:!0,minDate:new Date,numberOfMonths:2,onSelect:function(){ObtieneISO("#EtDateIn")}});$("#EtDateFromFlight, #EtDateToFlight").datepicker({showOn:"both",buttonImageOnly:!0,buttonText:"",minDate:Flight.Settings.NumDias,defaultDate:Flight.Settings.NumDefault,numberOfMonths:2,showButtonPanel:!0,maxDate:"18M",onSelect:function(){ObtieneISO("#"+this.id);this.id=="EtDateFromFlight"&&($("#EtDateToFlight").datepicker("option","minDate",ObtieneDays("#EtDateFromFlight","add",1)),ObtieneISO("#EtDateToFlight"))},beforeShow:function(){$("#EtDateToFlight").datepicker("option","minDate",ObtieneDays("#EtDateFromFlight","add",0));$("#EtDateToFlight").datepicker("getDate").getMonth()-$("#EtDateFromFlight").datepicker("getDate").getMonth()==1?$("#EtDateToFlight").datepicker("option","showCurrentAtPos",1):$("#EtDateToFlight").datepicker("option","showCurrentAtPos",0)},beforeShowDay:function(n){var i=$("#EtDateFromFlight").datepicker("getDate"),r=$("#EtDateToFlight").datepicker("getDate"),f=i.getDate()+" "+i.getMonth()+" "+i.getFullYear(),e=r.getDate()+" "+r.getMonth()+" "+r.getFullYear(),u=n.getDate()+" "+n.getMonth()+" "+n.getFullYear(),t="";return n>i&&n<r&&(t="Et_selectedDays"),u==f&&(t="Et_firstDay"),u==e&&(t="Et_lastDay"),u==f&&this.id=="EtDateToFlight"&&(t="Et_firstDay ui-datepicker-unselectable"),[!0,t,""]},onClose:function(){this.id=="EtDateFromFlight"&&$("#EtDateToFlight").datepicker("show")}});$("#EtDateFromFlight").datepicker("option","firstDay",0);$("#EtDateToFlight").datepicker("option","firstDay",0);Hotel.Settings.HasFixedChildren&&($("#EtNRooms").change(childrenComboChange),childrenComboChange())});Zion=window.Zion||{};Zion.fn=Zion.fn||{};Zion.fn.Products=Zion.fn.Products||{};Zion.fn.Products.Hotel=Zion.fn.Products.Hotel||{};Zion.fn.Products.Hotel.BussinesRules=Zion.fn.Products.Hotel.BussinesRules||{};Zion.fn.Products.Hotel.Messages=Zion.fn.Products.Hotel.Messages||{};Zion.fn.Products.Hotel.Messages.sp=Zion.fn.Products.Hotel.Messages.sp||{};Zion.fn.Products.Hotel.Messages.en=Zion.fn.Products.Hotel.Messages.en||{};Zion.fn.Products.Hotel.Messages.pt=Zion.fn.Products.Hotel.Messages.pt||{};Zion.fn.Products.Hotel.Model=Zion.fn.Products.Hotel.Model||{};Zion.fn.Products.Hotel.Model.ListModel=Zion.fn.Products.Hotel.Model.ListModel||{};Zion.fn.Products.Hotel.JsonHotelResponseAPI={};Zion.fn.Products.Hotel.Pagination=Zion.fn.Products.Hotel.Pagination||{};Zion.fn.Products.Hotel.Filters=Zion.fn.Products.Hotel.Filters||{};Hotel=window.Hotel||{};Hotel.Model=Hotel.Model||{};Hotel.Promo=Hotel.Promo||{};Hotel.Alerts=Hotel.Alerts||{};Zion.fn.Products.Hotel.Pagination={NumPage:1,TotalPeerPage:15};Zion.fn.Products.Hotel.Filters={HotelId:null,Prices:null,Category:null,TripAdvisor:null,Service:null,MealPlan:null,Location:null,Chain:null,Theme:null,TotalMatches:0};responseList={};filteredList={};String.format=function(){for(var i,t=arguments[0],n=0;n<arguments.length-1;n++)i=new RegExp("\\{"+n+"\\}","gm"),t=t.replace(i,arguments[n+1]);return t};$(document).ready(function(){$("#viewRooms").click(function(){$(".Et_Product_tabs li._rooms").trigger("click")});$("#viewMapBtn").click(function(n){return $(".Et_Product_tabs li._location").trigger("click"),n.preventDefault(),!1});$("#HotelProducts #carousel ul li").on("click",function(){var n=$("#slider").data("flexslider"),t=parseInt(this.id.split("_")[1]);n.currentSlide==0&&t==n.count-1?(n.flexAnimate(t-1),n.flexAnimate(t)):n.currentSlide==n.count-1&&t==0?(n.flexAnimate(t+1),n.flexAnimate(t)):n.flexAnimate(t)});$("body").on("click",".ImageHotelListButton,.TitleHotelListButton",function(){showWait()});$("body").on("click",".btnViewRates",function(n){n.preventDefault();showWait();var i=$(this).attr("HotelId"),t=document.getElementById("SelectedHotelForm"+i);t.action=t.action+"#room";t.submit()});try{Zion.fn.Products.Common.ReservationBox.Hotel.HasFixedChildren&&($("#EtNRoomsRefine").change(childrenComboChange),childrenComboChange());Zion.fn.Products.Common.ReservationBox.Hotel.isAdultsOnly&&$("select.EtNumChild","#hotelSearchBox").html("<option value='0' selected>0<\/option>")}catch(n){}$("body").on("click",".photo-nav",function(){var n=$(this).closest(".Hotel").find("input[name='"+ParametersKeys.HotelID+"']").val(),t=$(this).hasClass("next")?Hotel.Gallery.Nav.Next:Hotel.Gallery.Nav.Prev;Hotel.Gallery.ShowGalleryById(n,t)})});Zion.fn.Products.Hotel.InitializateImageLoader=function(){$("img.lazy").each(function(){$(this).attr("src")=="/_lib/Ktravel/img/et_broken_link_hotel.jpg"&&$(this).lazyload({effect:"fadeIn"})})};Zion.fn.Products.Hotel.TriggerImageLoader=function(){$("img.lazy").trigger("fadeIn")};ua=navigator.userAgent;isMobileWebkit=/WebKit/.test(ua)&&/Mobile/.test(ua);isMobileWebkit&&$(".Modal, .kdo--modal__bg").addClass("is-hidden");Hotel.Gallery={};Hotel.Gallery.Url="/_AJAX/GetHotelInformation";Hotel.Gallery.ImageUrls=[];Hotel.Gallery.Nav={Next:"next",Prev:"prev"};Hotel.Gallery.ShowGalleryById=function(n,t){var i,r;n&&typeof n!="undefined"&&n!=""&&!isNaN(n)&&(i=0,Hotel.Gallery.PreventUserClicks(n),r=$.grep(Hotel.Gallery.ImageUrls,function(t){return t.Id==n}),r.length==i?Hotel.Gallery.RequestGalleryById(n,t):Hotel.Gallery.ShowNextPrevImage(n,t))};Hotel.Gallery.PreventUserClicks=function(){$(".photo-nav").prop("disabled",!0)};Hotel.Gallery.OkUserClicks=function(){$(".photo-nav").prop("disabled",!1)};Hotel.Gallery.RequestGalleryById=function(n,t){var i=['request={"Client":{"Affiliate":"'+Hotel.Model.RequestPage.Affiliate.Id+'","Language":"'+Hotel.Model.RequestPage.Quote.Language+'","Site":"ETE","Country":"'+Hotel.Model.RequestPage.Quote.Country.Code+'","Currency":"'+Hotel.Model.RequestPage.Quote.Currency.Id+'"},"IncludeDetails":{"Gallery":true},"HotelId":'+n+"}"].join("");return $.ajax({url:Hotel.Gallery.Url,data:i,type:"GET",dataType:"json",contentType:"application/json",beforeSend:function(){Hotel.Gallery.ShowSpinner(n)},success:function(i){i&&i.Hotel&&i.Hotel.Galleries.ImageList.length>0&&typeof i.Hotel.Galleries!="undefined"&&i.Hotel.Galleries!=null&&(Hotel.Gallery.PushImagesUrls(i.Hotel.Galleries.ImageList.slice(0,25),n),Hotel.Gallery.ShowNextPrevImage(n,t))},error:function(){}}),Hotel.Gallery.Url+"?callback=GetHotelInformation&"+i};Hotel.Gallery.PushImagesUrls=function(n,t){var i={Id:t,Images:n};i.Images.length&&(i.Images[0].URL=$("#HotelImage"+t).attr("data-original"));Hotel.Gallery.ImageUrls.push(i)};Hotel.Gallery.ShowNextPrevImage=function(n,t){var r,i,e,o;if(Hotel.Gallery.ShowSpinner(n),r=$.grep(Hotel.Gallery.ImageUrls,function(t){return t.Id==n}),r&&r.length>0){var f=r[0].Images,s=f.length-1,u=$("#photo-num"+n).html();u=isNaN(parseInt(u))?1:parseInt(u);i=u-1;t==Hotel.Gallery.Nav.Next&&(i++,i=i>s?0:i);t==Hotel.Gallery.Nav.Prev&&(i--,i=i<0?s:i);$("#photo-num"+n).html(i+1);$("#photo-tot_"+n).html(" / "+f.length);e=$("#HotelImage"+n);o=f[i].URL;e.attr("src",o);e.attr("data-original",o);Hotel.Gallery.OkUserClicks(n)}};Hotel.Gallery.getSmallImageUrl=function(n){return n.substring(0,n.lastIndexOf("."))+"_m.jpg"};Hotel.Gallery.ShowSpinner=function(n){$("#HotelImage"+n).attr("src","");$("#HotelImage"+n).attr("src","/_lib/Ktravel/img/blank.gif");$("#DivHotelImage"+n).addClass("kdo-product-box__img-spinner");$("#DivHotelImage"+n).attr("style","background-image: url(/_lib/Ktravel/img/addons-spinner.gif );")};Hotel=window.Hotel||{};Hotel.textSearch="";$(document).ready(function(){Hotel.textSearch=$("#EtDestinyHtl").val();$("#EtDestinyHtl").autocomplete({minLength:3,delay:500,source:function(n,t){getAjaxSearch(n,t,"D:5,C:5,H:5","")},select:function(n,t){switch(t.item.type){case"title":return $(this).show(),!1;case"D":$("#Etdt").val(t.item.typeId);$("#EtHt").val("");$("#EtHtNm").val("");$("#EtCt").val(t.item.countryId);$("#EtHotelRate").val("");$("#EtCtNm").val("");resetFilters("D");break;case"H":$("#EtHt,#EtHotelRate").val(t.item.typeId);$("#EtHtNm").val(t.item.value).attr("name",ParametersKeys.HotelName);$("#EtCt").val(t.item.countryId);$("#EtTypeSearch").val("R");$("#Etdt").val("0");$("#EtCtNm").val("");resetFilters("H");break;case"C":$("#EtCtNm").val(t.item.typeId);$("#EtHt").val("");$("#EtHtNm").val("");$("#EtCt").val(t.item.countryId);$("#EtHotelRate").val("");resetFilters("D")}t.item.type!="title"&&($("#EtWtDes").val(t.item.typeId),Hotel.textSearch=t.item.label)},open:function(){$(this).autocomplete("widget").addClass("EtBxAutoComplete")},change:function(n,t){t.item==null&&$(this).val(Hotel.textSearch)}}).data("ui-autocomplete")._renderMenu=function(n,t){result=renderMenuAutocomplete(t,this.term);$.each(result,function(t,i){$(i).appendTo(n)})};$("#EtDestinyHtl").click(function(){$(this).val("")});var n=$("#Etdt").val(),t="",i=$("#EtTypeSearch").val();i=="R"&&(t=$("#EtHtNm").val());n!="0"&&t==""&&i=="L"&&$.ajax({url:"/_Ajax/LocationHotel",type:"GET",dataType:"json",data:"ln="+$("input[name='"+ParametersKeys.Language+"']").val()+"&dest="+n+"",contentType:"application/json; charset=utf-8",success:function(n){if(n!=null&&n.length>0)if(n[0].id!=""){var t=n[0].value.substring(0,n[0].value.length-2);$("#EtDestinyHtl").val().match(t)||$("#EtCtNm").val()!=""||($("#EtDestinyHtl").val(t),Hotel.textSearch=t);$("#EtCy").val(n[0].cityId);$("#EtCt").val(n[0].countryId);$(".EtRutas").html(t)}else $("#EtDestinyHtl").val()==""&&($("#EtDestinyHtl").val(Resources.Pages.NoResults),$("#EtWtDes").val("0"))}})});Zion=window.Zion||{};Zion.fn=Zion.fn||{};Zion.fn.Products=Zion.fn.Products||{};Zion.fn.Products.Common=Zion.fn.Products.Common||{};Zion.fn.Products.Common.ReservationBox=Zion.fn.Products.Common.ReservationBox||{};Zion.fn.Products.Common.ReservationBox.Package=Zion.fn.Products.Common.ReservationBox.Package||{};Zion.fn.Products.Common.ReservationBox.Hotel=Zion.fn.Products.Common.ReservationBox.Hotel||{};Hotel.ShowFilterWait=function(n,t){typeof n!="undefined"&&n!==null&&n!==""&&((typeof t=="undefined"||t===null||t==="")&&(t="small"),$(n).show(),$(n).html('<div style="text-align: center;"><div class="'+t+' progress"><div>&nbsp;<\/div><\/div><\/div>'))};Zion.fn.Products.Hotel.CleanFilters=function(){Zion.fn.Products.Hotel.Filters.HotelId=null;Zion.fn.Products.Hotel.Filters.Prices=null;Zion.fn.Products.Hotel.Filters.Category=null;Zion.fn.Products.Hotel.Filters.TripAdvisor=null;Zion.fn.Products.Hotel.Filters.Service=null;Zion.fn.Products.Hotel.Filters.MealPlan=null;Zion.fn.Products.Hotel.Filters.Location=null;Zion.fn.Products.Hotel.Filters.Chain=null;Zion.fn.Products.Hotel.Filters.Theme=null};Zion.fn.Products.Hotel.LoadFilters=function(){var n,t,i,r,u,f,e;$("#EtHotelFilter").length!==0&&(Zion.fn.Products.Hotel.Filters.HotelId=$("#hotelIdFilter").val(),n=parseInt($("#CatDesde").val()),t=parseInt($("#CatHasta").val()),Zion.fn.Products.Hotel.Filters.Category={From:n,To:t},i=parseFloat($("#TADesde").val()),r=parseFloat($("#TAHasta").val()),Zion.fn.Products.Hotel.Filters.TripAdvisor={From:i,To:r},u=($("#preciode").val()||"0").toFloat(),f=($("#preciohasta").val()||"99999").toFloat(),Zion.fn.Products.Hotel.Filters.Prices={From:u,To:f},e=$("#LocTypeId").val(),Zion.fn.Products.Hotel.Filters.Location=e,Zion.fn.Products.Hotel.Filters.Type=$("#HotelType").val(),Zion.fn.Products.Hotel.Filters.Service=$("#serviceHotel").val(),Zion.fn.Products.Hotel.Filters.MealPlan=$("#mealplanHotel").val(),Zion.fn.Products.Hotel.Filters.Chain=$("#chainHotel").val())};Zion.fn.Products.Hotel.ApplyFilters=function(){$("div.Hotel.ProductBox").css("display","none");filteredListOfferOfTheDay=jQuery.extend(!0,{},responseListOfferOfTheDay);filteredListCoupon=jQuery.extend(!0,{},responseListCoupon);filteredList=jQuery.extend(!0,{},responseList);filteredListCoupon=Zion.fn.Products.Hotel.ApplyFiltersBySeparatedList(filteredListCoupon);filteredList=Zion.fn.Products.Hotel.ApplyFiltersBySeparatedList(filteredList);Zion.fn.Products.Hotel.ShortFilteredHotelList(filteredListOfferOfTheDay);Zion.fn.Products.Hotel.ShortFilteredHotelList(filteredListCoupon);Zion.fn.Products.Hotel.ShortFilteredHotelList(filteredList);Zion.fn.Products.Hotel.Filters.UpdateDynamicFilters();Zion.fn.Products.Hotel.fillAllCountersFilter();Zion.fn.Products.Hotel.Filters.ShowHotels(Zion.fn.Products.Hotel.Pagination.NumPage*Zion.fn.Products.Hotel.Pagination.TotalPeerPage);GMapsStatus.scriptstatus==="loaded"&&$("#map-canvas").is(":visible")&&Zion.fn.Products.Hotel.ListMap.InitializeMap()};Zion.fn.Products.Hotel.ApplyFiltersBySeparatedList=function(n){var i,t,r,u,f;return!n||n.length<=0?[]:Zion.fn.Products.Hotel.Filters.HotelId&&(n=$.grep(n,function(n){if($(n).attr("id")==="Hotel"+Zion.fn.Products.Hotel.Filters.HotelId)return n}),n.length===1)?(Zion.fn.Products.Hotel.ShortFilteredHotelList(),Zion.fn.Products.Hotel.Filters.UpdateDynamicFilters(),Zion.fn.Products.Hotel.fillAllCountersFilter(),Zion.fn.Products.Hotel.Filters.ShowHotels(Zion.fn.Products.Hotel.Pagination.NumPage*Zion.fn.Products.Hotel.Pagination.TotalPeerPage),Zion.fn.Products.Hotel.ListMap.InitializeMap(),n):(Zion.fn.Products.Hotel.Filters.Prices&&(n=$.grep(n,function(n){var t=$(n).find("input#rateHotel").val();if(typeof t!="undefined"&&(Zion.fn.Products.Hotel.Filters.Prices.From<=t&&t<=Zion.fn.Products.Hotel.Filters.Prices.To||t===0))return n})),Zion.fn.Products.Hotel.Filters.Category&&(n=$.grep(n,function(n){var t=$(n).find("input#categoryHotel").val();if(typeof t!="undefined"&&(t<10&&(t=t*10),Zion.fn.Products.Hotel.Filters.Category.From<=t&&t<=Zion.fn.Products.Hotel.Filters.Category.To))return n})),Zion.fn.Products.Hotel.Filters.TripAdvisor&&(n=$.grep(n,function(n){var t=$(n).find("input#reviewTA").val();if(typeof t!="undefined"&&Zion.fn.Products.Hotel.Filters.TripAdvisor.From<=t&&t<=Zion.fn.Products.Hotel.Filters.TripAdvisor.To)return n})),Zion.fn.Products.Hotel.Filters.Service&&(i=Zion.fn.Products.Hotel.Filters.Service.split(","),n=$.grep(n,function(n){var t=0;for(var r in i)i[r]!==""&&$(n).hasClass(i[r])&&t++;if(t===i.length)return n})),Zion.fn.Products.Hotel.Filters.MealPlan&&(t=Zion.fn.Products.Hotel.Filters.MealPlan.toUpperCase().split(","),t.indexOf("EP")!==-1&&t.indexOf("ZZ")===-1&&t.push("ZZ"),t.indexOf("ZZ")!==-1&&t.indexOf("EP")===-1&&t.push("EP"),n=$.grep(n,function(n){var i=0;for(var r in t)t[r]!==""&&$(n).hasClass(t[r])&&i++;if(i===t.length)return n})),Zion.fn.Products.Hotel.Filters.Location&&(r=Zion.fn.Products.Hotel.Filters.Location.toUpperCase().split(","),n=$.grep(n,function(n){for(var t in r)r[t]!==""&&$(n).hasClass(r[t])&&t++;if(t===r.length)return n})),Zion.fn.Products.Hotel.Filters.Chain&&(u=Zion.fn.Products.Hotel.Filters.Chain.split(","),n=$.grep(n,function(n){var t=0;for(var i in u)u[i]!==""&&$(n).hasClass(u[i])&&t++;if(t===u.length)return n})),Zion.fn.Products.Hotel.Filters.Type&&(f=Zion.fn.Products.Hotel.Filters.Type.split(","),n=$.grep(n,function(n){var t=0;for(var i in f)f[i]!==""&&$(n).hasClass(f[i])&&t++;if(t===f.length-1)return n})),n)};Zion.fn.Products.Hotel.LoadHotelShort=function(){var t,i,n;Zion.fn.Products.Hotel.orderValue={Recommendation:10,Price:7,Category:2,Name:1,Location:3,TripAdvisor:5};t=parseInt($("#EtOrLt").val());i=$("#EtStLt").val();Zion.fn.Products.Hotel.Order={Id:t,Direction:i};Zion.fn.Products.Hotel.ShortByLastMinuteCode=!1;n=0;$(filteredListOfferOfTheDay).each(function(){if($(this).find("input#"+ParametersKeys.LastMinuteCode).val()===n)return Zion.fn.Products.Hotel.ShortByLastMinuteCode=!0,!1});$(filteredListCoupon).each(function(){if($(this).find("input#"+ParametersKeys.LastMinuteCode).val()===n)return Zion.fn.Products.Hotel.ShortByLastMinuteCode=!0,!1});$(filteredList).each(function(){if($(this).find("input#"+ParametersKeys.LastMinuteCode).val()===n)return Zion.fn.Products.Hotel.ShortByLastMinuteCode=!0,!1})};Zion.fn.Products.Hotel.ShortFilteredHotelList=function(n){if(!n||n.length<=0)return[];Zion.fn.Products.Hotel.LoadHotelShort();Zion.fn.Products.Hotel.Order.Id===Zion.fn.Products.Hotel.orderValue.Name&&Zion.fn.Products.Hotel.Order.Direction.toUpperCase()==="ASC"?n=n.sort(function(n,t){var i,r;return i=$(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?"aaa"+$(n).find("input#hotelName").val():$(n).find("input#hotelName").val():"zzz"+$(n).find("input#hotelName").val(),r=$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?"aaa"+$(t).find("input#hotelName").val():$(t).find("input#hotelName").val():"zzz"+$(t).find("input#hotelName").val(),i.toUpperCase().localeCompare(r.toUpperCase())}):Zion.fn.Products.Hotel.Order.Id===Zion.fn.Products.Hotel.orderValue.Name&&Zion.fn.Products.Hotel.Order.Direction.toUpperCase()==="DESC"?n=n.sort(function(n,t){var i,r;return i=$(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?"zzz"+$(n).find("input#hotelName").val():$(n).find("input#hotelName").val():"aaa"+$(n).find("input#hotelName").val(),r=$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?"zzz"+$(t).find("input#hotelName").val():$(t).find("input#hotelName").val():"aaa"+$(t).find("input#hotelName").val(),r.toUpperCase().localeCompare(i.toUpperCase())}):Zion.fn.Products.Hotel.Order.Id===Zion.fn.Products.Hotel.orderValue.Category&&Zion.fn.Products.Hotel.Order.Direction.toUpperCase()==="ASC"?n=n.sort(function(n,t){var i,r;return $(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?(i=parseInt($(n).find("input#categoryHotel").val()),i<10&&(i=i*10),i=i/100):(i=parseInt($(n).find("input#categoryHotel").val()),i<10&&(i=i*10)):(i=parseInt($(n).find("input#categoryHotel").val()),i<10&&(i=i*10),i+=100),$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?(r=parseInt($(t).find("input#categoryHotel").val()),r<10&&(r=r*10),r=r/100):(r=parseInt($(t).find("input#categoryHotel").val()),r<10&&(r=r*10)):(r=parseInt($(t).find("input#categoryHotel").val()),r<10&&(r=r*10),r+=100),i-r}):Zion.fn.Products.Hotel.Order.Id===Zion.fn.Products.Hotel.orderValue.Category&&Zion.fn.Products.Hotel.Order.Direction.toUpperCase()==="DESC"?n=n.sort(function(n,t){var i,r;return $(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?(i=parseInt($(n).find("input#categoryHotel").val()),i<10&&(i=i*10),i+=100):(i=parseInt($(n).find("input#categoryHotel").val()),i<10&&(i=i*10)):(i=parseInt($(n).find("input#categoryHotel").val()),i<10&&(i=i*10),i=i/100),$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?(r=parseInt($(t).find("input#categoryHotel").val()),r<10&&(r=r*10),r+=100):(r=parseInt($(t).find("input#categoryHotel").val()),r<10&&(r=r*10)):(r=parseInt($(t).find("input#categoryHotel").val()),r<10&&(r=r*10),r=r/100),r-i}):Zion.fn.Products.Hotel.Order.Id===Zion.fn.Products.Hotel.orderValue.Location&&Zion.fn.Products.Hotel.Order.Direction.toUpperCase()==="ASC"?n=n.sort(function(n,t){var i,r;return i=$(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?"aaa"+$(n).find("input#cityHotel").val():$(n).find("input#cityHotel").val():"zzz"+$(n).find("input#cityHotel").val(),r=$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?"aaa"+$(t).find("input#cityHotel").val():$(t).find("input#cityHotel").val():"zzz"+$(t).find("input#cityHotel").val(),i.toUpperCase().localeCompare(r.toUpperCase())}):Zion.fn.Products.Hotel.Order.Id===Zion.fn.Products.Hotel.orderValue.Location&&Zion.fn.Products.Hotel.Order.Direction.toUpperCase()==="DESC"?n=n.sort(function(n,t){var i,r;return i=$(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?"zzz"+$(n).find("input#cityHotel").val():$(n).find("input#cityHotel").val():"aaa"+$(n).find("input#cityHotel").val(),r=$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?"zzz"+$(t).find("input#cityHotel").val():$(t).find("input#cityHotel").val():"aaa"+$(t).find("input#cityHotel").val(),r.toUpperCase().localeCompare(i.toUpperCase())}):Zion.fn.Products.Hotel.Order.Id===Zion.fn.Products.Hotel.orderValue.Price&&Zion.fn.Products.Hotel.Order.Direction.toUpperCase()==="ASC"?n=n.sort(function(n,t){var i,r;return i=$(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?parseFloat($(n).find("input#rateHotel").val())-1e6:parseFloat($(n).find("input#rateHotel").val()):parseFloat($(n).find("input#rateHotel").val())+1e6,r=$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?parseFloat($(t).find("input#rateHotel").val())-1e6:parseFloat($(t).find("input#rateHotel").val()):parseFloat($(t).find("input#rateHotel").val())+1e6,i-r}):Zion.fn.Products.Hotel.Order.Id===Zion.fn.Products.Hotel.orderValue.Price&&Zion.fn.Products.Hotel.Order.Direction.toUpperCase()==="DESC"?n=n.sort(function(n,t){var i,r;return i=$(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?parseFloat($(n).find("input#rateHotel").val())+1e6:parseFloat($(n).find("input#rateHotel").val()):parseFloat($(n).find("input#rateHotel").val())-1e6,r=$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?parseFloat($(t).find("input#rateHotel").val())+1e6:parseFloat($(t).find("input#rateHotel").val()):parseFloat($(t).find("input#rateHotel").val())-1e6,r-i}):Zion.fn.Products.Hotel.Order.Id===Zion.fn.Products.Hotel.orderValue.TripAdvisor&&Zion.fn.Products.Hotel.Order.Direction.toUpperCase()==="ASC"?n=n.sort(function(n,t){var i,r;return i=$(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?(parseFloat($(n).find("input#reviewTA").val())||8)-10:parseFloat($(n).find("input#reviewTA").val())||8:(parseFloat($(n).find("input#reviewTA").val())||8)+10,r=$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?(parseFloat($(t).find("input#reviewTA").val())||8)-10:parseFloat($(t).find("input#reviewTA").val())||8:(parseFloat($(t).find("input#reviewTA").val())||8)+10,i-r}):Zion.fn.Products.Hotel.Order.Id===Zion.fn.Products.Hotel.orderValue.TripAdvisor&&Zion.fn.Products.Hotel.Order.Direction.toUpperCase()==="DESC"?n=n.sort(function(n,t){var i,r;return i=$(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?(parseFloat($(n).find("input#reviewTA").val())||0)+10:parseFloat($(n).find("input#reviewTA").val())||0:(parseFloat($(n).find("input#reviewTA").val())||0)-10,r=$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?(parseFloat($(t).find("input#reviewTA").val())||0)+10:parseFloat($(t).find("input#reviewTA").val())||0:(parseFloat($(t).find("input#reviewTA").val())||0)-10,r-i}):Zion.fn.Products.Hotel.Order.Id===99||(n=n.sort(function(n,t){var i,r;return i=$(n).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(n).find("input#"+ParametersKeys.LastMinuteCode).val())?parseInt($(n).find("input#orderHotelRecommendation").val())-1e4:parseInt($(n).find("input#orderHotelRecommendation").val()):parseInt($(n).find("input#orderHotelRecommendation").val())+1e4,r=$(t).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()==="true"?parseInt($(t).find("input#"+ParametersKeys.LastMinuteCode).val())?parseInt($(t).find("input#orderHotelRecommendation").val())-1e4:parseInt($(t).find("input#orderHotelRecommendation").val()):parseInt($(t).find("input#orderHotelRecommendation").val())+1e4,i-r}))};Zion.fn.Products.Hotel.Filters.ShowHotels=function(n){Zion.fn.Products.Hotel.PhoneBanner===null?Zion.fn.Products.Hotel.PhoneBanner=$(".kgrid-row.kdo-product--secret-offer").first():Zion.fn.Products.Hotel.PhoneBanner;$("div#hotelListOfferOfTheDay").html($(filteredListOfferOfTheDay).css("display","none"));$("div#hotelListCoupon").html($(filteredListCoupon).css("display","none"));$("div#hotelList").html($(filteredList).css("display","none"));$(filteredListOfferOfTheDay).css("display","block");filteredListCoupon.length>0?($("#couponHeader").show(),$("#hotelListCoupon").show(),$(filteredListCoupon).css("display","block")):$("div#hotelListCoupon").length>0&&($("#couponHeader").hide(),$("#hotelListCoupon").hide());filteredList.length>0?($("#hotelsHeader").show(),$(filteredList).css("display","block")):$("#hotelsHeader").hide();Zion.fn.Products.Hotel.Filters.TotalMatches=filteredList.length+filteredListCoupon.length+filteredListOfferOfTheDay.length;Zion.fn.Products.Hotel.Filters.ShowMatchingResultsHotels();Zion.fn.Products.Hotel.Filters.HideLazyLoaderHotels();Zion.fn.Products.Hotel.InitializateImageLoader();Zion.fn.Products.Hotel.HotelListInfo.length===0&&Zion.fn.Products.Hotel.Filters.ShowNoResults();Zion.fn.Products.Hotel.ShowBanners(n,Zion.fn.Products.Hotel.PhoneBanner)};Zion.fn.Products.Hotel.PhoneBanner=null;Zion.fn.Products.Hotel.ShowBanners=function(n,t){var r,i;if(Zion.fn.Products.Hotel.PhoneBanner!==null)for(r=5,typeof Hotel.Model.RequestPage.Affiliate.Configuration.CollectionData.repeatbanner!="undefined"&&typeof Hotel.Model.RequestPage.Affiliate.Configuration.CollectionData.repeatbanner.State!="undefined"&&Hotel.Model.RequestPage.Affiliate.Configuration.CollectionData.repeatbanner.State===!0&&Hotel.Model.RequestPage.Affiliate.Configuration.CollectionData.repeatbanner.Value!==""&&(r=parseInt(Hotel.Model.RequestPage.Affiliate.Configuration.CollectionData.repeatbanner.Value)||5),i=0;i<$("div.Hotel.ProductBox").length;i++)(i+1)%r==0&&$($("div.Hotel.ProductBox")[i]).after(t.clone())};Zion.fn.Products.Hotel.Filters.ShowNoResults=function(){$("#showList").hasClass(":selected")?Zion.fn.Products.Hotel.Filters.TotalMatches===0?($("#HotelListWrap").hide(),$("#HotelMapInfo").hide(),$("#NoResultsHotels").show()):($("#HotelListWrap").hide(),$("#HotelMapInfo").show(),$("#NoResultsHotels").hide()):Zion.fn.Products.Hotel.Filters.TotalMatches===0?($("#HotelListWrap").hide(),$("#HotelMapInfo").hide(),$("#NoResultsHotels").show()):($("#HotelListWrap").show(),$("#HotelMapInfo").hide(),$("#NoResultsHotels").hide())};Zion.fn.Products.Hotel.Filters.ShowMatchingResultsHotels=function(){$("#HotelMatchingResults").html(Zion.fn.Products.Hotel.Filters.TotalMatches);$("#matchYourSearch").html(Zion.fn.Products.Hotel.Filters.TotalMatches)};Zion.fn.Products.Hotel.Filters.HideLazyLoaderHotels=function(){$("div.Hotel.ProductBox:visible").length>=Zion.fn.Products.Hotel.Filters.TotalMatches?$("#loadMoreHotels").css("display","none"):$("#loadMoreHotels").css("display","block")};Zion.fn.Products.Hotel.getCountServicesFilter=function(n){var t=0;return $(filteredListOfferOfTheDay).each(function(){$(this).hasClass(n)&&t++}),$(filteredListCoupon).each(function(){$(this).hasClass(n)&&t++}),$(filteredList).each(function(){$(this).hasClass(n)&&t++}),t};Zion.fn.Products.Hotel.fillCounterServiceFilter=function(){var i=$("input[type=checkbox].EtInpServiceHotel").map(function(){return $(this).val()}).get(),r,n,t;for(r in i)n=i[r],t=Zion.fn.Products.Hotel.getCountServicesFilter(n),t?$("#ServiceHotel"+n).removeAttr("disabled"):$("#ServiceHotel"+n).attr("disabled","disabled"),$("#ServiceCounter"+n).text(t);return!1};Zion.fn.Products.Hotel.getCountMealPlanFilter=function(n){var t=[n.toUpperCase()],i;return t.indexOf("EP")!==-1&&t.indexOf("ZZ")===-1&&t.push("ZZ"),t.indexOf("ZZ")!==-1&&t.indexOf("EP")===-1&&t.push("EP"),i=0,$(filteredListOfferOfTheDay).each(function(){for(var n in t)if($(this).hasClass(t[n].toUpperCase())){i++;break}}),$(filteredListCoupon).each(function(){for(var n in t)if($(this).hasClass(t[n].toUpperCase())){i++;break}}),$(filteredList).each(function(){for(var n in t)if($(this).hasClass(t[n].toUpperCase())){i++;break}}),i};Zion.fn.Products.Hotel.fillCounterMealPlanFilter=function(){var i=$("input[type=checkbox].EtInpMealplanHotel").map(function(){return $(this).val()}).get(),r,n,t;for(r in i)n=i[r],t=Zion.fn.Products.Hotel.getCountMealPlanFilter(n),t?$("#MealplanHotel"+n).removeAttr("disabled"):$("#MealplanHotel"+n).attr("disabled","disabled"),$("#MealplanCounter"+n).text(t);return!1};Zion.fn.Products.Hotel.getCountLocationFilter=function(n){var t=0;return $(filteredListOfferOfTheDay).each(function(){var i=$(this).find("input#cityHotel").val();i.toUpperCase()===n.toUpperCase()&&t++}),$(filteredListCoupon).each(function(){var i=$(this).find("input#cityHotel").val();i.toUpperCase()===n.toUpperCase()&&t++}),$(filteredList).each(function(){var i=$(this).find("input#cityHotel").val();i.toUpperCase()===n.toUpperCase()&&t++}),t};Zion.fn.Products.Hotel.fillCounterLocationFilter=function(){var i=$("input[type=checkbox].EtInpLocationHotel").map(function(){return $(this).val()}).get(),r,n,t;for(r in i)n=i[r],t=Zion.fn.Products.Hotel.getCountLocationFilter(n),t?$("#LocationHotel"+n).removeAttr("disabled"):$("#LocationHotel"+n).attr("disabled","disabled"),$("#LocationCounter"+n).text(t);return!1};Zion.fn.Products.Hotel.getCounterChainHotelFilter=function(n){var t=0;return $(filteredListOfferOfTheDay).each(function(){$(this).hasClass(n)&&t++}),$(filteredListCoupon).each(function(){$(this).hasClass(n)&&t++}),$(filteredList).each(function(){$(this).hasClass(n)&&t++}),t};Zion.fn.Products.Hotel.fillCounterChainHotelFilter=function(){var i=$("input[type=checkbox].EtInpChainHotel").map(function(){return $(this).val()}).get(),r,n,t;for(r in i)n=i[r],t=Zion.fn.Products.Hotel.getCounterChainHotelFilter(n),t?$("#ChainHotel"+n).removeAttr("disabled"):$("#ChainHotel"+n).attr("disabled","disabled"),$("#ChainHotelCounter"+n).text(t);return!1};Zion.fn.Products.Hotel.getCounterThemeFilter=function(n){var t=0;return $(filteredListOfferOfTheDay).each(function(){$(this).hasClass(n)&&t++}),$(filteredListCoupon).each(function(){$(this).hasClass(n)&&t++}),$(filteredList).each(function(){$(this).hasClass(n)&&t++}),t};Zion.fn.Products.Hotel.fillCounterThemeFilter=function(){var i=$("input[type=checkbox].EtInpTypeHotel").map(function(){return $(this).val()}).get(),r,n,t;for(r in i)n=i[r],t=Zion.fn.Products.Hotel.getCounterThemeFilter(n),t?$("#TypeHotel"+n).removeAttr("disabled"):$("#TypeHotel"+n).attr("disabled","disabled"),$("#TypeHotelCounter"+n).text(t);return!1};Zion.fn.Products.Hotel.fillAllCountersFilter=function(){Zion.fn.Products.Hotel.fillCounterServiceFilter();Zion.fn.Products.Hotel.fillCounterMealPlanFilter();Zion.fn.Products.Hotel.fillCounterLocationFilter();Zion.fn.Products.Hotel.fillCounterChainHotelFilter();Zion.fn.Products.Hotel.fillCounterThemeFilter()};Zion.fn.Products.Hotel.Filters.UpdateDynamicFilters=function(){var t,n,i,r,u,f,e,o;for($("#filtersDynamic .kdo-product-filters__filter","#productList").hide(),t=$("#EtChkServiceHotel input[type='checkbox']:checked"),n=0,n=0;n<t.length;n++)$("#ServiceHotel_Mark_"+$(t[n]).val()).show();for(i=$("input[type='checkbox']:checked","#EtChkMealplanHotel"),n=0;n<i.length;n++)$("#MealplanHotel_Mark_"+$(i[n]).val()).show();for(r=$("#EtChkLocationHotel input[type='checkbox']:checked"),n=0;n<r.length;n++)$("#LocationHotel_Mark_"+$(r[n]).val()).show();for(u=$("#EtChkChainHotel input[type='checkbox']:checked"),n=0;n<u.length;n++)$("#ChainHotel_Mark_"+$(u[n]).val()).show();for(f=$("#EtChkTypeHotel input[type='checkbox']:checked"),n=0;n<f.length;n++)$("#TypeHotel_Mark_"+$(f[n]).val()).show();e=$("#hotelIdFilter").val();o=Zion.fn.Products.Hotel.FindHotelName(e);e&&$("#nameFilter").html(o+"<i class='icono-error'><\/i>").show();t.length>0||i.length>0||r.length>0||u.length>0||f.length>0||e?$("#filtersDynamic").show():$("#filtersDynamic").hide()};Zion.fn.Products.Hotel.FindHotelName=function(n){HotelListInfo=$.map($("div.Hotel.ProductBox"),function(n){return hotelItem={Id:$(n).find("input[name='"+ParametersKeys.HotelID+"']").val(),Name:$(n).find("input[name='"+ParametersKeys.HotelNameFilter+"']").val()}});var t=HotelListInfo.filter(function(t){return t.Id===n});return t.length===0?"":t[0].Name};GMapsStatus={scriptstatus:"none",initmapstatus:"none",canvasid:"map-canvas"};Zion.fn.Products.Hotel.ListMap={};Zion.fn.Products.Hotel.HotelListInfo=[{Id:"",Name:"",Latitude:0,Longitude:0,Available:!1}];Zion.fn.Products.Hotel.ListMap.map=null;Zion.fn.Products.Hotel.ListMap.markerList=[];Zion.fn.Products.Hotel.ListMap.container="map-canvas";Zion.fn.Products.Hotel.ListMap.prefixInfoWindowId="Hotel";Zion.fn.Products.Hotel.ListMap.InitializeMap=function(){if(Zion.fn.Products.Hotel.HotelListInfo=[],Zion.fn.Products.Hotel.ListMap.FillHotelListInfo(filteredListOfferOfTheDay),Zion.fn.Products.Hotel.ListMap.FillHotelListInfo(filteredListCoupon),Zion.fn.Products.Hotel.ListMap.FillHotelListInfo(filteredList),Zion.fn.Products.Hotel.HotelListInfo.length===0){Zion.fn.Products.Hotel.Filters.ShowNoResults();return}GMapsStatus.scriptstatus==="loaded"?initGoogleMaps():setTimeout(initGoogleMaps,4e3);loadGoogleMapsScript()};Zion.fn.Products.Hotel.ListMap.addMarkerWithInfo=function(n){var t=new google.maps.Marker({animation:google.maps.Animation.DROP,draggable:!1,map:n.map,icon:n.available==="true"?"/_lib/Ktravel/img/Map/icon-HT-near.png":"/_lib/Ktravel/img/Map/inactive_map_icon.png",position:new google.maps.LatLng(n.latitude,n.longitude),title:n.title,itemContent:document.getElementById(Zion.fn.Products.Hotel.ListMap.prefixInfoWindowId+n.id)});google.maps.event.addListener(t,"click",function(){$(t.itemContent).show();var i=$(t.itemContent).find("input[name='"+ParametersKeys.HotelID+"']").first().val();Zion.fn.Products.Hotel.InitializateMapHotelIcon(i);n.infoWindow.setContent(t.itemContent);n.infoWindow.open(n.map,t)})};Zion.fn.Products.Hotel.ListMap.updateMarkers=function(n){var t=$.map(n.hotelList,function(n){return n.Id}),i,r;for(i in Zion.fn.Products.Hotel.ListMap.markerList)Zion.fn.Products.Hotel.ListMap.markerList[i].setMap(null);for(r in t)Zion.fn.Products.Hotel.ListMap.markerList[t[r]].setMap(Zion.fn.Products.Hotel.ListMap.map)};Zion.fn.Products.Hotel.ListMap.FillHotelListInfo=function(n){for(var t=0;t<n.length;t++)Zion.fn.Products.Hotel.HotelListInfo.push({Id:$(n[t]).find("input[name='"+ParametersKeys.HotelID+"']").val(),Name:$(n[t]).find("input[name='"+ParametersKeys.HotelNameFilter+"']").val(),Latitude:$(n[t]).find("input[name='Latitude']").val(),Longitude:$(n[t]).find("input[name='Longitude']").val(),Available:$(n[t]).find("input[name='"+ParametersKeys.HotelIsAvailable+"']").val()})};Hotel.GetInvalidChildrenAges=function(){$.each($(".childrenAges:visible"),function(n,t){$(t).css({"border-color":"gray","border-width":"1px","border-style":"solid"})});var n=$.grep($(".childrenAges:visible"),function(n){if($(n).val()==="")return $(this)});return n.length>0&&($("#ErrorMessage span").text(Resources.Pages.SpecifyAgesChildren),$("#ErrorMessage").show().delay(3e3).fadeOut()),$.each(n,function(n,t){$(t).css({"border-color":"red","border-width":"1px","border-style":"solid"})}),n};Hotel.search=function(){$("#EtHotelCoupon").remove();var n="",t=!1;$("#EtTypeSearch").val()==="L"?(resetFilters(),$("#EtHotelRate").val()===""||$("#EtHotelRate").val()==="0"?(t=!0,n="Filter",PostAJAX(t,n),copyToResume(),$("#hotelSearchBox").hide(),$("#searchSummary").show()):(showWait(),$("form","#hotelSearchBox").attr("action",Resources.General.HotelsRates+location.search).trigger("submit"))):$("#EtHotelRate").val()===""||$("#EtHotelRate").val()==="0"?($(".EtReturnListNav").unbind("click"),$(".EtReturnListNav").removeClass("EtReturnListNav"),t=!0,n="Filter",PostAJAX(t,n)):(showWait(),$("form","#hotelSearchBox").attr("action",Resources.General.HotelsRates+location.search).trigger("submit"));saveOnly($("#hotelSearchBox #Etdt,#hotelSearchBox #EtNRooms,#hotelSearchBox .AdultChildSelector select,#hotelSearchBox .EtNYears,#hotelSearchBox .EtInpDate,#hotelSearchBox input[name='"+ParametersKeys.CouponNetRate+"'],#hotelSearchBox input[name='"+ParametersKeys.PromoCouponCode+"']"))};$(document).ready(function(){$("#EtSearchHotels").click(function(n){n.preventDefault();var t=Hotel.GetInvalidChildrenAges();if(!(t.length>0))if(typeof Coupon!="undefined"&&typeof Coupon.Input!="undefined"&&Coupon.Input.val()){if(typeof Coupon.validateFormCoupon=="function"&&!Coupon.validateFormCoupon(Coupon.Input))return!1;Coupon.FirstLoad=!1;Coupon.getCoupon(Hotel.search,$("#hotelSearchBox form").serialize())}else $("#ErrorMessage").hide(),$("#ErrorMessage span").text(""),Hotel.search()});$(window).scroll(function(){$("#HotelBoxList").length>0&&$("#HotelBoxList").is(":visible")&&$("#loadMoreHotels").css("display")==="block"&&$(window).scrollTop()+$(window).height()>=$(document).height()-1&&(Zion.fn.Products.Hotel.Pagination.NumPage++,Zion.fn.Products.Hotel.Filters.ShowHotels(Zion.fn.Products.Hotel.Pagination.NumPage*Zion.fn.Products.Hotel.Pagination.TotalPeerPage))});$("#changeSearchResume").click(function(){$("#hotelSearchBox").show();$("#searchSummary").hide()})});$("#HotelProducts").on("change",".EtSelectOrder",function(){$("input[name='"+ParametersKeys.OrderList+"']").val($(this).val().split("|")[0]);$("input[name='"+ParametersKeys.SortList+"']").val($(this).val().split("|")[1]);Zion.fn.Products.Hotel.CleanFilters();Zion.fn.Products.Hotel.LoadFilters();Zion.fn.Products.Hotel.ApplyFilters()});$("#HotelProducts").on("click",".EtBtnReservation",function(){showWait()});$("#productList").on("click",".kdo-product__title-box a",function(n){var t=$(this).closest("article");$("section ._information",t).trigger("click");n.preventDefault()});$("#productList").on("click","figure img",function(n){var t=$(this).closest("section");$("._gallery",t).trigger("click");n.preventDefault()});$("#productList").on("click",".kdo-product-description .EtAvailability",function(n){var t=$(this).closest(".kdo-product-box__info-wrapper");$(".kdo-product-box__rates form .EtBtnReservation",t).trigger("click");n.preventDefault()});$("#productList").on("click","section.kdo-product-box__content .kdo-product--main-price",function(){$("form .EtBtnReservation",$(this).closest(".kdo-product-box__rates")).trigger("click")});$("#productList").on("click",".kdo-product-box__rates .EtAvailability",function(){showWait()});$("#productList").on("click",".EtSendPackage",function(n){n.preventDefault();$("#Et"+$(this).attr("id")).click()});$("#HotelProducts").on("click","#loadMoreHotels",function(){Zion.fn.Products.Hotel.Pagination.NumPage++;Zion.fn.Products.Hotel.Filters.ShowHotels(Zion.fn.Products.Hotel.Pagination.NumPage*Zion.fn.Products.Hotel.Pagination.TotalPeerPage)});$("#productList").on("click","#showMap, #showList",function(){this.id.toUpperCase()==="SHOWMAP"?(hideList(),showMap()):(hideMap(),showList())});$("#productList").on("click","form .btnViewRates",function(){showWait()});$("#productList").on("click","#filtersDynamic .kdo-product-filters__filter i",function(){var n=$(this).closest("span").attr("id").split("_"),t="#"+n[0]+(typeof n[2]=="undefined"?"":n[2]);if(t==="#nameFilter")return $(t).hide(),$("#hotelIdFilter","#EtHotelFilter").val(""),$("#EtHotelName").val(""),$("#EtHotelName").trigger("blur"),Zion.fn.Products.Hotel.CleanFilters(),Zion.fn.Products.Hotel.EnableAdvancedSearchControls(),Zion.fn.Products.Hotel.LoadFilters(),Zion.fn.Products.Hotel.ApplyFilters(),!1;$(t).trigger("click")});$("#filtersDynamic").on("click","#nameFilter i",function(){CleanFilters();Zion.fn.Products.Hotel.CleanFilters();Zion.fn.Products.Hotel.LoadFilters();Zion.fn.Products.Hotel.ApplyFilters()});Zion.fn.Products.Hotel.DisableAdvancedSearchControls=function(){$("#EtPriceRange").slider("disable");$("#EtCategoryRange").slider("disable");$("#EtTripAdvisorRange").slider("disable");$("input.EtInpServiceHotel").attr("disabled",!0);$("input.EtInpMealplanHotel").attr("disabled",!0);$("input.EtInpLocationHotel").attr("disabled",!0);$("input.EtInpChainHotel").attr("disabled",!0);$("input.EtInpTypeHotel").attr("disabled",!0)};Zion.fn.Products.Hotel.EnableAdvancedSearchControls=function(){$("#EtPriceRange").slider("enable");$("#EtCategoryRange").slider("enable");$("#EtTripAdvisorRange").slider("enable");$("input.EtInpServiceHotel").removeAttr("disabled");$("input.EtInpMealplanHotel").removeAttr("disabled");$("input.EtInpLocationHotel").removeAttr("disabled");$("input.EtInpChainHotel").removeAttr("disabled");$("input.EtInpTypeHotel").removeAttr("disabled")};$("#closeCoupon").on("click",function(){alert("close")});Zion.fn.Products.Hotel.InitializateMapHotelIcon=function(n){if(imageId="#HotelImage"+n,!$(imageId).hasClass("loaded")){$(imageId).addClass("loaded");var t=$(imageId).attr("data-original");$(imageId).css({opacity:"0"}).attr("src",t);$(imageId).animate({opacity:"1"})}};Hotel.Promo.tick=1e3;Hotel.Promo.EndPromoMessage=Resources.Pages.HotelMessagePromoEnd;Hotel.Promo.LabelMessageRemainder=Resources.Pages.HotelMessageRemain;Hotel.Promo.HotelMessageToTheEndThisPromo=Resources.Pages.HotelMessageToTheEndThisPromo;Hotel.Promo.isStarted=!1;Hotel.Promo.StartProccess=function(){$(".green-tab").each(function(){var n=$(this).closest(".Hotel").find("input[name='"+ParametersKeys.HotelID+"']").val();Hotel.Promo.StartPromo(n)})};Hotel.Promo.StopProccess=function(){Hotel.Promo.isStarted=!1};Hotel.Promo.StartPromo=function(n){Hotel.Promo.isStarted=!0;var t="promoTimer"+n,i=(new Date).getTime(),r=Hotel.Promo.parseTime($("#"+t).val());Hotel.Promo.runPromo(t,r,i)};Hotel.Promo.runPromo=function(n,t,i){if(Hotel.Promo.DisplayCounter(n,t),t<=0||!Hotel.Promo.isStarted)Hotel.Promo.DisplayCounter(n,Hotel.Promo.EndPromoMessage);else{var r=(new Date).getTime()-i;r>0&&r<3e3?(t-=Hotel.Promo.tick+r,i+=Hotel.Promo.tick,t<1?setTimeout("Hotel.Promo.runPromo('"+n+"', "+t+", "+i+" )",Hotel.Promo.tick+t):setTimeout("Hotel.Promo.runPromo('"+n+"', "+t+", "+i+" )",Math.max(1,Hotel.Promo.tick-r))):(i=(new Date).getTime()+Hotel.Promo.tick,t-=Hotel.Promo.tick,t<1?setTimeout("Hotel.Promo.runPromo('"+n+"', "+t+", "+i+" )",Hotel.Promo.tick+t):setTimeout("Hotel.Promo.runPromo('"+n+"', "+t+", "+i+" )",Hotel.Promo.tick))}};Hotel.Promo.DisplayCounter=function(n,t){var i=Hotel.Promo.timeFormat(t);i===""||i==="00:00:00"?($("#"+n).val("00:00:00"),$("#"+n+"_Label").html(Hotel.Promo.EndPromoMessage),Hotel.Promo.ClearPromoBox(n)):($("#"+n).val(i),$("#"+n+"_Label").html(Hotel.Promo.getPromoMessage(i)))};Hotel.Promo.getPromoMessage=function(n){return Hotel.Promo.LabelMessageRemainder+" <b>"+n+"<\/b> "+Hotel.Promo.HotelMessageToTheEndThisPromo};Hotel.Promo.ClearPromoBox=function(n){$("#"+n).closest(".green-tab").hide("slow");$("#"+n).closest(".Hotel").removeClass("green-item");$("#"+n).closest(".Hotel").find(".green-button").removeClass("green-button")};Hotel.Promo.parseTime=function(n){var t=n;t=t.split(":").reverse();var i=t[0],r=t[1],u=t[2];return i*1e3+r*6e4+u*36e5};Hotel.Promo.zeroFormat=function(n){return n<10?"0"+n:""+n};Hotel.Promo.timeFormat=function(n){if(n<0)return"00:00:00";var t=n+999,i=Hotel.Promo.zeroFormat(Math.floor(t/36e5)%60),r=Hotel.Promo.zeroFormat(Math.floor(t/6e4)%60),u=Hotel.Promo.zeroFormat(Math.floor(t/1e3)%60);return isNaN(i)||isNaN(r)||isNaN(u)?"":i+":"+r+":"+u};Hotel=window.Hotel||{};Hotel.Model=Hotel.Model||{};Hotel.Promo=Hotel.Promo||{};Hotel.Alerts=Hotel.Alerts||{};Hotel.Alerts.HotelIds=Hotel.Alerts.HotelIds||[];Hotel.Alerts.IndexLastHotelAlert=0;Hotel.Alerts.PositionLastHotelAlert=0;Hotel.Alerts.Event={};Hotel.Alerts.Url="/_AJAX/GetAlerts";Hotel.Alerts.GetLatestReservations=function(){return(Hotel.Alerts.IndexLastHotelAlert=0,Hotel.Alerts.PositionLastHotelAlert=0,Hotel.Alerts.HotelIds=[],$(".Hotel").each(function(){Hotel.Alerts.HotelIds.push($(this).find("input[name='"+ParametersKeys.HotelID+"']").val())}),Hotel.Alerts.HotelIds.length<=0)?!1:($(window).unbind("scroll",Hotel.Alerts.Event),$(window).scroll(Hotel.Alerts.Event),!1)};Hotel.Alerts.Event=function(){var n,t;Hotel.Alerts.HotelIds.length&&Hotel.Alerts.IndexLastHotelAlert<Hotel.Alerts.HotelIds.length&&(n=$("#LastReservationMessage"+Hotel.Alerts.HotelIds[Hotel.Alerts.IndexLastHotelAlert]).position(),Hotel.Alerts.PositionLastHotelAlert=n?n.top:0,window.scrollY>Hotel.Alerts.PositionLastHotelAlert&&(t=Hotel.Alerts.HotelIds.slice(Hotel.Alerts.IndexLastHotelAlert,Hotel.Alerts.IndexLastHotelAlert+50).join(","),Hotel.Alerts.IndexLastHotelAlert=Hotel.Alerts.IndexLastHotelAlert+50,t&&Hotel.Alerts.SendApiGetAlertsRequest(t)))};Hotel.Alerts.SendApiGetAlertsRequest=function(n){var t=['request={"Client":{"Affiliate":"'+Hotel.Model.RequestPage.Affiliate.Id+'","Language":"'+Hotel.Model.RequestPage.Quote.Language+'","Site":"ETE","Country":"'+Hotel.Model.RequestPage.Quote.Country.Code+'","Currency":"'+Hotel.Model.RequestPage.Quote.Currency.Id+'"},"Hotels":['+n+"]}"].join("");$.ajax({cache:!1,crossDomain:!0,dataType:"json",url:Hotel.Alerts.Url,data:t,contentType:"application/json;charset=utf-8",success:function(n){n.Alerts&&n.Alerts.length&&$(n.Alerts).each(function(){Hotel.Alerts.DisplayLastReservation($(this)[0])})},error:function(){}})};Hotel.Alerts.DisplayLastReservation=function(n){if(typeof n!="undefined"){var t=Hotel.Alerts.getHourLastReservation(n.Time);typeof t!="undefined"&&t!=""&&($("#LastReservationMessage"+n.Id).html("<i class='icono-cronometro'><\/i>&nbsp;"+Resources.Pages.HotelMessageLastReservationSince+"&nbsp;<b>"+t+"<\/b>"),$("#LastReservationMessage"+n.Id).fadeIn(1e3))}};Hotel.Alerts.parseTime=function(n){return new Date(parseInt(n.substr(6,18),10))};Hotel.Alerts.getHourLastReservation=function(n){return lastTime=Hotel.Alerts.parseTime(n),timeSince=Hotel.Alerts.hourSince(lastTime)};Hotel.Alerts.timeSince=function(){var r=1e3,t=r*60,i=t*60,u=i*24,e=new Date,n=e-last,s=Math.floor(n/u),f=Math.floor(n%u/i),o=Math.floor(n%i/t),h=Math.floor(n%t/r);return f>0?f+" "+Resources.Pages.Hours:o+" "+Resources.Pages.Minutes};Hotel.Alerts.hourSince=function(n){var i=Math.floor((new Date-n)/1e3),t=Math.floor(i/3600);return t>=1&&t<=24?t+" "+Resources.Pages.HoursAgo:(t=Math.floor(i/60),t>=1&&t<=60)?t+" "+Resources.Pages.MinutesAgo:(t=Math.floor(i),t>=1&&t<=60)?t+" "+Resources.Pages.SecondsAgo:""};Hotel.Alerts.Delay={oneSecond:1e3,twoSeconds:2e3,threeSeconds:3e3,fourSeconds:4e3,fiveSeconds:5e3,sixSeconds:6e3,sevenSeconds:7e3,eightSeconds:8e3,nineSeconds:9e3,tenSeconds:1e4};Hotel.Alerts.DelayAlert=Hotel.Alerts.Delay.eightSeconds;Hotel.Alerts.DelayFade=Hotel.Alerts.Delay.oneSecond;Hotel.Alerts.ShowRateAlerts=function(){var n=['request={"Client":{"Affiliate":"'+Hotel.Model.RequestPage.Affiliate.Id+'","Language":"'+Hotel.Model.RequestPage.Quote.Language+'","Site":"ETE","Country":"'+Hotel.Model.RequestPage.Quote.Country.Code+'","Currency":"'+Hotel.Model.RequestPage.Quote.Currency.Id+'"},"Hotels":['+Hotel.Model.RequestPage.Quote.Products[0].Id+"]}"].join("");$.ajax({cache:!1,dataType:"json",url:Hotel.Alerts.Url,data:n,contentType:"application/json;charset=utf-8",success:function(n){n.Alerts&&n.Alerts.length&&(Hotel.Alerts.DisplayRatePeopleCount(n.Alerts[0]),Hotel.Alerts.DisplayRateLastReservation(n.Alerts[0]))},error:function(){}})};Hotel.Alerts.DisplayPeopleSeeingHotel=function(){setTimeout(function(){$("#UrgencyMessagePeopleSeeingThisHotel").fadeIn(Hotel.Alerts.Delay.twoSeconds)},Hotel.Alerts.Delay.oneSecond);setTimeout(function(){$("#UrgencyMessagePeopleSeeingThisHotel").fadeOut(Hotel.Alerts.Delay.twoSeconds)},Hotel.Alerts.Delay.eightSeconds)};Hotel.Alerts.DisplayRateLastReservation=function(n){if(typeof n!="undefined"){var t=Hotel.Alerts.getHourLastReservation(n.Time);typeof t!="undefined"&&t!=""&&($("#UrgencyMessageLastReservation").html(Resources.Pages.HotelMessageLastReservationSince+"&nbsp;<b>"+t+"<\/b>"),setTimeout(function(){$("#UrgencyMessageLastReservationBox").fadeIn(Hotel.Alerts.Delay.twoSeconds)},Hotel.Alerts.Delay.fourSeconds),setTimeout(function(){$("#UrgencyMessageLastReservationBox").fadeOut(Hotel.Alerts.Delay.twoSeconds)},Hotel.Alerts.Delay.tenSeconds+Hotel.Alerts.Delay.oneSecond))}};Hotel.Alerts.DisplayRatePeopleCount=function(n){typeof n!="undefined"&&n.Count>1&&($("#UrgencyMessagePeopleCount").html(n.Count),$("#UrgencyMessagePeople").html("&nbsp;"+Resources.Pages.HotelMessageLastReservation),setTimeout(function(){$("#UrgencyMessagePeopleBox").fadeIn(Hotel.Alerts.Delay.twoSeconds)},Hotel.Alerts.Delay.eightSeconds),setTimeout(function(){$("#UrgencyMessagePeopleBox").fadeOut(Hotel.Alerts.Delay.twoSeconds)},Hotel.Alerts.Delay.tenSeconds+Hotel.Alerts.Delay.fourSeconds))};$("#hotelSearchBox #EtNRooms").change(function(){var n=$(this).val();for($("#hotelSearchBox .EtHab").hide(),z=1;z<=n;z++)$("#hotelSearchBox #EtHab"+z).show(),$("#hotelSearchBox #EtNumChild"+z).val(0);n==1?$("#lblRoomOne").hide():$("#lblRoomOne").show()});$("#hotelSearchBox .EtNumChild").change(function(){var r=$(this).attr("id"),i=$(this).val(),n=r.replace("EtNumChild",""),t;if(NameIndSel="EtPkNumAges"+n+"_Cbo",i>0){for($("#hotelSearchBox #EtBxAgeChild"+n+" .childrenAgesSelectors select").hide(),t="",x=1;x<=i;x++)$("#hotelSearchBox #"+NameIndSel+x).show(),t=t+$("#hotelSearchBox #"+NameIndSel+x).val()+",";$("#hotelSearchBox #EtBxAgeChild").show();$("#hotelSearchBox #EtBxAgeChild"+n).show();$("#hotelSearchBox #EtPkNumAges"+n).val(t)}else $("#hotelSearchBox #EtBxAgeChild").hide(),$("#hotelSearchBox #EtBxAgeChild"+n).hide()});$("#hotelSearchBox .childrenAgesSelectors select").change(function(){var i=$(this).attr("name"),n="",t="";$("#hotelSearchBox  #"+i+" .childrenAgesSelectors select").each(function(){$(this).is(":visible")&&(n=n+$(this).val()+",",t=$(this).attr("id"))});t=t.split("_")[0];n=n.substring(0,n.length-1);$("#hotelSearchBox #"+t).val(n)});$("#EtDateFromHotel, #EtDateToHotel").datepicker({showOn:"both",buttonImageOnly:!0,buttonText:"",minDate:Hotel.Settings.NumDias,numberOfMonths:2,showButtonPanel:!0,maxDate:"18M",firstDay:0,onSelect:function(){ObtieneISO("#"+this.id);this.id=="EtDateFromHotel"&&($("#EtDateToHotel").datepicker("option","minDate",ObtieneDays("#EtDateFromHotel","add",0)),$("#EtDateToHotel").datepicker("option","maxDate",ObtieneDays("#EtDateFromHotel","add",29)),ObtieneISO("#EtDateToHotel"))},beforeShow:function(){var n=Boolean($("#EtDateFromHotel").closest("#packageBxSearch").length);n?$("#EtDateToHotel").datepicker("option","minDate",ObtieneDays("#EtDateFromHotel","add",0)):$("#EtDateToHotel").datepicker("option","minDate",ObtieneDays("#EtDateFromHotel","add",0));$("#EtDateToHotel").datepicker("option","maxDate",ObtieneDays("#EtDateFromHotel","add",29));$("#EtDateToHotel").datepicker("getDate").getMonth()-$("#EtDateFromHotel").datepicker("getDate").getMonth()==1?$("#EtDateToHotel").datepicker("option","showCurrentAtPos",1):$("#EtDateToHotel").datepicker("option","showCurrentAtPos",0)},beforeShowDay:function(n){var i=$("#EtDateFromHotel").datepicker("getDate"),r=$("#EtDateToHotel").datepicker("getDate"),f=i.getDate()+" "+i.getMonth()+" "+i.getFullYear(),e=r.getDate()+" "+r.getMonth()+" "+r.getFullYear(),u=n.getDate()+" "+n.getMonth()+" "+n.getFullYear(),t="";return n>i&&n<r&&(t="Et_selectedDays"),u==f&&(t="Et_firstDay"),u==e&&(t="Et_lastDay"),u==f&&this.id=="EtDateToHotel"&&(t="Et_firstDay ui-datepicker-unselectable"),[!0,t,""]},onClose:function(){this.id=="EtDateFromHotel"&&$("#EtDateToHotel").datepicker("show")}});$("#EtDateFromHotel").closest("#packageBxSearch").length&&$("#EtDateFromHotel").datepicker("option","maxDate","18M");Hotel.Promo.tick=1e3;Hotel.Promo.EndPromoMessage=Resources.Pages.HotelMessagePromoEnd;Hotel.Promo.LabelMessageRemainder=Resources.Pages.HotelMessageRemain;Hotel.Promo.HotelMessageToTheEndThisPromo=Resources.Pages.HotelMessageToTheEndThisPromo;Hotel.Promo.isStarted=!1;Hotel.Promo.StartProccess=function(){$(".green-tab").each(function(){var n=$(this).closest(".Hotel").find("input[name='"+ParametersKeys.HotelID+"']").val();Hotel.Promo.StartPromo(n)})};Hotel.Promo.StopProccess=function(){Hotel.Promo.isStarted=!1};Hotel.Promo.StartPromo=function(n){Hotel.Promo.isStarted=!0;var t="promoTimer"+n,i=(new Date).getTime(),r=Hotel.Promo.parseTime($("#"+t).val());Hotel.Promo.runPromo(t,r,i)};Hotel.Promo.runPromo=function(n,t,i){if(Hotel.Promo.DisplayCounter(n,t),t<=0||!Hotel.Promo.isStarted)Hotel.Promo.DisplayCounter(n,Hotel.Promo.EndPromoMessage);else{var r=(new Date).getTime()-i;r>0&&r<3e3?(t-=Hotel.Promo.tick+r,i+=Hotel.Promo.tick,t<1?setTimeout("Hotel.Promo.runPromo('"+n+"', "+t+", "+i+" )",Hotel.Promo.tick+t):setTimeout("Hotel.Promo.runPromo('"+n+"', "+t+", "+i+" )",Math.max(1,Hotel.Promo.tick-r))):(i=(new Date).getTime()+Hotel.Promo.tick,t-=Hotel.Promo.tick,t<1?setTimeout("Hotel.Promo.runPromo('"+n+"', "+t+", "+i+" )",Hotel.Promo.tick+t):setTimeout("Hotel.Promo.runPromo('"+n+"', "+t+", "+i+" )",Hotel.Promo.tick))}};Hotel.Promo.DisplayCounter=function(n,t){var i=Hotel.Promo.timeFormat(t);i==""||i=="00:00:00"?($("#"+n).val("00:00:00"),$("#"+n+"_Label").html(Hotel.Promo.EndPromoMessage),Hotel.Promo.ClearPromoBox(n)):($("#"+n).val(i),$("#"+n+"_Label").html(Hotel.Promo.getPromoMessage(i)))};Hotel.Promo.getPromoMessage=function(n){return Hotel.Promo.LabelMessageRemainder+" <b>"+n+"<\/b> "+Hotel.Promo.HotelMessageToTheEndThisPromo};Hotel.Promo.ClearPromoBox=function(n){$("#"+n).closest(".green-tab").hide("slow");$("#"+n).closest(".Hotel").removeClass("green-item");$("#"+n).closest(".Hotel").find(".green-button").removeClass("green-button")};Hotel.Promo.parseTime=function(n){var t=n;t=t.split(":").reverse();var i=t[0],r=t[1],u=t[2];return i*1e3+r*6e4+u*36e5};Hotel.Promo.zeroFormat=function(n){return n<10?"0"+n:""+n};Hotel.Promo.timeFormat=function(n){if(n<0)return"00:00:00";var t=n+999,i=Hotel.Promo.zeroFormat(Math.floor(t/36e5)%60),r=Hotel.Promo.zeroFormat(Math.floor(t/6e4)%60),u=Hotel.Promo.zeroFormat(Math.floor(t/1e3)%60);return isNaN(i)||isNaN(r)||isNaN(u)?"":i+":"+r+":"+u}