!function(){var walker,keyHandler={38:moveUp,40:moveDown,37:closeDropdown,39:openDropdown,72:closeDropdown,74:moveDown,75:moveUp,76:openDropdown,191:showKeyboardHelp,63:showKeyboardHelp,48:"js-direct",83:"js-system",69:"js-external",65:"js-addrule",187:"js-addrule",84:"js-temprule",79:"js-option",82:"js-reqinfo"};for(i=1;i<=9;i++)keyHandler[48+i]="js-profile-"+i;return init();function init(){walker=document.createTreeWalker(document.querySelector(".om-nav"),NodeFilter.SHOW_ELEMENT,{acceptNode:tabbableElementsOnly}),window.addEventListener("keydown",(function(e){var handler=keyHandler[e.keyCode];handler||console.log(e.keyCode),null!=handler&&"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&("string"==typeof handler?clickById(handler):handler())})),$script.ready("om-profile-items",(function(){var activeNavLink=document.querySelector(".om-nav-item.om-active > a");activeNavLink&&activeNavLink.focus()}))}function tabbableElementsOnly(node){return node.classList.contains("om-hidden")||node.classList.contains("om-dropdown")&&!node.parentElement.classList.contains("om-open")?NodeFilter.FILTER_REJECT:node.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}function moveUp(){walker.currentNode=document.activeElement;var result=null;walker.currentNode&&(result=walker.previousNode()),result||(walker.currentNode=walker.root.lastElementChild,walker.previousNode(),walker.nextNode()),walker.currentNode.focus()}function moveDown(){walker.currentNode=document.activeElement;var result=null;walker.currentNode&&(result=walker.nextNode()),result||(walker.currentNode=walker.root,walker.nextNode()),walker.currentNode.focus()}function openDropdown(){var container=document.querySelector(".om-open");if(container)container.querySelector("a").focus();else{var selectedItem=document.activeElement;if(selectedItem&&selectedItem.parentElement&&selectedItem.parentElement.classList.contains("om-has-dropdown")){var toggle=selectedItem.querySelector(".om-edit-toggle");toggle?toggle.click():selectedItem.click()}}}function closeDropdown(){var container=document.querySelector(".om-open");container&&(container.classList.remove("om-open"),container.querySelector("a").focus())}function showKeyboardHelp(){$script("js/keyboard_help.js")}function clickById(id){var element=document.getElementById(id);element&&element.click()}}();