// // var _x_date = new Date(); var _cookieNameULID = "expandULID"; function x( o ) { if ( null == o ) return; if ( null == o.childNodes ) return; if ( ( new Date() - 200 ) < _x_date ) { return; // prevents event bubbling } writeSessionCookie( _cookieNameULID, o.id ); hideall(); // showBranch( o ); _x_date = new Date(); } // x() function showBranch( o ) { if ( null == o ) return; var oParent = o.parentNode; while ( oParent != null ) { showObject( oParent ); for ( var i = 0; i < oParent.childNodes.length; i++ ) { var peer = oParent.childNodes.item( i ); showObject( peer ); } oParent = oParent.parentNode; } showObject( o ); for ( var i = 0; i < o.childNodes.length; i++ ) { var child = o.childNodes.item( i ); showObject( child ); if ( null == child.childNodes ) continue; for ( var k = 0; k < child.childNodes.length; k++ ) { var grandchild = child.childNodes.item( k ); showObject( grandchild ); } } } // showBranch() function showObject( obj ) { if ( null == obj ) return; if ( null == obj.style ) return; var DISPLAY_BLOCK = 'block'; obj.style.display = DISPLAY_BLOCK; } // showObject() function toggleVisibility( obj ) { if ( null == obj ) return; if ( null == obj.style ) return; var DISPLAY_NONE = 'none'; var DISPLAY_BLOCK = 'block'; if ( DISPLAY_NONE == obj.style.display ) { obj.style.display = DISPLAY_BLOCK; } else { obj.style.display = DISPLAY_NONE; } } // toggleVisibility() function expand( e ) { var obj = document.getElementById( e ); if ( null == obj ) return; if ( null == obj.style ) return; if ( obj.style.display == 'none' ) { obj.style.display = 'block'; } else { obj.style.display = 'none'; } } // expand() function hideall() { // this hides UL tags with class='subUL' var nodes = document.getElementsByTagName( 'ul' ); for ( var i = 0; i < nodes.length; i++ ) { var nodeObj = nodes.item( i ); // if ( nodeObj.className != 'topUL' ) { if ( nodeObj.className == 'subUL' ) { nodeObj.style.display = 'none'; } } // check to see if part of the navigation should be expanded var id = getCookieValue( _cookieNameULID ); if ( ( false == id ) || ( '' == id ) ) return; var obj = document.getElementById( id ); if ( null == obj ) return; showBranch( obj ); } // hideall() // //