/* When a subnavigation link is moused-over, apply a classname to the parent LI element that class definition adjusts the z-index of the LI */ function rifSubnav() { var subnavElements = $$('#sub_navigation li a'); subnavElements.each( function(navButton){ navButton.onmouseover = function(){ Element.addClassName(navButton.parentNode, 'pop'); }; navButton.onmouseout = function(){ Element.removeClassName(navButton.parentNode, 'pop'); }; }); } /* why is this not working? */ // Event.observe(window, 'load', rifSubnav); rifSubnav();