function isIpad(){return navigator.platform.match(/iPad/i)!==null}function hideMenu(){currentMenu!==null&&($(".js-dropdown-menu",currentMenu).hide(),currentMenu=null);!isIpad()&&$(window).width()>=768&&$(".overlay").remove()}function loadSuggestWindow(n,t){$(n+" #suggest").load("/Search/Suggest?query="+encodeURI(t),function(){$(".overlay").length===0&&$("body").append('<div class="overlay" onclick="hideMenu()" />');canPerformSuggest=!0;var i=$("#prismicMenu .QueryText").val().trim();t!==i&&(searchTextChanged=!1,searchedText=i,loadSuggestWindow(n,i))})}function campaign(){var n="utm_campaign",t=function(n){for(var i,r=document.location.search.substring(1).split("&"),t=0;t<r.length;t++)if(i=r[t].split("="),n.toLowerCase()===i[0].toLowerCase())return i[1]},r=function(n,t,i){var r=new Date;r.setTime(r.getTime()+i*864e5);document.cookie=n+"="+t+"; expires="+r.toGMTString()+"; path=/;"},i;t(n)&&(i=t(n),r("campaign",i,30))}function passedPromotion(n){var i="pcode",u=function(n){for(var i,r=document.location.search.substring(1).split("&"),t=0;t<r.length;t++)if(i=r[t].split("="),n.toLowerCase()===i[0].toLowerCase())return i[1];return null},r=function(n,t){document.cookie=n+"="+t+"; path=/;"},f=function(n){for(var t,r=n+"=",f=decodeURIComponent(document.cookie),u=f.split(";"),i=0;i<u.length;i++){for(t=u[i];t.charAt(0)===" ";)t=t.substring(1);if(t.indexOf(r)===0)return t.substring(r.length,t.length)}return""},t;n===null||n===undefined?(n=u("pcode"),n!==null&&(n==="vip21"?r("SALE21",n):(t=f(i),t!==""?t.indexOf(n)===-1&&(t=t+","+n):t=n,r(i,t)))):r(i,n)}function initLoadingBtns(){$(".loading").click(function(){var n=$(this).data("loading-text");return $(this).attr("readonly","readonly").addClass("spinner").html(n+"&nbsp"),!0})}function scrolled(){document.body.clientHeight>1500&&(document.body.scrollTop>200||document.documentElement.scrollTop>200?(document.getElementById("scrollbtn").style.visibility="visible",document.getElementById("scrollbtn").style.opacity=1):(document.getElementById("scrollbtn").style.visibility="hidden",document.getElementById("scrollbtn").style.opacity=0))}function toTop(){typeof ga!="undefined"&&ga("send","event","Site","ScrollToTop","ScrollToTop");$("html, body").animate({scrollTop:0},500)}function initFactFinder(){$(".ffp").on("click",function(){var t=$(this).data("id"),i=$(this).data("masid"),n=$(this).data("q"),r=$(this).data("pos"),u=$(this).data("title"),f=$(this).data("campaign");(n===null||n===undefined)&&(n="*");$.post("/ff/p",{id:t,masterId:i,query:n,position:r,title:u,campaign:f})});$(".swatch-link").on("click",function(n){n.preventDefault();n.stopPropagation();var t=$(this).closest(".product-item"),i=$(this).data("id"),r=$(this).data("masid"),u=$(this).data("q"),f=$(this).data("pos"),e=$(this).data("title"),o=$(this).data("campaign");return t.find(">a").data("id",i),t.find(">a").data("masid",r),t.find(">a").data("q",u),t.find(">a").data("pos",f),t.find(">a").data("title",e),t.find(">a").data("campaign",o),!1})}function addFilter(n,t){n=n.replace(" ","_");var i=location.hash;i.length>1&&(i=removeFilter(n,t,!0));i.length>1&&(i+="&");i+=n+"="+t.toString().replace("&","%26").replace(" ","%20");typeof ga=="function"&&ga("send","event","SearchFilter","add"+t,n);location.hash=i}function removeFilter(n,t,r){var u,e,f;if(n=n.replace(" ","_"),u=location.hash,u.length>1&&(e=u.substring(1).split("&"),u="",e.length>0))for(i=0;i<e.length;i++)if(f=e[i].split("="),f[0]==="")continue;else if(f[0]===n)continue;else u.length>1&&(u+="&"),u+=f[0]+"="+f[1];if(r===!0)return u;typeof ga=="function"&&ga("send","event","SearchFilter","remove"+t,n);location.hash=u}function changeFilter(n,t){var i,r,u;console.log("Filter changed");i=$(t).find(":selected");i!=null&&(r=$(i).data("action"),u=$(i).data("value"),r==="add"&&addFilter(n,u),r==="remove"&&removeFilter(n))}function buildAndSubmitForm(){var o=document.getElementById("facetForm"),t,s,n,h,r,u,f,e;if(location.hash.length>1&&(t=location.hash,t.indexOf("?")!==-1&&(t=t.substring(0,t.indexOf("?"))),s=t.substring(1).split("&"),s.length>0))for(i=0;i<s.length;i++)if(n=s[i].split("="),n[0]==="")break;else h=decodeURIComponent(n[1]),h=h.replace("%26","&"),r=document.createElement("input"),r.id="filter_"+n[0],r.name="Filters.Index",r.value=i,r.type="hidden",u=document.createElement("input"),u.id="filter_"+n[0]+"0",u.name="Filters["+i+"].Name",u.value=n[0],u.type="hidden",f=document.createElement("input"),f.id="filter_"+n[0]+"1",f.name="Filters["+i+"].Values[0].Data",f.value=h,f.type="hidden",e=document.createElement("input"),e.id="filter_"+n[0]+"2",e.name="Filters["+i+"].Values[0].Type",e.value="and",e.type="hidden",o.appendChild(r),o.appendChild(u),o.appendChild(f),o.appendChild(e);$("#facetForm").submit()}var currentMenu,menuHidden,showPrismicMobileMenu;(function(n){function i(n,t){for(var i=window,r=(n||"").split(".");i&&r.length;)i=i[r.shift()];return typeof i=="function"?i:(t.push(n),Function.constructor.apply(null,t))}function u(n){return n==="GET"||n==="POST"}function o(n,t){u(t)||n.setRequestHeader("X-HTTP-Method-Override",t)}function s(t,i,r){var u;r.indexOf("application/x-javascript")===-1&&(u=(t.getAttribute("data-ajax-mode")||"").toUpperCase(),n(t.getAttribute("data-ajax-update")).each(function(t,r){switch(u){case"BEFORE":n(r).prepend(i);break;case"AFTER":n(r).append(i);break;case"REPLACE-WITH":n(r).replaceWith(i);break;default:n(r).html(i)}}))}function f(t,r){var e,h,f,c;(e=t.getAttribute("data-ajax-confirm"),!e||window.confirm(e))&&(h=n(t.getAttribute("data-ajax-loading")),c=parseInt(t.getAttribute("data-ajax-loading-duration"),10)||0,n.extend(r,{type:t.getAttribute("data-ajax-method")||undefined,url:t.getAttribute("data-ajax-url")||undefined,cache:(t.getAttribute("data-ajax-cache")||"").toLowerCase()==="true",beforeSend:function(n){var r;return o(n,f),r=i(t.getAttribute("data-ajax-begin"),["xhr"]).apply(t,arguments),r!==!1&&h.show(c),r},complete:function(){h.hide(c);i(t.getAttribute("data-ajax-complete"),["xhr","status"]).apply(t,arguments)},success:function(n,r,u){s(t,n,u.getResponseHeader("Content-Type")||"text/html");i(t.getAttribute("data-ajax-success"),["data","status","xhr"]).apply(t,arguments)},error:function(){i(t.getAttribute("data-ajax-failure"),["xhr","status","error"]).apply(t,arguments)}}),r.data.push({name:"X-Requested-With",value:"XMLHttpRequest"}),f=r.type.toUpperCase(),u(f)||(r.type="POST",r.data.push({name:"X-HTTP-Method-Override",value:f})),n.ajax(r))}function h(t){var i=n(t).data(e);return!i||!i.validate||i.validate()}var t="unobtrusiveAjaxClick",r="unobtrusiveAjaxClickTarget",e="unobtrusiveValidation";n(document).on("click","a[data-ajax=true]",function(n){n.preventDefault();f(this,{url:this.href,type:"GET",data:[]})});n(document).on("click","form[data-ajax=true] input[type=image]",function(i){var r=i.target.name,u=n(i.target),f=n(u.parents("form")[0]),e=u.offset();f.data(t,[{name:r+".x",value:Math.round(i.pageX-e.left)},{name:r+".y",value:Math.round(i.pageY-e.top)}]);setTimeout(function(){f.removeData(t)},0)});n(document).on("click","form[data-ajax=true] :submit",function(i){var f=i.currentTarget.name,e=n(i.target),u=n(e.parents("form")[0]);u.data(t,f?[{name:f,value:i.currentTarget.value}]:[]);u.data(r,e);setTimeout(function(){u.removeData(t);u.removeData(r)},0)});n(document).on("submit","form[data-ajax=true]",function(i){var e=n(this).data(t)||[],u=n(this).data(r),o=u&&(u.hasClass("cancel")||u.attr("formnovalidate")!==undefined);(i.preventDefault(),o||h(this))&&f(this,{url:this.action,type:this.method||"GET",data:e.concat(n(this).serializeArray())})})})(jQuery),function(n){n.fn.unveil=function(t,i){function o(){var t=u.filter(function(){var t=n(this);if(!t.is(":hidden")){var i=r.scrollTop(),e=i+r.height(),u=t.offset().top,o=u+t.height();return o>=i-f&&u<=e+f}});e=t.trigger("unveil");u=u.not(e)}var r=n(window),f=t||0,s=window.devicePixelRatio>1,h=s?"data-src-retina":"data-src",u=this,e;this.one("unveil",function(){var n=this.getAttribute(h);n=n||this.getAttribute("data-src");n&&(this.setAttribute("src",n),typeof i=="function"&&i.call(this))});r.on("scroll.unveil resize.unveil lookup.unveil",o);return o(),this}}(window.jQuery||window.Zepto);currentMenu=null;menuHidden=!1;$(".menu-cat > li").hover(function(){let n=!isIpad()&&window.outerWidth>=768;n&&($(".js-dropdown-menu",this).stop().fadeIn("fast"),$(this).find("img").trigger("unveil"),$("body").append('<div class="overlay" />'))},function(){!isIpad()&&window.outerWidth>=768&&($(".js-dropdown-menu",this).stop().fadeOut("fast"),$(".overlay").remove())});$(".js-has-dropdown").click(function(n){if((isIpad()||window.outerWidth<768)&&currentMenu!==this)return currentMenu!==null?($(".js-dropdown-menu",currentMenu).hide(),$(".js-dropdown-menu",this).show()):$(".js-dropdown-menu",this).fadeIn("fast"),$(this).find("img").trigger("unveil"),n.preventDefault(),currentMenu=this,!1});showPrismicMobileMenu=function(){$(".menu-cat").show();menuHidden=!1};$(".mobile-menu-close").click(function(){hideMenu();$(".menu-cat").hide();currentMenu=null;menuHidden=!0});$(".top-bar-hamburger").click(function(){showPrismicMobileMenu()});var suggestTimeout,canPerformSuggest=!0,searchTextChanged=!1,searchedText="";$(document).ready(function(){$(".menu-back").on("click",function(n){hideMenu();n.stopPropagation()});$(window).resize(function(){var n=$(window).width();n>=768&&menuHidden&&!isIpad()&&($(".menu-cat").show(),menuHidden=!1)});$.ajaxSetup({cache:!1});$("img").unveil();initLoadingBtns();$("#QueryText").keydown(function(n){n.keyCode===13&&$(this).parents("form:first").submit()});$(".b-site-search-mini input:submit").click(function(){$(this).parents("form").find(".js-active").length>0&&$(this).parents("form:first").submit()});typeof ga!="undefined"&&$("a[href^='tel:']").click(function(n){n.preventDefault();link=$(this).attr("href");tracklink=link.replace("tel:","");ga("send","event","Contact","Phone",tracklink);setTimeout(function(){window.location=link},300)});$("#prismicMenu .QueryText").data("suggest")==="True"&&($("#prismicMenu .QueryText").keyup(function(n){searchTextChanged=!0;var t=$("#prismicMenu .QueryText").val().trim();t.length>2&&canPerformSuggest&&n.which!==13&&t!==searchedText?(canPerformSuggest=!1,searchTextChanged=!1,searchedText=t,loadSuggestWindow("#prismicMenu",t)):$("#prismicMenu .QueryText").val().length<=2&&($(".suggestInner").fadeTo("slow",0),$(".overlay").remove())}),$("#prismicMenu .QueryText").focusout(function(){window.clearTimeout(suggestTimeout);$(".overlay").remove();suggestTimeout=window.setTimeout(function(){$(".suggestInner").fadeTo("slow",0)},500)}),$("#prismicMenu .QueryText").focusin(function(){hideMenu();window.clearTimeout(suggestTimeout);$("#prismicMenu .QueryText").val().length>2&&($(".suggestInner").fadeTo("fast",1),$(".overlay").length===0&&$("body").append('<div class="overlay" onclick="hideMenu()" />'))}));campaign();passedPromotion();window.onscroll=function(){scrolled()}}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t(require("jquery")):typeof define=="function"&&define.amd?define(["jquery"],t):(n=n||self,n.Util=t(n.jQuery))}(this,function(n){"use strict";function f(n){return{}.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase()}function e(){return{bindType:i,delegateType:i,handle:function(t){return n(t.target).is(this)?t.handleObj.handler.apply(this,arguments):undefined}}}function o(i){var u=this,r=!1;n(this).one(t.TRANSITION_END,function(){r=!0});return setTimeout(function(){r||t.triggerTransitionEnd(u)},i),this}function s(){n.fn.emulateTransitionEnd=o;n.event.special[t.TRANSITION_END]=e()}var t;n=n&&n.hasOwnProperty("default")?n["default"]:n;var i="transitionend",r=1e6,u=1e3;return t={TRANSITION_END:"bsTransitionEnd",getUID:function(n){do n+=~~(Math.random()*r);while(document.getElementById(n));return n},getSelectorFromElement:function(n){var t=n.getAttribute("data-target"),i;t&&t!=="#"||(i=n.getAttribute("href"),t=i&&i!=="#"?i.trim():"");try{return document.querySelector(t)?t:null}catch(r){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var i=n(t).css("transition-duration"),r=n(t).css("transition-delay"),f=parseFloat(i),e=parseFloat(r);return!f&&!e?0:(i=i.split(",")[0],r=r.split(",")[0],(parseFloat(i)+parseFloat(r))*u)},reflow:function(n){return n.offsetHeight},triggerTransitionEnd:function(t){n(t).trigger(i)},supportsTransitionEnd:function(){return Boolean(i)},isElement:function(n){return(n[0]||n).nodeType},typeCheckConfig:function(n,i,r){for(var u in r)if(Object.prototype.hasOwnProperty.call(r,u)){var o=r[u],e=i[u],s=e&&t.isElement(e)?"element":f(e);if(!new RegExp(o).test(s))throw new Error(n.toUpperCase()+": "+('Option "'+u+'" provided type "'+s+'" ')+('but expected type "'+o+'".'));}},findShadowRoot:function(n){if(!document.documentElement.attachShadow)return null;if(typeof n.getRootNode=="function"){var i=n.getRootNode();return i instanceof ShadowRoot?i:null}return n instanceof ShadowRoot?n:n.parentNode?t.findShadowRoot(n.parentNode):null}},s(),t});$(document).ready(function(){$(".ffr").on("click",function(){var n=$(this).data("sid"),t=$(this).data("id"),i=$(this).data("masid");$.post("/ff/r",{sourceId:n,id:t,masterId:i})});$("#suggest").on("click",".ffs",function(){var n=$(this).data("query"),t=$(this).data("input");$.post("/ff/s",{query:n,userInput:t})});$(".ffatb").on("click",function(){var t=$(this).data("id"),i=$(this).data("masid"),r=$(".ffq").val(),n=$(".ffpi").val(),u=$(this).data("price");n!==null&&n!==undefined&&n!==""&&$.post("/ff/b",{id:t,masterId:i,quantity:r,price:u})});window.addEventListener("hashchange",function(n){n.oldURL!==n.newURL&&buildAndSubmitForm()},!1);location.hash.length>1&&buildAndSubmitForm()})