function hideGlobalSpinner(){$(".interstitial-global").removeClass("state-active")}function showGlobalSpinner(){$(".interstitial-global").addClass("state-active")}function hideUpdatedGlobalSpinner(){$("#app-loader").hide()}function showUpdatedGlobalSpinner(){$("#app-loader").show()}function scrollToHashPosition(n){var u,t,f,i,r;return u=n,t=$('[scrollto-name="'+u+'"]'),t&&t.length>0?(f=$("html,body").offset().top*-1,i=t.offset().top,r=i-f,setTimeout(function(){inspirato.anchor.UpdateTabs=!0},1e3+r/4),$("html, body").animate({scrollTop:i},1e3+r/4)):void 0}function daysBetween(n,t){var i=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),r=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()),u=i-r;return u/864e5}var App,jsDropdowns,jsExpandables;App.Search=function(n,t){"use strict";function st(){r||w||ht()}function ht(n){ot=$.ajax({url:"/Resource/GetProductDataJson/",type:"Get",dataType:"json",contentType:"application/json;",xhrFields:{withCredentials:!0},success:function(t){t&&(r=t);w=!0;n&&n()}})}function b(){o.empty();i.hide();l.hide();u.removeClass("state-hasvalue")}function ct(n){switch(n.keyCode){case v.UP:it("previous",n);n.preventDefault();break;case v.DOWN:it("next",n);n.preventDefault();break;case v.ENTER:n.preventDefault();k(n);break;default:lt(n)}}function k(n){var t=t=n.type==="click"?$(this):i.find(".selected");t.length&&(f.val(t.data("text")),window.location=t.data("url"))}function lt(n){a&&clearTimeout(a);a=setTimeout(function(){var t=f.val();at(n,t)},50)}function d(n){for(var i="",t=0;t<n.length;t++)i+=et[n.charAt(t)]||n.charAt(t);return i}function g(n){var t=n.toLowerCase();return t=t.replace(/ +(?= )/g,""),t=t.trim(),t=t.replace(/,/g,""),t=t.replace(/\./g,""),t=t.replace(/\'/g,""),t=t.replace(/\’/g,""),d(t)}function nt(n,t){return d(n.slice(0,t.length)).toLowerCase()===t.toLowerCase()}function e(n,i){if(n===t||n===""||i===t||i==="")return!1;n=g(n);i=g(i);var r=n.indexOf(i),u=r===0,f=r>0&&n[r-1]===" ";return u||f?!0:!1}function at(n,t){if(r){var f=t.length>0;if(o.empty(),i.hide(),l.hide(),!f){u.removeClass("state-hasvalue");tt(t);return}s=_.filter(r.Destinations,function(n){return e(n.Name,t)});h=_.filter(r.Properties,function(n){var i=_.findWhere(r.Destinations,{Id:n.DestinationID}),u=e(n.Name,t);return u?!0:i&&i.Name?e(i.Name,t):!1});c=_.filter(r.Units,function(n){var i=_.findWhere(r.Destinations,{Id:n.Destination.Id}),u=e(n.Name,t),f=e(n.ResortName,t);return u||f?!0:i&&i.Name?e(i.Name,t):u});u.addClass("state-hasvalue");tt(t)}}function tt(n){var t="";s&&s.length&&(t+=p(s,"Destinations",n));h&&h.length&&(t+=p(h,"Hotels & Resorts",n,!1,!0));c&&c.length&&(t+=p(c,"Accommodations",n,!0));t!==""?(o.html(t).find('li:not(".result-header")').first().addClass("selected"),i.show()):n.length>0&&(o.empty(),l.show(),i.show())}function it(n){var u=i.find("li.result-item"),r=i.find("li.result-item.selected"),h=u.length,c=u.index(r),t,l,f,e,s;if(r.removeClass("selected"),t=0,n==="previous"?(t=c-1,t<0&&(t=0),r=u.eq(t)):(t=c+1,t>=h&&(t=h-1),r=u.eq(t)),r.addClass("selected"),l=o.get(0).scrollHeight>ut.height(),l){if(t===0){i.scrollTop(0);return}f=r.offset().top+r.outerHeight(!0);e=i.offset().top+i.outerHeight(!0);f>e&&i.scrollTop(i.scrollTop()+(f-e));s=r.offset().top-i.offset().top;s<0&&i.scrollTop(i.scrollTop()+s)}}function rt(n,t){var u=n.replace(/,/g,""),i,r;return nt(u,t)?(i=n.slice(0,t.length),r=n.slice(i.length,n.length)+" ","<span>"+i+"<\/span>"+r):n+" "}function y(n,t){var i,e,r;t=t.replace(/,/g,"");var o="",u=n.split(" "),f=t.split(" ");for(i=0;i<u.length;i++){for(r=0;r<f.length;r++)f[r]&&nt(u[i],f[r])&&(e=f[r]);o+=e?rt(u[i],e)+" ":u[i]+" "}return o}function p(n,t,i,u,f){var e='<li class="result-header">'+t+"<\/li>",o=i.indexOf(" ")>=0;return _.each(n,function(n){var l="",h,a="",v="",c="",t,o,s;u||f?(c=n.Name?n.Name:"",u?h=n.Destination.Id:f&&(h=n.DestinationID),t=_.findWhere(r.Destinations,{Id:h}),t&&(o=t.Name,o=y(o,i),l='<div class="destination-info">'+o+"<\/div>",n.Url||(n.Url=t.Url)),n.ResortName&&(s="",i.indexOf(" ")==0?s=rt(n.ResortName,i):s+=y(n.ResortName,i),a="<div class='resortname'>"+s+"<\/div>")):c=n.Name;v=y(c,i);var p=v+a+l,w=p.replace(/(<([^>]+)>)/ig,""),b=u?n.Url+"/":n.Url+"accommodations/";e+='<li class="result-item" data-url="'+b+'" data-text="'+w+'">'+p+"<\/li>"}),e}var u=n,vt=$(".js-search-btn"),ut=$(".js-search-container"),f=u.find(".search-input"),i=u.find(".search-results"),ft=u.find(".icon-clear-search"),o=u.find(".search-resultset"),l=i.find(".search-no-results"),a,v={DOWN:40,ENTER:13,UP:38},et={"á":"a","ã":"a","â":"a","Á":"A","Â":"A","è":"e","é":"e","É":"E","È":"E","í":"i","ñ":"n","Ñ":"n","ó":"o","Ó":"o","Ô":"o","ô":"o"},r=null,s,h,c,ot=null,w=!1;f.on("focus",st);f.on("keydown",ct);i.on("click",'li:not(".result-header")',k);ft.on("click",function(){b();f.val("").focus()});u.on("clear-search",function(){b();f.val("")})};App=App||{};App.Fn={Image:{Preload:function(n){$("<img />").attr("src",n).appendTo("body").css({display:"none"})}},Url:{GetQueryParamaters:function(){var n=location.search,t,i;return n!==undefined&&(n=n.toLowerCase(),t=n.replace("?","").split("&"),t!==undefined&&t.length>0&&(i=[],$.each(t,function(n,t){var r=t.split("=");r!==undefined&&r.length>0&&i.push({key:r[0],value:r[1]})}))),i},GetQueryParamaterByKey:function(n){var t=App.Fn.Url.GetQueryParamaters(),i;return n!==undefined&&t!==undefined&&t.length>0&&(n=n.toLowerCase(),$.each(t,function(t,r){if(r.key===n)return i=r,!1})),i}},Calculate:{AgeFor:function(n){if(n==="N/A")return n;try{var t=new Date,i=new Date(n),r=t.getFullYear()-i.getFullYear(),u=t.getMonth()-i.getMonth();return(u<0||u===0&&t.getDate()<i.getDate())&&r--,isNaN(r)?"N/A":r}catch(f){return"N/A"}},DaysBetween:function(n,t){if(n!=null&&t!=null){var i=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),r=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()),u=i-r;return u/864e5}return null},MonthsBetween:function(n,t){return App.Fn.Calculate.DaysBetween(n,t)/30},TimeBetweenDates:function(n,t){var i={Years:0,Months:0,Days:0,Hours:0,Minutes:0,Seconds:0};if(n&&t){var f=n.getTime()-t.getTime(),r=App.Fn.Parse.UtcDateAndTimeFromDate(new Date(f)),u=App.Fn.Parse.UtcDateAndTimeFromDate(new Date(0));i.Seconds=r.getSeconds()-u.getSeconds();i.Minutes=r.getMinutes()-u.getMinutes();i.Hours=r.getHours()-u.getHours();i.Days=r.getDate()-u.getDate();i.Months=r.getMonth()-u.getMonth();i.Years=r.getFullYear()-u.getFullYear()}return i},DateDiffBetweenCurrentDateAndOtherInDays:function(n){var i;if(n instanceof Date){var t=new Date,r=new Date(t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate()),u=parseInt(n.getTime()-r.getTime());i=Math.floor(u/864e5)}return i}},Cookie:{Set:function(n,t,i,r,u,f){var e=new Date,o;e.setTime(e.getTime());i&&(i=i*864e5);o=new Date(e.getTime()+i);document.cookie=n+"="+escape(t)+(i?";expires="+o.toGMTString():"")+(r?";path="+r:"")+(u?";domain="+u:"")+(f?";secure":"")},Get:function(n){var u=document.cookie.split(";"),t="",r="",f="",e=!1;for(i=0;i<u.length;i++){if(t=u[i].split("="),r=t[0].replace(/^\s+|\s+$/g,""),r==n)return e=!0,t.length>1&&(f=unescape(t[1].replace(/^\s+|\s+$/g,""))),f;t=null;r=""}if(!e)return null},Delete:function(n,t,i){t||(t="/");i||(i="");var r=this;r.Set(n,"",-1,t,i,"")}},Check:{IsDateAfterDate:function(n,t){return n.getFullYear()>t.getFullYear()||n.getFullYear()==t.getFullYear()&&n.getMonth()>t.getMonth()||n.getFullYear()==t.getFullYear()&&n.getMonth()==t.getMonth()&&n.getDate()>t.getDate()},IsDateBeforeDate:function(n,t){return n.getFullYear()<t.getFullYear()||n.getFullYear()==t.getFullYear()&&n.getMonth()<t.getMonth()||n.getFullYear()==t.getFullYear()&&n.getMonth()==t.getMonth()&&n.getDate()<t.getDate()},IsDateTheSame:function(n,t){return this.IsDateEqualDate(n,t)},IsDateEqualDate:function(n,t){return n&&t?n.getFullYear()==t.getFullYear()&&n.getMonth()==t.getMonth()&&n.getDate()==t.getDate():!1},IsDateWithinDates:function(n,t,i){if(n&&t&&i){var r=n.getFullYear()>t.getFullYear()||n.getFullYear()==t.getFullYear()&&n.getMonth()>t.getMonth()||n.getFullYear()==t.getFullYear()&&n.getMonth()==t.getMonth()&&n.getDate()>=t.getDate(),u=n.getFullYear()<i.getFullYear()||n.getFullYear()==i.getFullYear()&&n.getMonth()<i.getMonth()||n.getFullYear()==i.getFullYear()&&n.getMonth()==i.getMonth()&&n.getDate()<=i.getDate();return r&&u}return!1}},FormatStr:{Currency:function(n,t,i){var u,r;for(n=App.Fn.Parse.Float(n),u=typeof t!="undefined"&&t?"$":"",n=n.toString().replace(/\$|\,/g,""),isNaN(n)&&(n="0"),sign=n==(n=Math.abs(n)),n=Math.floor(n*100+.50000000001),cents=n%100,n=Math.floor(n/100).toString(),cents<10&&(cents="0"+cents),r=0;r<Math.floor((n.length-(1+r))/3);r++)n=n.substring(0,n.length-(4*r+3))+","+n.substring(n.length-(4*r+3));return i?(sign?"":"-")+u+n:(sign?"":"-")+u+n+"."+cents},Date:function(n){return typeof n=="object"?n.getMonth()+1+"/"+n.getDate()+"/"+n.getFullYear():""},DateLongStr:function(n){return this.DateLongString(n)},DateLongString:function(n){return typeof n=="object"?App.Vars.MonthArr[n.getMonth()]+" "+n.getDate()+", "+n.getFullYear():""},DateAndTime:function(n){var t=this;return t.Date(n)+" "+t.Time(n)},FromArray:function(n,t){var i="",r;return typeof n=="object"&&n!=null&&n.length>0&&((typeof t=="undefined"||t==null||t=="")&&(t=","),r=n.length,$.each(n,function(n,u){i+=u;i+=n<r-1?t:""})),i},Percent:function(n){return n=App.Fn.Parse.Float(n),n=Math.round(n*1e4)/100,n.toString()+"%"},Time:function(n){if(typeof n=="object"){var t=n.getHours()>=12?"pm":"am",i=n.getHours()<=12?n.getHours()==0?12:n.getHours():n.getHours()-12,r=n.getMinutes()<10?"0"+n.getMinutes():n.getMinutes();return i+":"+r+" "+t}return""},ConvertJsonDate:function(n){var i=new RegExp("/Date[/(](-?\\d+)[/)]/"),t=new Date(parseInt(n.replace(i,"$1"),10));return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}},Date:{Format:function(n){if(App.Fn.Date.IsValid(n)){try{var t=n.getMonth()+1,i=n.getDate(),r=n.getFullYear()}catch(u){return u}return t+"/"+i+"/"+r}return"N/A"},IsValid:function(n){return Object.prototype.toString.call(n)==="[object Date]"?isNaN(n.getTime())?!1:!0:!1}},Array:{ArrayChunker:function(n,t){if(n.length==0)return[];var i=n.slice(0,t),r=n.slice(t);return[i].concat(App.Fn.Array.ArrayChunker(r,t))}},GlobalDataHelper:{GetDestinationFromID:function(n){var i=App.Fn.Parse.Int(n),t=null;return App.Vars.Data.Destinations!=null&&$.each(App.Vars.Data.Destinations,function(n,r){if(r.LocationID==i)return t=r,!1}),t},GetDestinationNameFromID:function(n){var t=this.GetDestinationFromID(n);return t!=null?t.Name:""},GetRegionFromID:function(n){var i=App.Fn.Parse.Int(n),t=null;return App.Vars.Data.Regions!=null&&$.each(App.Vars.Data.Regions,function(n,r){if(r.ID==i)return t=r,!1}),t},GetRegionNameFromID:function(n){var t=this.GetRegionFromID(n);return t!=null?t.Name:""},GetVacationStyleFromID:function(n){var i=App.Fn.Parse.Int(n),t=null;return App.Vars.Data.UnitStyles!=null&&$.each(App.Vars.Data.UnitStyles,function(n,r){if(r.UnitStyleID==i)return t=r,!1}),t},GetVacationTypeNameFromID:function(n){var t=this.GetVacationStyleFromID(n);return t!=null?t.Name:""}},Validate:{Int:function(n){return App.Fn.Parse.Int(n)!=null},DateStr:function(n){var t=/^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(n);if(t==null)return!1;var r=t[2],u=t[1]-1,f=t[3],i=new Date(f,u,r);return i.getDate()==r&&i.getMonth()==u&&i.getFullYear()==f},Email:function(n){var r=!1,i,t;return this.String(n)&&(i=n.indexOf("@"),i>=0&&(t=n.substring(i+1),r=t.indexOf("@")==-1&&t.indexOf(".")>0&&t.indexOf("..")==-1&&t.lastIndexOf(".")+1<t.length)),r},EmailList:function(n){for(var i=n.split(/[,:;]+/),t=0;t<i.length;t++)if(i[t]!=""&&!App.Fn.Validate.Email(i[t]))return!1;return!0},EmailAddress:function(n){return this.Email(n)},Float:function(n){return App.Fn.Parse.Float(n)!=null},Number:function(n){return this.Float(n)||this.Int(n)},ObjectIsNull:function(n){return this.ObjectIsNullOrUndefined(n)},ObjectIsNullOrUndefined:function(n){return typeof(typeof n=="undefined"||n==null)},Str:function(n){return this.String(n)},String:function(n){return typeof n=="string"},StrIsNullOrEmpty:function(n){var t=typeof n!="string"||n==null||n=="",i,r;if(!t)for(t=!0,i=0,r=n.length;i<r;i++)if(n[i]!=" "){t=!1;break}return t}},Parse:{Array:function(n,t){var i=[];return typeof n!="undefined"&&App.Fn.Validate.Str(n.toString())&&n!=""&&((typeof t=="undefined"||t==null||t=="")&&(t=","),i=n.toString().split(t)),i},Int:function(n){var t=this.Float(n);return t!=null?Math.floor(t):null},DateFromStr:function(n){var i=null,t;if(App.Fn.Validate.DateStr(n)&&(t=/^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/.exec(n),t!=null)){var r=t[2],u=t[1]-1,f=t[3];i=new Date(f,u,r)}return i},DateFromDotNet:function(n){return this.DateFromDotNetDate(n)},DateFromDotNetDate:function(n){var t=/-?\d+/.exec(n);return new Date(parseInt(t[0]))},Float:function(n){var i=null,r,t;return typeof n!="undefined"&&(typeof n=="number"?i=parseFloat(n):typeof n=="string"&&(r=n.indexOf("-")==0,t=n.replace(/[^0-9\.]/g,""),t=r&&t!=""?"-"+t:t,i=t!=""?parseFloat(t):0,i=this.RoundDecimal(i))),i},FormatNumber:function(n,t){var t=t||"",i;for(n+="",x=n.split("."),x1=x[0],x2=x.length>1?"."+x[1]:".00",x2=x2.length<3?x2+"0":x2,i=/(\d+)(\d{3})/;i.test(x1);)x1=x1.replace(i,"$1,$2");return t+x1},FormatDate:function(n){if(App.Fn.Parse.IsValidDate(n)){try{var t=n.getMonth()+1,i=n.getDate(),r=n.getFullYear()}catch(u){return u}return t+"/"+i+"/"+r}return"N/A"},IsValidDate:function(n){return Object.prototype.toString.call(n)==="[object Date]"?isNaN(n.getTime())?!1:!0:!1},GetParameterByName:function(n){var t="",i;try{i=App.Fn.Url.GetQueryParamaterByKey(n);t=i.value}catch(r){}return t},PercentAsDecimal:function(n){var t=0,i=this.Float(n);return i!=null&&(t=i/100),t},RoundDecimal:function(n){return Math.round(n*100)/100},UtcDateFromStr:function(n){var t=this.DateFromStr(n);return this.UtcDateFromDate(t)},UtcDateFromDate:function(n){var t=null;return typeof n=="string"&&(n=this.DateFromStr(n)),typeof n!="undefined"&&n!=null&&(t=new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate())),t},UtcDateFromDotNet:function(n){return this.UtcDateFromDotNetDate(n)},UtcDateFromDotNetDate:function(n){var t=this.DateFromDotNetDate(n);return this.UtcDateFromDate(t)},UtcDateRangeFromDotNetDateRange:function(n){var t=null;return n!=null&&n.length>0&&(t=[],$.each(n,function(n,i){var r=App.Fn.Parse.UtcDateFromDotNetDate(i.Start),u=App.Fn.Parse.UtcDateFromDotNetDate(i.End);t.push({Start:r,End:u})})),t},UtcDateAndTimeFromStr:function(n){var t=this.DateFromStr(n);return this.UtcDateAndTimeFromDate(t)},UtcDateAndTimeFromDate:function(n){var i=null,t;return typeof n=="string"&&(t=this.DateFromStr(n)),typeof n!="undefined"&&n!=null&&t&&(i=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds())),i},UtcDateAndTimeFromDotNet:function(n){return this.UtcDateAndTimeFromDotNetDate(n)},UtcDateAndTimeFromDotNetDate:function(n){var t=this.DateFromDotNetDate(n);return this.UtcDateAndTimeFromDate(t)},DateTimeFromDayMomthYearHoursMinutesAMPM:function(n,t,i,r){var u=moment(n+" "+t+":"+i+" "+r,"MM-DD-YYYY hh:mm A");return u.toDate()}},BindingDataHelper:{FixSelectZIndex:function(n){var i=$(this).attr("id")+"-menu",t=$("#"+i).closest(".ui-selectmenu-menu");t.css({"z-index":"10"});$(window).scroll(function(){var i=$(n.target),u,r;i.hasClass("ui-selectmenu")||(i=i.closest(".ui-selectmenu"));u=i.closest(".dynamic-container");r=i.position().top+i.outerHeight(!0);u.css("position")=="fixed"&&(r=$(window).scrollTop()+i.position().top+i.outerHeight(!0)+4);t.css({top:r})})}},Trigger:{ShowGlobalInterstitial:function(){typeof newDestinationPageRedesignEnabled=="undefined"||newDestinationPageRedesignEnabled===!1?showGlobalSpinner():showUpdatedGlobalSpinner()},HideGlobalInterstitial:function(){typeof newDestinationPageRedesignEnabled=="undefined"||newDestinationPageRedesignEnabled===!1?hideGlobalSpinner():hideUpdatedGlobalSpinner()},ErrorMsg:function(n,t){var i=$("#error"),r=typeof n!="undefined"&&n!="",u=typeof t!="undefined"&&t!="";r||u||i.find(".header-hr span").html("There was an error");r&&i.find(".header-hr span").html(n);u&&i.find(".modal-content-container .column").html(t);history&&history.pushState&&(this.HideGlobalInterstitial(),i.addClass("active"))}},PageLayout:{Get:{CurrentStyleBreakpoint:function(){var n,t=$(".stylebreakpoint").css("content");if(t!==undefined){t=t.replace(/"/g,"");switch(t){case"default":n=App.Enums.Stylebreakpoints.Default;break;case"small":n=App.Enums.Stylebreakpoints.Small;break;case"medium":n=App.Enums.Stylebreakpoints.Medium;break;case"large":n=App.Enums.Stylebreakpoints.Large;break;default:n=App.Enums.Stylebreakpoints.Default}}else n=App.Enums.Stylebreakpoints.Default;return n}}},Select2:{FormatCurrency:function(n){return n.id?"<div class='icon-"+n.text.toLowerCase().replace(/ /g,"-").replace(/["'(),]/g,"")+"'>"+n.text+"<\/div>":n.text},FormatCurrencySelection:function(n){return n.id?"<div class='icon-"+n.text.toLowerCase().replace(/ /g,"-").replace(/["'(),]/g,"")+"'>"+n.text+"<\/div>":n.text},FormatState:function(n){return n.id?"<div class='icon-"+n.text.toLowerCase().replace(/ /g,"-").replace(/["'(),]/g,"")+"'>"+n.text+"<\/div>":n.text},FormatStateSelection:function(n){return n.id?"<div class='icon-"+n.text.toLowerCase().replace(/ /g,"-").replace(/["'(),]/g,"")+"'> <\/div>":n.text}},IEplaceholders:function(){jQuery().placeholder&&$("input, textarea").placeholder()},InputMasks:function(){$("[data-val-date]").mask("99/99/9999",{placeholder:" "})}};$(document).ready(function(){App.Fn.IEplaceholders()});jsDropdowns=function(n){function f(t){t.addClass("open");n.addClass("main-header--navigation-is-active");$(document).on("click.js-dropdown",function(n){var t=$(n.target),i=t.parents(".js-dropdown").length>0,u=t.hasClass("ui-datepicker-next")||t.hasClass("ui-datepicker-prev");i||u||r()})}function r(){$(document).off("click.js-dropdown");i.removeClass("open");n.removeClass("main-header--navigation-is-active")}function e(t){$(document).off("click.js-dropdown");t.removeClass("open");n.removeClass("main-header--navigation-is-active")}function u(n){n.hasClass("open")?e(n):(r(),f(n))}var i=$(".js-dropdown",n),t=!1;i.on("touchend click",".js-dropdown-trigger",function(n){var i=$(this).closest(".js-dropdown"),r=i.hasClass("js-dropdown--touch-only");n.type==="touchend"?(r&&n.preventDefault(),t=!0,u(i)):n.type!=="click"||t?t=!1:u(i)})};jsExpandables=function(n){var t=$(".js-expandable",n);t.on("click",".js-expandable-trigger",function(){var n=$(this).closest(".js-expandable");n.toggleClass("open")})},function(){function c(){t.hasClass("open")?u():(l(),a())}function l(){t.addClass("open");e.addClass("primary-navigation--open");n.addClass("main-header--navigation-open")}function u(){t.removeClass("open");e.removeClass("primary-navigation--open");n.removeClass("main-header--navigation-open")}function a(){$(document).on("click.mobile-nav-dropdown",function(n){var t=$(n.target),i=t.closest(".primary-navigation").length>0||t.closest(".main-header__navigation-button").length>0;i||u()})}function y(){r.hasClass("main-header__quicksearch--open")?h():(s(),f.focus())}function s(){r.addClass("main-header__quicksearch--open");n.addClass("main-header--navigation-is-active")}function h(){r.removeClass("main-header__quicksearch--open");n.removeClass("main-header--navigation-is-active")}function p(){return i&&(i.hasClass("quicksearch-clear")||i.parents(".main-header__quicksearch").length>0)}function w(n){return $.ajax({url:"/Inventory/ChangeProductMode/",data:{accountProductID:n},contentType:"application/x-www-form-urlencoded",dataType:"json",type:"GET"})}var n=$("#main-header"),i;jsDropdowns(n);jsExpandables(n);var t=n.find(".main-header__navigation-button"),e=n.find(".primary-navigation"),o=window.innerWidth;t.on("click",function(n){c();n.preventDefault()});$(window).bind("resize",function(){window.innerWidth!==o&&(t.hasClass("open")&&u(),o=window.innerWidth)});var v=n.find(".main-header__search-button"),r=n.find(".main-header__quicksearch"),f=r.find(".search-input");v.on("click.quicksearch",y);f.on("focus",s);f.on("blur",function(){p()||h()});$(document).mousedown(function(n){i=$(n.target)});$(document).mouseup(function(){i=null});n.on("click",".account-products__account-product-link",function(){w($(this).data("product-id")).then(function(){document.location.reload(!0)})});new App.Search($(".quicksearch-container"))}();$(function(){var n=$(".dropdown-highlight-arrow");$(".main-nav").off("mousenter",".navdropdown");$(".main-nav").on("mouseenter",".navdropdown",function(){var t=$(this),i=t.width(),r=t.position().left+i/2;n.css({left:r,display:"block"})});$(".main-nav").off("mouseleave",".navdropdown");$(".main-nav").on("mouseleave",".navdropdown",function(){n.hide()});$(".expired-payment-banner__close").on("click",function(){$.ajax({url:"/Account/HideExpiredPaymentBanner/",dataType:"json",type:"GET"}).done(function(){$("#expire-payment-header").addClass("hidden")})})})