$(function(){function e(){var e=$(this),t=e.find(".sectigo-dropdown-menu-wrap"),i=e.find(".sectigo-dropdown-menu");if(e.addClass("hover"),t.fadeIn(100),!t.hasClass("cols-4")){var a=e.outerWidth(),s=e.offset().left,n=o.outerWidth()+32,c=o.offset().left;s-=c;var l=s+a/2,d=i.outerWidth(),r=n-l,u=Math.ceil(r-d/2);u<0&&(u=0),i.css("left","auto"),i.css("right",u+"px")}}function t(){var e=$(this);e.find(".sectigo-dropdown-menu-wrap").fadeOut(100),setTimeout(function(){e.removeClass("hover")},100)}function i(e){e?(u.addClass("active").fadeIn(150),$("input[name=q]",v).focus(),setTimeout(function(){v.on("clickout",function(){i(!1)})},500)):(u.removeClass("active").fadeOut(150),v.off("clickout"))}var a=$(".main-nav-brands");$("li[data-toggle=dropdown]",a).hoverIntent(function(){var e=$(this);e.addClass("hover").find(".dropdown-menu").show()},function(){var e=$(this);e.find(".dropdown-menu").hide(),setTimeout(function(){e.removeClass("hover")},100)});var s=$(".sectigo-main-nav"),o=$(".sectigo-site-header__bottom > .container");$("li[data-toggle=dropdown]",s).hoverIntent({over:e,out:t,timeout:250});var n=$("html"),c=$(".mobile-nav"),l=$("#toggle-mobile-nav");$("li.has-sub-menu",c).addClass("collapsed").find("ul.sub-menu").hide(),l.click(function(e){e.preventDefault(),$(this).hasClass("is-active")?($(this).removeClass("is-active"),n.removeClass("active-mobile-nav"),$("a",c).attr("tabindex","-1")):($(this).addClass("is-active"),n.addClass("active-mobile-nav"),$("a",c).attr("tabindex","0"))}),$("a[data-toggle]",c).click(function(e){e.preventDefault();var t=$(this).parent("li");t.hasClass("collapsed")?t.removeClass("collapsed").find("ul.sub-menu").slideDown(150):t.addClass("collapsed").find("ul.sub-menu").slideUp(150)});var d=$(".sectigo-mobile-nav"),r=$("#toggle-sectigo-mobile-nav");r.click(function(e){e.preventDefault(),$(this).hasClass("is-active")?($(this).removeClass("is-active"),d.slideUp(150)):($(this).addClass("is-active"),d.slideDown(150))}),$(".main-item button",d).click(function(e){e.preventDefault();var t=$(this).attr("data-target"),i=$("ul.sub-"+t,d);$(this).hasClass("is-active")?($(this).removeClass("is-active"),i.slideUp(150)):($(this).addClass("is-active"),i.slideDown(150))}),$siteSearch=$("form.site-header__search"),$siteSearchField=$("input",$siteSearch),$("button",$siteSearch).click(function(e){if(e.preventDefault(),$siteSearch.hasClass("active")){var t=$siteSearchField.val();""!==t&&$siteSearch.submit()}else $siteSearch.addClass("active"),$siteSearchField.focus()}),$(document).mouseup(function(e){$siteSearch.is(e.target)||0!==$siteSearch.has(e.target).length||$siteSearch.removeClass("active")});var u=$(".search-overlay"),v=$("form",u);$(".show-mobile-search").click(function(e){e.preventDefault(),i(!0)}),$(".close-mobile-search").click(function(e){i(!1)}),$(document).keyup(function(e){27===e.keyCode&&u.hasClass("active")&&i(!1)}),$('a[href="#chat"]').click(function(e){e.preventDefault(),window.Helpdotcom.chat.maximize()}),$(".close-cookies-notice").click(function(e){e.preventDefault(),$(".cookie-notice").hide()}),$(".accept-cookies").click(function(e){e.preventDefault(),$(".cookie-notice").hide();var t={};t[window.csrfTokenName]=window.csrfTokenValue,$.ajax({url:"/actions/site-module/site/accept-cookies",cache:!1,data:t,type:"POST"})}),$(".utility-nav li.utility-dropdown").hoverIntent(function(){$(this).find(".utility-dropdown-options").fadeIn(50)},function(){$(this).find(".utility-dropdown-options").fadeOut(50)})});