// source --> https://www.jura-repetitorium-nachhilfe.de/wp-content/themes/weaver-xtreme/assets/js/weaverxjslib.min.js?ver=1763984741 
var agent=navigator.userAgent;function weaverxBrowserWidth(){var e=768;return"number"==typeof window.innerWidth?e=window.innerWidth:document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?e=document.documentElement.clientWidth:document.body&&(document.body.clientWidth||document.body.clientHeight)&&(e=document.body.clientWidth),e}function weaverxOnResize(){var e;void 0!==wvrxOpts.menuAltswitch&&null!==wvrxOpts.menuAltswitch||(wvrxOpts.menuAltswitch=767),e=weaverxBrowserWidth();var t=jQuery("body");e<=wvrxOpts.menuAltswitch?(t.addClass("is-menu-mobile"),t.removeClass("is-menu-desktop")):(t.addClass("is-menu-desktop"),t.removeClass("is-menu-mobile")),wvrxOpts.menuAltswitch<=767&&e>wvrxOpts.menuAltswitch&&t.removeClass("is-menu-default"),e>767&&t.addClass("is-menu-default");var i="is-weaver is-desktop";e>=768?(t.removeClass("is-weaver is-phone is-smalltablet is-mobile"),i="is-weaver is-desktop"):e>580?(t.removeClass("is-weaver is-phone is-desktop"),i="is-weaver is-smalltablet is-mobile"):(t.removeClass("is-weaver is-desktop is-smalltablet"),i="is-weaver is-phone is-mobile");var n=navigator.userAgent;n.match(/Safari/i)&&!n.match(/Chrome/i)&&(t.removeClass("wvrx-not-safari"),t.addClass("wvrx-is-safari")),(n.match(/iPad/i)||n.match(/iPhone/i)||n.match(/iPod/i))&&(i+=" is-ios",n.match(/iPad/i)&&(i+=" is-ipad is-not-pados"),n.match(/iPod/i)&&(i+=" is-ipod"),n.match(/iPhone/i)&&(i+=" is-iphone")),n.match(/Android/i)&&(i+=" is-android"),n.match(/Windows/i)&&(i+=" is-windows"),n.match(/Macintosh/i)&&(navigator.maxTouchPoints>1?i+=" is-ios is-ipad is-pados":i+=" is-macos"),t.addClass(i),jQuery(".wvrx_fixedtop").wvrx_fixWvrxFixedTop()}agent.match(/Safari/i)&&!agent.match(/Chrome/i)&&jQuery(document).ready(weaverxOnResize),window.jQuery,function(e){function t(e){var t=e.__resizeTriggers__,i=t.firstElementChild,n=t.lastElementChild,s=i.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,s.style.width=i.offsetWidth+1+"px",s.style.height=i.offsetHeight+1+"px",i.scrollLeft=i.scrollWidth,i.scrollTop=i.scrollHeight}function i(e){var i=this;t(this),this.__resizeRAF__&&d(this.__resizeRAF__),this.__resizeRAF__=l((function(){(function(e){return e.offsetWidth!=e.__resizeLast__.width||e.offsetHeight!=e.__resizeLast__.height})(i)&&(i.__resizeLast__.width=i.offsetWidth,i.__resizeLast__.height=i.offsetHeight,i.__resizeListeners__.forEach((function(t){t.call(i,e)})))}))}var n,s,o=document.attachEvent,a=!1,r=e.fn.resizeX;if(e.fn.resizeX=function(e){return this.each((function(){this==window?r.call(jQuery(this),e):addResizeListener(this,e)}))},e.fn.removeResize=function(e){return this.each((function(){removeResizeListener(this,e)}))},!o){var l=(s=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,20)},function(e){return s(e)}),d=(n=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout,function(e){return n(e)}),u=!1,c="",m="animationstart",h="Webkit Moz O ms".split(" "),g="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),v="",p=document.createElement("fakeelement");if(void 0!==p.style.animationName&&(u=!0),!1===u)for(var w=0;w<h.length;w++)if(void 0!==p.style[h[w]+"AnimationName"]){(v=h[w])+"Animation",c="-"+v.toLowerCase()+"-",m=g[w],u=!0;break}var f="resizeanim",_="@"+c+"keyframes "+f+" { from { opacity: 0; } to { opacity: 0; } } ",b=c+"animation: 1ms "+f+"; "}window.addResizeListener=function(e,n){o?e.attachEvent("onresize",n):(e.__resizeTriggers__||("static"==getComputedStyle(e).position&&(e.style.position="relative"),function(){if(!a){var e=(_||"")+".resize-triggers { "+(b||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),t.appendChild(i),a=!0}}(),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=document.createElement("div")).className="resize-triggers",e.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',e.appendChild(e.__resizeTriggers__),t(e),e.addEventListener("scroll",i,!0),m&&e.__resizeTriggers__.addEventListener(m,(function(i){i.animationName==f&&t(e)}))),e.__resizeListeners__.push(n))},window.removeResizeListener=function(e,t){o?e.detachEvent("onresize",t):(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.removeEventListener("scroll",i),e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)))}}(jQuery),Object.create||(Object.create=function(){function e(){}return function(t){if(1!=arguments.length)throw new Error("Object.create implementation only accepts one parameter.");return e.prototype=t,new e}}()),function(e,t,i){"use strict";var n={options:{mobileBreakpoint:768,hideToggle:!1,toggleButtonID:"menu-toggle-button",hoverClass:"menu-hover",arrowClass:"menu-arrows",mobileClass:"is-mobile-menu",hideMobileClass:"is-hidden",hasSubmenuClass:"has-submenu",openSubmenuClass:"is-open-submenu",toggleSubmenuClass:"toggle-submenu"},init:function(t,i){var n,s=this;s.el=e(t),s.isTouch=!1,n=s.options=e.extend({},s.options,i),s.initContainer(),s.initToggleButton(),s.el.addClass(n.arrowClass).find("ul").parent().addClass(n.hasSubmenuClass).children("a").attr("aria-haspopup",!0).append('<span class="'+n.toggleSubmenuClass+'"></span>'),s.el.on("click","."+n.toggleSubmenuClass,(function(e){s.el.hasClass(n.mobileClass)&&(e.preventDefault(),s.toggleSubmenu(this))})),s.toggleMobile(),e("#wrapper").resizeX((function(){s.toggleMobile()}))},initContainer:function(){this.container=this.el.closest(".wvrx-menu-container"),this.container.length<1&&(this.container=this.el.wrap('<div class="wvrx-menu-container"></div>').parent())},initToggleButton:function(){var t=this,i=t.options;t.toggleButton=e("#"+i.toggleButtonID),t.toggleButton.length<1&&(i.hideToggle?t.toggleButton=t.container.find("#"+i.toggleButtonID).hide():"undefined"!=typeof wvrxOpts&&""===wvrxOpts.mobileAltLabel?t.toggleButton=t.container.prepend('<div id="'+i.toggleButtonID+'" class="menu-toggle-button genericon genericon-wvrx-menu" alt="open menu"></div>').find("#"+i.toggleButtonID).hide():t.toggleButton=t.container.prepend('<div id="'+i.toggleButtonID+'" class="menu-toggle-button menu-toggle-menu" alt="open menu">'+wvrxOpts.mobileAltLabel+"</div>").find("#"+i.toggleButtonID).hide()),t.toggleButton.on("click",(function(){t.el.toggleClass(i.hideMobileClass)})),t.el.find("a").click((function(){0===e(this).children("span.toggle-submenu").length&&t.el.toggleClass(i.hideMobileClass)}))},toggleMobile:function(){var e,t=this.options;(e=weaverxBrowserWidth())<t.mobileBreakpoint&&!this.el.hasClass(t.mobileClass)&&(this.toggleButton.show(),this.el.addClass(t.mobileClass).addClass(t.hideMobileClass).removeClass(t.hoverClass)),e>=t.mobileBreakpoint&&this.el.hasClass(t.mobileClass)&&(this.toggleButton.hide(),this.el.removeClass(t.hideMobileClass).removeClass(t.mobileClass),this.isTouch||this.el.addClass(t.hoverClass).find("."+t.openSubmenuClass).removeClass(t.openSubmenuClass))},toggleSubmenu:function(t){var i=this.options,n=e(t).closest("."+i.hasSubmenuClass);n.toggleClass(i.openSubmenuClass).parent().find("."+i.openSubmenuClass).not(n).removeClass(i.openSubmenuClass)}};e.fn.thmfdnMenu=function(e){return this.each((function(){Object.create(n).init(this,e)}))}}(jQuery,window),function(e){if("undefined"==typeof wvrxOpts||"0"==wvrxOpts.useSmartMenus){var t="ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,i=/iPad|iPod|iPhone/.test(navigator.platform)&&"matchMedia"in window,n="li:has(ul) > a";(t||i)&&weaverxBrowserWidth()>767&&e(document).ready((function(){e(n).each((function(){var t=e(this);t.data("dataNoclick",!1),t.bind("touchstart",(function(){var i=!t.data("dataNoclick");e(n).each((function(){e(this).data("dataNoclick",!1)})),t.data("dataNoclick",i),t.focus()})),t.bind("click",(function(e){t.data("dataNoclick")&&e.preventDefault(),t.focus()}))})),e("li li li:not(:has(ul)) > a").each((function(){e(this).bind("touchstart",(function(){window.location=this.href}))}))}))}}(jQuery),function(e){"use strict";e.fn.wvrx_fixWvrxFixedTop=function(){var t,i=0,n="#nav-secondary .wvrx-fixedtop",s="#nav-primary .wvrx-fixedtop";"undefined"==typeof wvrxOpts||"1"!=wvrxOpts.primaryMove&&"1"!=wvrxOpts.secondaryMove||(s="#nav-secondary .wvrx-fixedtop",n="#nav-primary .wvrx-fixedtop"),e("body").hasClass("admin-bar")&&(i=e("#wpadminbar").outerHeight(),e(window).width()<600&&e("#wpadminbar").css("position","fixed")),t=i;var o=0,a=e("#inject_fixedtop.wvrx-fixedtop").outerHeight()-1;if(a>0&&(e("#inject_fixedtop.wvrx-fixedtop").css("top",i),o=o+a+i,i=0),(a=e(n).outerHeight()-1)>0&&(e(n).css("top",o+i),o=o+a+i,i=0),(a=e("#header-widget-area.wvrx-fixedtop").outerHeight()-1)>0&&(e("#header-widget-area.wvrx-fixedtop").css("top",o+i),o=o+a+i,i=0),(a=e(s).outerHeight()-1)>0&&(e(s).css("top",o+i),o=o+a+i,i=0),o>0)e("body").css("margin-top",o-1-t);else{var r=e(".wvrx-fixedtop").outerHeight();r>0&&(e("body").css("margin-top",r+i),i>0&&e(".wvrx-fixedtop").css("top",i))}var l=e("#inject_fixedbottom").outerHeight();0!==l&&e("body").css("margin-bottom",l)},e(".widget .menu-extra").length&&e(".widget .menu-extra").each((function(){e(this).closest(".widget").css("overflow","visible"),e(this).closest(".widget-area").css("overflow","visible")}))}(window.jQuery),jQuery(window).scroll((function(){var e=jQuery(window).scrollTop();jQuery("#header.header-as-bg-parallax").css("background-position-y",e+"px")})),jQuery((function(e){e(".wrapper").resizeX(weaverxOnResize),"undefined"!=typeof wvrxOpts&&"0"==wvrxOpts.useSmartMenus&&(e("#nav-primary .weaverx-theme-menu").thmfdnMenu({toggleButtonID:"primary-toggle-button"}),e("#nav-secondary .weaverx-theme-menu").thmfdnMenu({toggleButtonID:"secondary-toggle-button"}))})),jQuery(document).on("wp-custom-header-video-loaded",(function(){"undefined"!=typeof wvrxOpts&&jQuery("body").addClass(wvrxOpts.headerVideoClass)}));
// source --> https://www.jura-repetitorium-nachhilfe.de/wp-content/themes/weaver-xtreme/assets/js/smartmenus/jquery.smartmenus.min.js?ver=1763984741 
!function(t){var i=[],e=!!window.createPopup,s=!1,o=!1;function n(e){var n=".smartmenus_mouse";if(o||e)o&&e&&(t(document).unbind(n),o=!1);else{var u=!0,l=null;t(document).bind(h([["mousemove",function(e){var o={x:e.pageX,y:e.pageY,timeStamp:(new Date).getTime()};if(l){var n=Math.abs(l.x-o.x),a=Math.abs(l.y-o.y);if((n>0||a>0)&&n<=2&&a<=2&&o.timeStamp-l.timeStamp<=300&&(s=!0,u)){var r=t(e.target).closest("a");r.is("a")&&t.each(i,(function(){if(t.contains(this.$root[0],r[0]))return this.itemEnter({currentTarget:r[0]}),!1})),u=!1}}l=o}],[r()?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut",function(t){a(t.originalEvent)&&(s=!1)}]],n)),o=!0}}function a(t){return!/^(4|mouse)$/.test(t.pointerType)}function r(){return"ontouchstart"in window}function h(i,e){e||(e="");var s={};return t.each(i,(function(t,i){s[i[0].split(" ").join(e+" ")+e]=i[1]})),s}t.SmartMenus=function(i,e){this.$root=t(i),this.opts=e,this.rootId="",this.$subArrow=null,this.subMenus=[],this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.zIndexInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.isTouchScrolling=!1,this.init()},t.extend(t.SmartMenus,{hideAll:function(){t.each(i,(function(){this.menuHideAll()}))},destroy:function(){for(;i.length;)i[0].destroy();n(!0)},prototype:{init:function(e){var s=this;if(!e){i.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var o=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).bind(h([["mouseover focusin",t.proxy(this.rootOver,this)],["mouseout focusout",t.proxy(this.rootOut,this)]],o)).delegate("a",h([["mouseenter",t.proxy(this.itemEnter,this)],["mouseleave",t.proxy(this.itemLeave,this)],["mousedown",t.proxy(this.itemDown,this)],["focus",t.proxy(this.itemFocus,this)],["blur",t.proxy(this.itemBlur,this)],["click",t.proxy(this.itemClick,this)],["touchend",t.proxy(this.itemTouchEnd,this)]],o)),o+=this.rootId,this.opts.hideOnClick&&t(document).bind(h([["touchstart",t.proxy(this.docTouchStart,this)],["touchmove",t.proxy(this.docTouchMove,this)],["touchend",t.proxy(this.docTouchEnd,this)],["click",t.proxy(this.docClick,this)]],o)),t(window).bind(h([["resize orientationchange",t.proxy(this.winResize,this)]],o)),this.opts.subIndicators&&(this.$subArrow=t("<span/>").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),n()}if(this.$firstSub=this.$root.find("ul").each((function(){s.menuInit(t(this))})).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var a=/(index|default)\.[^#\?\/]*/i,r=window.location.href.replace(a,""),u=r.replace(/#.*/,"");this.$root.find("a").each((function(){var i=this.href.replace(a,""),e=t(this);i!=r&&i!=u||(e.addClass("current"),s.opts.markCurrentTree&&e.parent().parentsUntil("[data-smartmenus-id]","li").children("a").addClass("current"))}))}},destroy:function(){this.menuHideAll();var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").unbind(e).undelegate(e),e+=this.rootId,t(document).unbind(e),t(window).unbind(e),this.opts.subIndicators&&(this.$subArrow=null);var s=this;t.each(this.subMenus,(function(){this.hasClass("mega-menu")&&this.find("ul").removeDataSM("in-mega"),this.dataSM("shown-before")&&((s.opts.subMenusMinWidth||s.opts.subMenusMaxWidth)&&this.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),this.dataSM("scroll-arrows")&&this.dataSM("scroll-arrows").remove(),this.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),s.opts.subIndicators&&this.dataSM("parent-a").removeClass("has-submenu").children("span.sub-arrow").remove(),this.removeDataSM("shown-before").removeDataSM("ie-shim").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").parent().removeDataSM("sub")})),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),i.splice(t.inArray(this,i),1)},disable:function(i){if(!this.disabled){if(this.menuHideAll(),!i&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=t('<div class="sm-jquery-disable-overlay"/>').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(i){this.isTouchScrolling?this.isTouchScrolling=!1:(this.visibleSubMenus.length&&!t.contains(this.$root[0],i.target)||t(i.target).is("a"))&&this.menuHideAll()},docTouchEnd:function(i){if(this.lastTouch){if(this.visibleSubMenus.length&&(void 0===this.lastTouch.x2||this.lastTouch.x1==this.lastTouch.x2)&&(void 0===this.lastTouch.y2||this.lastTouch.y1==this.lastTouch.y2)&&(!this.lastTouch.target||!t.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout((function(){e.menuHideAll()}),350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var i=t.originalEvent.touches[0];this.lastTouch.x2=i.pageX,this.lastTouch.y2=i.pageY}},docTouchStart:function(t){var i=t.originalEvent.touches[0];this.lastTouch={x1:i.pageX,y1:i.pageY,target:i.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(i){for(var e=t(i).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,i){var e;"none"==t.css("display")&&(e={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(i?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=i?t[0].offsetHeight:t[0].offsetWidth),e&&t.hide().css(e),o},getStartZIndex:function(t){var i=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(i)&&(i=parseInt(this.$root.css("z-index"))),isNaN(i)?1:i},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var i=t?"Height":"Width",e=document.documentElement["client"+i],s=window["inner"+i];return s&&(e=Math.min(e,s)),e},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"block"==this.$firstLink.css("display")},isFixed:function(){var i="fixed"==this.$root.css("position");return i||this.$root.parentsUntil("body").each((function(){if("fixed"==t(this).css("position"))return i=!0,!1})),i},isLinkInMegaMenu:function(t){return!t.parent().parent().dataSM("level")},isTouchMode:function(){return!s||this.isCollapsible()},itemActivate:function(i){var e=i.parent(),s=e.parent(),o=s.dataSM("level");if(o>1&&(!this.activatedItems[o-2]||this.activatedItems[o-2][0]!=s.dataSM("parent-a")[0])){var n=this;t(s.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(s).each((function(){n.itemActivate(t(this).dataSM("parent-a"))}))}if(this.visibleSubMenus.length>o&&this.menuHideSubMenus(this.activatedItems[o-1]&&this.activatedItems[o-1][0]==i[0]?o:o-1),this.activatedItems[o-1]=i,this.visibleSubMenus[o-1]=s,!1!==this.$root.triggerHandler("activate.smapi",i[0])){var a=e.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(i){var e=t(i.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(i){if(this.isTouchScrolling)return this.isTouchScrolling=!1,i.stopPropagation(),!1;var e=t(i.currentTarget);if(this.handleItemEvents(e)){if(e.removeDataSM("mousedown"),!1===this.$root.triggerHandler("click.smapi",e[0]))return!1;var s=e.parent().dataSM("sub");if(this.isTouchMode()){if(e.dataSM("href")&&e.attr("href",e.dataSM("href")).removeDataSM("href"),s&&(!s.dataSM("shown-before")||!s.is(":visible"))&&(this.itemActivate(e),s.is(":visible")))return!1}else if(this.opts.showOnClick&&1==e.parent().parent().dataSM("level")&&s)return this.clickActivated=!0,this.menuShow(s),!1;return!e.hasClass("disabled")&&(!1!==this.$root.triggerHandler("select.smapi",e[0])&&void 0)}},itemDown:function(i){var e=t(i.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(i){var e=t(i.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var s=this;this.showTimeout=setTimeout((function(){s.itemActivate(e)}),this.opts.showOnClick&&1==e.parent().parent().dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(i){var e=t(i.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(i){var e=t(i.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur&&e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},itemTouchEnd:function(i){var e=t(i.currentTarget);if(this.handleItemEvents(e)){var s=e.parent().dataSM("sub");"#"===e.attr("href").charAt(0)||!s||s.dataSM("shown-before")&&s.is(":visible")||(e.dataSM("href",e.attr("href")),e.attr("href","#"))}},menuFixLayout:function(t){t.dataSM("shown-before")||t.hide().dataSM("shown-before",!0)},menuHide:function(t){if(!1!==this.$root.triggerHandler("beforehide.smapi",t[0])&&(t.stop(!0,!0),t.is(":visible"))){var i=function(){t.css("z-index","")};this.isCollapsible()?this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,i):t.hide(this.opts.collapsibleHideDuration,i):this.opts.hideFunction?this.opts.hideFunction.call(this,t,i):t.hide(this.opts.hideDuration,i),t.dataSM("ie-shim")&&t.dataSM("ie-shim").remove(),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":""}).unbind(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted");var e=t.dataSM("level");this.activatedItems.splice(e-1,1),this.visibleSubMenus.splice(e-1,1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0),this.menuHideSubMenus(),this.opts.isPopup&&(this.$root.stop(!0,!0),this.$root.is(":visible")&&(this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration),this.$root.dataSM("ie-shim")&&this.$root.dataSM("ie-shim").remove())),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.zIndexInc=0},menuHideSubMenus:function(t){t||(t=0);for(var i=this.visibleSubMenus.length-1;i>t;i--)this.menuHide(this.visibleSubMenus[i])},menuIframeShim:function(i){e&&this.opts.overlapControlsInIE&&!i.dataSM("ie-shim")&&i.dataSM("ie-shim",t("<iframe/>").attr({src:"javascript:0",tabindex:-9}).css({position:"absolute",top:"auto",left:"0",opacity:0,border:"0"}))},menuInit:function(t){if(!t.dataSM("in-mega")){this.subMenus.push(t),t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var i=2,e=t[0];(e=e.parentNode.parentNode)!=this.$root[0];)i++;t.dataSM("parent-a",t.prevAll("a").eq(-1)).dataSM("level",i).parent().dataSM("sub",t),this.opts.subIndicators&&t.dataSM("parent-a").addClass("has-submenu")[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(i){var e,s,o=i.dataSM("parent-a"),n=i.parent().parent(),a=i.dataSM("level"),u=this.getWidth(i),l=this.getHeight(i),c=o.offset(),d=c.left,m=c.top,p=this.getWidth(o),f=this.getHeight(o),v=t(window),S=v.scrollLeft(),b=v.scrollTop(),M=this.getViewportWidth(),g=this.getViewportHeight(),w=n.hasClass("sm")&&!n.hasClass("sm-vertical"),T=2==a?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,$=2==a?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(w?(e=this.opts.rightToLeftSubMenus?p-u-T:T,s=this.opts.bottomToTopSubMenus?-l-$:f+$):(e=this.opts.rightToLeftSubMenus?T-u:p-T,s=this.opts.bottomToTopSubMenus?f-$-l:$),this.opts.keepInViewport&&!this.isCollapsible()){var I=d+e,y=m+s;if(this.opts.rightToLeftSubMenus&&I<S?e=w?S-I+e:p-T:!this.opts.rightToLeftSubMenus&&I+u>S+M&&(e=w?S+M-u-I+e:T-u),w||(l<g&&y+l>b+g?s+=b+g-l-y:(l>=g||y<b)&&(s+=b-y)),w&&(y+l>b+g+.49||y<b)||!w&&l>g+.49){var x=this;i.dataSM("scroll-arrows")||i.dataSM("scroll-arrows",t([t('<span class="scroll-up"><span class="scroll-up-arrow"></span></span>')[0],t('<span class="scroll-down"><span class="scroll-down-arrow"></span></span>')[0]]).bind({mouseenter:function(){i.dataSM("scroll").up=t(this).hasClass("scroll-up"),x.menuScroll(i)},mouseleave:function(t){x.menuScrollStop(i),x.menuScrollOut(i,t)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(i));var C=".smartmenus_scroll";i.dataSM("scroll",{step:1,itemH:f,subH:l,arrowDownH:this.getHeight(i.dataSM("scroll-arrows").eq(1))}).bind(h([["mouseover",function(t){x.menuScrollOver(i,t)}],["mouseout",function(t){x.menuScrollOut(i,t)}],["mousewheel DOMMouseScroll",function(t){x.menuScrollMousewheel(i,t)}]],C)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(i.css("border-left-width"))||0),width:u-(parseInt(i.css("border-left-width"))||0)-(parseInt(i.css("border-right-width"))||0),zIndex:i.css("z-index")}).eq(w&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()&&i.css({"touch-action":"none","-ms-touch-action":"none"}).bind(h([[r()?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp",function(t){x.menuScrollTouch(i,t)}]],C))}}i.css({top:"auto",left:"0",marginLeft:e,marginTop:s-f}),this.menuIframeShim(i),i.dataSM("ie-shim")&&i.dataSM("ie-shim").css({zIndex:i.css("z-index"),width:u,height:l,marginLeft:e,marginTop:s-f})},menuScroll:function(t,i,e){var o,n=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),r=parseFloat(t.css("margin-top")),h=n.up?n.upEnd:n.downEnd;if(!i&&n.velocity){if(n.velocity*=.9,(o=n.velocity)<.5)return void this.menuScrollStop(t)}else o=e||(i||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(n.step));var u=t.dataSM("level");this.visibleSubMenus.length>u&&this.menuHideSubMenus(u-1);var l=n.up&&h<=r||!n.up&&h>=r?r:Math.abs(h-r)>o?r+(n.up?o:-o):h;if(t.add(t.dataSM("ie-shim")).css("margin-top",l),s&&(n.up&&l>n.downEnd||!n.up&&l<n.upEnd)&&a.eq(n.up?1:0).show(),l==h)s&&a.eq(n.up?0:1).hide(),this.menuScrollStop(t);else if(!i){this.opts.scrollAccelerate&&n.step<this.opts.scrollStep&&(n.step+=.5);var c=this;this.scrollTimeout=setTimeout((function(){c.menuScroll(t)}),this.opts.scrollInterval)}},menuScrollMousewheel:function(t,i){if(this.getClosestMenu(i.target)==t[0]){var e=((i=i.originalEvent).wheelDelta||-i.detail)>0;t.dataSM("scroll-arrows").eq(e?0:1).is(":visible")&&(t.dataSM("scroll").up=e,this.menuScroll(t,!0))}i.preventDefault()},menuScrollOut:function(i,e){s&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(i[0]==e.relatedTarget||t.contains(i[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==i[0]||i.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,i){if(s&&!/^scroll-(up|down)/.test(i.target.className)&&this.getClosestMenu(i.target)==t[0]){this.menuScrollRefreshData(t);var e=t.dataSM("scroll");t.dataSM("scroll-arrows").eq(0).css("margin-top",e.upEnd).end().eq(1).css("margin-top",e.downEnd+e.subH-e.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(i){var e=i.dataSM("scroll"),s=t(window).scrollTop()-i.dataSM("parent-a").offset().top-e.itemH;t.extend(e,{upEnd:s,downEnd:s+this.getViewportHeight()-e.subH})},menuScrollStop:function(i){if(this.scrollTimeout)return clearTimeout(this.scrollTimeout),this.scrollTimeout=0,t.extend(i.dataSM("scroll"),{step:1,velocity:0}),!0},menuScrollTouch:function(i,e){if(a(e=e.originalEvent)){var s=this.getTouchPoint(e);if(this.getClosestMenu(s.target)==i[0]){var o=i.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(i)?(e.preventDefault(),this.isTouchScrolling=!0):this.isTouchScrolling=!1,this.menuScrollRefreshData(i),t.extend(o,{touchY:s.pageY,touchTimestamp:e.timeStamp,velocity:0});else if(/move$/i.test(e.type)){var n=o.touchY;void 0!==n&&n!=s.pageY&&(this.isTouchScrolling=!0,t.extend(o,{up:n<s.pageY,touchY:s.pageY,touchTimestamp:e.timeStamp,velocity:o.velocity+.5*Math.abs(s.pageY-n)}),this.menuScroll(i,!0,Math.abs(o.touchY-n))),e.preventDefault()}else void 0!==o.touchY&&(e.timeStamp-o.touchTimestamp<120&&o.velocity>0&&(o.velocity*=.5,this.menuScrollStop(i),this.menuScroll(i),e.preventDefault()),delete o.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),!1!==this.$root.triggerHandler("beforefirstshow.smapi",t[0])))&&!1!==this.$root.triggerHandler("beforeshow.smapi",t[0])&&(this.menuFixLayout(t),t.stop(!0,!0),!t.is(":visible"))){if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.keepHighlighted||this.isCollapsible())&&t.dataSM("parent-a").addClass("highlighted"),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var i=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),i>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t),t.dataSM("ie-shim")&&t.dataSM("ie-shim").insertBefore(t);var e=function(){t.css("overflow","")};this.isCollapsible()?this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,e):t.show(this.opts.collapsibleShowDuration,e):this.opts.showFunction?this.opts.showFunction.call(this,t,e):t.show(this.opts.showDuration,e),this.visibleSubMenus[t.dataSM("level")-1]=t,this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var i=this;this.hideTimeout=setTimeout((function(){i.menuHideAll()}),t?1:this.opts.hideTimeout)},popupShow:function(t,i){if(this.opts.isPopup){if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.menuFixLayout(this.$root),this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:i}),this.menuIframeShim(this.$root),this.$root.dataSM("ie-shim")&&this.$root.dataSM("ie-shim").css({zIndex:this.$root.css("z-index"),width:this.getWidth(this.$root),height:this.getHeight(this.$root),left:t,top:i}).insertBefore(this.$root);var e=this,s=function(){e.$root.css("overflow","")};this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}}else alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.')},refresh:function(){this.menuHideAll(),this.$root.find("ul").each((function(){var i=t(this);i.dataSM("scroll-arrows")&&i.dataSM("scroll-arrows").remove()})).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("ie-shim").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired"),this.$root.find("a.has-submenu").removeClass("has-submenu").parent().removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),this.subMenus=[],this.init(!0)},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var i=this;this.hideTimeout=setTimeout((function(){i.menuHideAll()}),this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents())this.isCollapsible()||"onorientationchange"in window&&"orientationchange"!=t.type||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll());else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),t.fn.dataSM=function(t,i){return i?this.data(t+"_smartmenus",i):this.data(t+"_smartmenus")},t.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},t.fn.smartmenus=function(i){if("string"==typeof i){var e=arguments,s=i;return Array.prototype.shift.call(e),this.each((function(){var i=t(this).data("smartmenus");i&&i[s]&&i[s].apply(i,e)}))}var o=t.extend({},t.fn.smartmenus.defaults,i);return this.each((function(){new t.SmartMenus(this,o)}))},t.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"prepend",subIndicatorsText:"+",scrollStep:50,scrollInterval:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,i){t.fadeOut(200,i)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,i){t.slideDown(200,i)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,i){t.slideUp(200,i)},showOnClick:!1,hideOnClick:!0,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,overlapControlsInIE:!0}}(jQuery);