/* ************************************************************ * * Scriptname : maxmenu.js * Version : 1.0.0 * ************************************************************ * * Copyright © 2003 by Max.nl * ************************************************************ * Description : * * JS for menu ( IE 5.5+ ) * Displays submenu's using JavaScript for MSIE * because li:hover is not supported. * * Note: new sites should use the 'menu.js' instead, * which allows CSS code to specify the correct action * for mouse hover events. * ************************************************************ * * Date : 02-08-2006 * Author : Diederik van der Boor * Description : Made sure onload is not overwritten * when attachEvent() is supported. * Avoid invoking when Firefox is used. ** * Date : 19-11-2003 * Author : Jeroen Weijers * Description : Initial Release * ************************************************************ */ /* */ if(document.all) { startMenu = function() { // currentStyle restricts the Javascript to IE only if( document.all && document.getElementById( "menu" ).currentStyle ){ var navroot = document.getElementById( "menu" ); // Get all the list items within the menu var lis = navroot.getElementsByTagName( "LI" ); for( i = 0; i < lis.length; i++ ){ // If the LI has another menu level if( lis[i].lastChild.tagName == "UL" ){ // assign the function to the LI lis[i].onmouseover = function(){ // display the inner menu this.lastChild.style.display="block"; } lis[i].onmouseout = function(){ this.lastChild.style.display="none"; } } } } } if (window.attachEvent) { window.attachEvent("onload", startMenu) } else { window.onload = startMenu; } }