!function(){function $(selector,context){return(context=context||document).querySelectorAll(selector)}function forEach(collection,iterator){for(var key in Object.keys(collection))iterator(collection[key])}function showMenu(){var ul=$("ul",this)[0];if(ul)return ul.classList.contains("-hide")?(ul.classList.remove("-hide"),void ul.parentElement.classList.remove("-active")):void(ul.classList.contains("-visible")||(this.classList.add("-active"),ul.classList.add("-animating"),ul.classList.add("-visible"),setTimeout(function(){ul.classList.remove("-animating")},25)))}function hideMenu(){var ul=$("ul",this)[0];ul&&ul.classList.contains("-visible")&&(this.classList.remove("-active"),ul.classList.add("-animating"),setTimeout(function(){ul.classList.remove("-visible"),ul.classList.remove("-animating")},300))}function hideAllInactiveMenus(){forEach($("li.-hasSubmenu.-active:not(:hover)",this.parent),function(e){e.hideMenu&&e.hideMenu()})}function hideAllMenus(){forEach($("li.-hasSubmenu",this.parent),function(e){e.hideMenu&&e.hideMenu()})}window.addEventListener("load",function(){forEach($(".Menu li.-hasSubmenu"),function(e){e.showMenu=showMenu,e.hideMenu=hideMenu}),forEach($(".Menu > li.-hasSubmenu"),function(e){e.addEventListener("click",showMenu)}),forEach($(".Menu > li.-hasSubmenu li"),function(e){e.addEventListener("mouseenter",hideAllInactiveMenus)}),forEach($(".Menu > li.-hasSubmenu li.-hasSubmenu"),function(e){e.addEventListener("mouseenter",showMenu)}),forEach($("a"),function(e){e.addEventListener("click",hideAllMenus)}),document.addEventListener("click",hideAllInactiveMenus)})}();