var OverNav = false; var NavOutGracePeriod = 500; var CurrentTimerID = 0; function NavOver( Element ) { var SubNav = GetNextSibling( Element, 'ul' ); if( SubNav ) { HideSubNav(); SubNav.style.display = 'block'; SubNav.style.position = 'absolute'; SubNav.style.zIndex = '10'; OverNav = true; } else { OverNav = false; HideSubNav(); OverNav = true; } } function NavOut( Element ) { var SubNav = GetNextSibling( Element, 'ul' ); if( SubNav ) { OverNav = false; CurrentTimerID = window.setTimeout( "HideSubNav();", NavOutGracePeriod ); } } function HideSubNav() { if( !OverNav ) { if( CurrentTimerID ) { clearTimeout( CurrentTimerID ); CurrentTimerID = 0; } var Nav = document.getElementById( 'Navigation_ul' ); var SubNav = Nav.getElementsByTagName( 'ul' ); for( i = 0; i < SubNav.length; i++ ) { if( SubNav[i].style.display != 'none' ) { SubNav[i].style.display = 'none'; } } } } function GetNextSibling( Element, Tag ) { while( Element != null ) { if( Element.tagName && Element.tagName.toLowerCase() == Tag.toLowerCase() ) { break; } Element = Element.nextSibling; } return Element; }