function NavSys(aData, parentPath) { var SELF = this; var TYPE = { MAIN_NAV: 'mainNav', NO_LINK: 'noLink' } var HTML = { NAV_ITEM: "{label}", SUBNAV_PARENT_TITLE: "
", SUBNAV_ITEM: "{label}", BREADCRUMB_ITEM: ">{label}", BREADCRUMB_HOME: "{label}", BREADCRUMB_NOLINK: ">{label}" } var SITE_ROOT = aData[0].path; var PAGE_PATH = parentPath || location.pathname.replace(new RegExp('^' + SITE_ROOT), '') + location.search; if (!_getRoute(aData[0])) PAGE_PATH = location.pathname.replace(new RegExp('^' + SITE_ROOT), ''); var _hideTimer, _showTimer; var EventHandlers = { mainNav: { onMouseOut: function() { clearTimeout(_showTimer); _hideTimer = setTimeout(function() { SELF.drawSubNav(); }, 1000); }, onMouseOver: function(e) { var oTarget = Event.getTarget(e); if (oTarget.tagName !== 'A') return; var sFilename = oTarget.getAttribute('rel'); clearTimeout(_hideTimer); clearTimeout(_showTimer); _showTimer = setTimeout(function() { SELF.drawSubNav(sFilename); }, 200); } }, subNav: { onMouseOut: function() { _hideTimer = setTimeout(function() { SELF.drawSubNav(); }, 1000); }, onMouseOver: function() { clearTimeout(_hideTimer); } } } var Registers = { Containers: { mainNav: null, subNav: null, breadcrumb: null } } function _getNode(root, optionalPath) { var findPath = optionalPath || PAGE_PATH; if (findPath == root.path) return [root]; if (!root.children) return; for (var i=0, len=root.children.length; i