var ASQ=ASQ||{};(function(n){ASQ.Header={config:{headerContainer:"#header-container",searchButton:"#search-window-button",searchTextBox:"#search-window-term",urlHashInput:"#url-hash"},vars:{$searchButton:{},$searchTextBox:{},$urlHashInput:{}},bindElements:function(){var t=ASQ.Header;t.vars.$searchButton=n(t.config.headerContainer+" "+t.config.searchButton);t.vars.$searchTextBox=n(t.config.headerContainer+" "+t.config.searchTextBox);t.vars.$urlHashInput=n(t.config.headerContainer+" "+t.config.urlHashInput)},init:function(){var t=ASQ.Header;t.bindElements();t.vars.$searchButton.on("click",t.onSearchButtonClicked);t.vars.$searchTextBox.on("keydown",t.onSearchKeywordChanged);n(window).on("hashchange",t.setUrlHashInput);t.setUrlHashInput()},onSearchButtonClicked:function(t){var i=n.trim(ASQ.Header.vars.$searchTextBox.val());t.preventDefault();i&&(window.location=n(t.target).data("search-url")+i)},onSearchKeywordChanged:function(n){n.keyCode===13&&ASQ.Header.vars.$searchButton.click()},setUrlHashInput:function(){ASQ.Header.vars.$urlHashInput.val(window.location.hash)}};ASQ.Header.init()})(jQuery);ASQ=ASQ||{},function(n){ASQ.LibrarySearch={config:{searchContainer:".hero-section__search",searchButton:".search-box__button",searchTextBox:".search-box__input"},vars:{$searchButton:{},$searchTextBox:{}},bindElements:function(){var t=ASQ.LibrarySearch;t.vars.$searchButton=n(t.config.searchContainer+" "+t.config.searchButton);t.vars.$searchTextBox=n(t.config.searchContainer+" "+t.config.searchTextBox)},init:function(){var n=ASQ.LibrarySearch;n.bindElements();n.vars.$searchButton.on("click",n.onSearchButtonClicked);n.vars.$searchTextBox.on("keydown",n.onSearchKeywordChanged)},onSearchButtonClicked:function(t){var i=n.trim(ASQ.LibrarySearch.vars.$searchTextBox.val());t.preventDefault();i&&t.target&&(window.location=ASQ.LibrarySearch.vars.$searchButton.data("search-url")+i)},onSearchKeywordChanged:function(n){n.keyCode===13&&ASQ.LibrarySearch.vars.$searchButton.click()}};ASQ.LibrarySearch.init()}(jQuery);ASQ=ASQ||{},function(n){ASQ.LibraryItem={config:{addToCartUrl:"/wapi/shoppingcart/AddToCart",baseIdAttribute:"item-number",headerLogin:"header-login-link"},vars:{$addToCartButton:{},$baseLibraryItem:{},$cartButton:{},$headerCartItems:{},$headerBanner:{},$headerBannerCount:{},$headerBannerMessage:{},$headerBannerClose:{},$loginShortcut:{}},bindElements:function(){var t=ASQ.LibraryItem;t.vars.$baseLibraryItem=n("#library-item-container").first();t.vars.$addToCartButton=t.vars.$baseLibraryItem.find("#library-add-to-cart").first();t.vars.$headerCartItems=n("#asq-top-nav .amount");t.vars.$loginShortcut=n("#header-login-shortcut");t.vars.$cartButton=n(".js-cart-link");t.vars.$headerBanner=n(".js-alert-banner");t.vars.$headerBannerClose=n(".js-dismiss");t.vars.$headerBannerCount=n(".js-alert-banner__count");t.vars.$headerBannerMessage=n(".js-alert-banner__message")},init:function(){var t=ASQ.LibraryItem;t.bindElements();n(".js-toggle-carousel").cardCarousel();t.vars.$addToCartButton.on("click",t.onAddToCartClicked);t.vars.$loginShortcut.on("click",t.onLoginShortcutClicked)},onAddToCartClicked:function(t){var i=ASQ.LibraryItem,u=i.vars.$baseLibraryItem.data(i.config.baseIdAttribute),r;if(t.preventDefault(),r=n("input.js-agreement-cart"),r.length&&!r.is(":checked"))return alert(r.data("agreementwarning")),!1;n.ajax({type:"GET",url:i.config.addToCartUrl,data:{productCode:u},contentType:"application/json",dataType:"json"}).done(function(n){i.vars.$headerCartItems.text(n.TotalCartItems);i.vars.$headerBannerCount.text(n.TotalCartItems);i.vars.$headerBannerMessage.text(n.DisplayMessage);i.vars.$headerBanner.removeClass("-hidden").addClass("-shown");var t=window.setTimeout(function(){i.vars.$headerBanner.removeClass("-shown").addClass("-hidden")},1e4);i.vars.$cartButton.addClass("has-item");i.vars.$headerBannerClose.on("click.dismiss",function(n){n.preventDefault();window.clearTimeout(t);i.vars.$headerBanner.removeClass("-shown").addClass("-hidden")})}).fail(function(){})},onLoginShortcutClicked:function(){n("#"+ASQ.LibraryItem.config.headerLogin).click()}};ASQ.LibraryItem.init()}(jQuery)