jQuery(function($){function t(){return h&&$(window).width()>ultra_resp_menu_params.collapse||!h?($(".site-header").on("mouseenter",".main-navigation ul li",function(){var t=$(this),e=t.find("> ul");e.css({display:"block",opacity:0}).clearQueue().animate({opacity:1},250),e.data("final-opacity",1)}).on("mouseleave",".main-navigation ul li",function(){var t=$(this),e=t.find("> ul");e.clearQueue().animate({opacity:0},250,function(){0==e.data("final-opacity")&&e.css("display","none")}),e.data("final-opacity",0)}),!1):($(".site-header").off("mouseenter mouseleave").on("mouseenter mouseleave"),void $(".sub-menu").removeAttr("style"))}function e(){var t=jQuery(window).scrollTop(),e="no";jQuery(".panel-grid").each(function(){var a="#"+jQuery(this).attr("id"),i=jQuery(this).offset().top-2,n=jQuery(this).outerHeight(),s=i-u,o=i+n-u;return t>=s&&t<=o?(jQuery("#site-navigation .current").removeClass("current"),jQuery('#site-navigation a[href$="'+a+'"]').parent("li").addClass("current"),!1):void("no"==e&&jQuery("#site-navigation .current").removeClass("current"))})}function a(t,e){return{_selector:t,_breakpointWidth:e,_duration:500,_firstRun:!0,_forceToShow:!1,_animating:!1,_currentState:"",_startingState:"",_eventCb:{stateStart:!1,stateEnd:!1},_get:function(){return $(this._selector)},_getState:function(){return window.innerWidth>=this._breakpointWidth?"show":this._forceToShow?"force":"hide"},_setNewState:function(t,e){this._currentState!=t&&(e?this._startingState!=t&&(this._startingState=t,this._eventCb.stateStart&&this._eventCb.stateStart(t)):(this._currentState=t,this._eventCb.stateEnd&&this._eventCb.stateEnd(t)))},_hide:function(t){var e=this._get(),a=this,i={"margin-top":-e.height()+"px"};this._setNewState("hide",!0),t?(this._animating=!0,e.animate(i,{duration:this._duration,step:function(t,e){-a._get().height()!=e.end&&(e.end=-a._get().height())},done:function(){a._animating=!1,a._setNewState("hide"),a.adjust()}})):(e.css(i),this._setNewState("hide"))},_show:function(t){var e={"margin-top":"0px"},a=this,i=this._getState();this._setNewState(i,!0),t?(this._animating=!0,this._get().animate(e,{duration:this._duration,step:function(t,e){var i=-a._get().height();i!=e.start&&(e.start=i)},done:function(){a._animating=!1,a._setNewState(i),a.adjust()}})):(this._get().css(e),this._setNewState(i))},toggle:function(){switch(this._currentState){case"force":this._forceToShow=!1;break;case"hide":this._forceToShow=!0}this.adjust()},adjust:function(){if(this._animating)return this;if(this._firstRun){switch(this._getState()){case"hide":this._hide();break;default:this._show()}this._firstRun=!1}else{var t=this._getState();switch(t){case"hide":"hide"==this._currentState?this._hide():this._hide(!0);break;default:"hide"==this._currentState?this._show(!0):this._currentState!=t&&this._show()}}return this},getCurrentState:function(){return this._currentState},on:function(t,e){switch(t){case"statestart":this._eventCb.stateStart=e;break;case"stateend":this._eventCb.stateEnd=e;break;default:throw"unknown event: "+t}return this}}}"undefined"!=typeof $.fn.fitVids&&$(".entry-content, .entry-content .panel, .woocommerce #main").fitVids({ignore:".tableauViz"});var i=$(".main-navigation .mega-menu-wrap").length;i||($(window).load(t),$(window).resize(t)),jQuery(document).ready(function($){window.location.hash||($('#site-navigation a[href="'+window.location.href+'"]').parent("li").addClass("current-menu-item"),$(window).scroll(function(){$("#site-navigation ul li").hasClass("current")&&$("#site-navigation li").removeClass("current-menu-item")}))});var n=!1;$(document).click(function(){n||$(".menu-search form").fadeOut(250)}),$(document).on("click",".search-icon",function(){var t=$(this).parent();t.find("form").fadeToggle(250),setTimeout(function(){t.find("input[name=s]").focus()},300)}),$(document).on("mouseenter",".main-navigation .menu-search",function(){n=!0}).on("mouseleave",".main-navigation .menu-search",function(){n=!1}),$(".entry-content .flexslider:not(.metaslider .flexslider), #metaslider-demo.flexslider").flexslider({namespace:"flex-ultra-"}),$('body.full #main-slider[data-stretch="true"]').each(function(){var t=$(this);t.find(">div").css("max-width","100%"),t.find(".slides li").each(function(){var t=$(this),e=t.find("img.ms-default-image").eq(0);e.length||(e=t.find("img").eq(0)),t.css("background-image","url("+e.attr("src")+")"),e.css("visibility","hidden"),t.wrapInner('
');var a=t.find("a");a.length&&(t.mouseover(function(){t.css("cursor","hand")}),t.mouseout(function(){t.css("cursor","pointer")}),t.click(function(t){t.preventDefault();var e=$(t.target),i=e.is("a")?e:a;window.open(i.attr("href"),i.attr("target"))}))})});var s=window.devicePixelRatio?window.devicePixelRatio:1;s>1&&$("img[data-retina-image]").each(function(){var t=$(this);t.attr("src",t.data("retina-image")),"undefined"==typeof t.attr("width")&&t.load(function(){var e=[t.width(),t.height()];t.width(e[0]/2),t.height(e[1]/2)})});var o=$("body").hasClass("ultra-mobile-device"),r=$("body").hasClass("mobile-scroll-top");(!o&&$("#scroll-to-top").hasClass("scroll-to-top")||o&&r)&&($(window).scroll(function(){$(window).scrollTop()>150?$("#scroll-to-top").addClass("displayed"):$("#scroll-to-top").removeClass("displayed")}),$("#scroll-to-top").click(function(){return $("html, body").animate({scrollTop:"0px"}),!1}));var c=$("header").hasClass("scale"),o=$("body").hasClass("ultra-mobile-device"),l=$("body").hasClass("mobile-sticky-header"),h=$("header").hasClass("responsive-menu"),d=$("header").hasClass("sticky-header");if(isAdminBar=$("body").hasClass("admin-bar"),adminBarHeight=$("#wpadminbar").outerHeight(),(d&&!o||d&&o&&l)&&($(".site-header").hcSticky({responsive:!1,className:"is-stuck"}),c&&$(window).scroll(function(){$(this).scrollTop()>150?$(".site-header").addClass("scaled"):$(".site-header").removeClass("scaled")})),d&&isAdminBar&&jQuery(window).width()>600)if(c)var u=adminBarHeight+72;else var u=adminBarHeight+$("header").height()-3;else if(d)if(c)var u=72;else var u=$("header").height()-3;else var u=0;ultra_smooth_scroll_params.value&&(jQuery(document).ready(function(){jQuery('#site-navigation a[href*="#"]:not([href="#"]), .comments-link a[href*="#"]:not([href="#"]), .puro-scroll[href*="#"]:not([href="#"])').bind("click",function(){var t=this.hash,e=t.substring(1),a=this;if($("header *").removeClass("toggled"),jQuery(".panel-grid [id*="+e+"]").length>0?(jQuery("#site-navigation .current").removeClass("current"),jQuery(a).parent("li").addClass("current")):jQuery("#site-navigation .current").removeClass("current"),location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var i=jQuery(this.hash);if(i=i.length?i:jQuery("[name="+this.hash.slice(1)+"]"),i.length)return jQuery("html, body").animate({scrollTop:i.offset().top-u},1200),!1}})}),jQuery(window).load(function(){if(location.pathname.replace(/^\//,"")==window.location.pathname.replace(/^\//,"")&&location.hostname==window.location.hostname){var t=jQuery(window.location.hash);if(t.length)return $(document).scrollTop(0),jQuery("html, body").animate({scrollTop:t.offset().top-u},1200),!1}})),jQuery(window).on("scroll",e);var f=$(".top-bar-navigation .mega-menu-wrap").length;f||$("#top-bar").on("mouseenter",".top-bar-navigation ul li",function(){var t=$(this),e=t.find("> ul");e.css({display:"block",opacity:0}).clearQueue().animate({opacity:1},250),e.data("final-opacity",1)}).on("mouseleave",".top-bar-navigation ul li",function(){var t=$(this),e=t.find("> ul");e.clearQueue().animate({opacity:0},250,function(){0==e.data("final-opacity")&&e.css("display","none")}),e.data("final-opacity",0)}),$("body").hasClass("resp")&&$("body").hasClass("resp-top-bar"),$("body").hasClass("resp")&&$("body").hasClass("resp-top-bar")&&$(document).ready(function(){$(".top-bar-arrow").css("display","none");var t=a("#top-bar .container",ultra_resp_top_bar_params.collapse).on("stateend",function(t){switch(t){case"force":$(".top-bar-arrow").removeClass("show").addClass("close");break;case"hide":$(".top-bar-arrow").removeClass("close").addClass("show");break;default:$(".top-bar-arrow").removeClass("show").removeClass("close")}}).on("statestart",function(t){switch(t){case"force":$(".top-bar-arrow").css("display","");break;case"hide":$(".top-bar-arrow").css("display","");break;default:$(".top-bar-arrow").css("display","none")}}).adjust();window.onresize=function(){t.adjust()},$(".top-bar-arrow").on("click",function(){t.toggle()})}),("ontouchstart"in document.documentElement||window.navigator.msMaxTouchPoints||window.navigator.MaxTouchPoints)&&$("body").removeClass("no-touch"),$("body").hasClass("no-touch")||(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&$("body").css("cursor","pointer"),$(".site-navigation").find(".menu-item-has-children > a").each(function(){$(this).click(function(t){var e=$(this);t.stopPropagation(),e.parent().addClass("touch-drop"),e.hasClass("hover")?e.unbind("click"):(e.addClass("hover"),t.preventDefault()),$(".site-navigation > .menu-item-has-children:not(.touch-drop) > a").click(function(){e.removeClass("hover").parent().removeClass("touch-drop")}),$(document).click(function(){e.removeClass("hover").parent().removeClass("touch-drop")})})}))});