function addMenuListeners( menuElement ) { var menuItem = document.getElementById( menuElement ); var tabs = menuItem.childNodes; if ( tabs.length > 0 ) { for ( i = 0; i < tabs.length; i ++ ) { var menuTab = tabs[i]; if ( menuTab.nodeName == "LI" ) { menuTab.onmouseover = function() { this.className += " over"; } menuTab.onmouseout = function() { this.className = this.className.replace("over", ""); } } } // End of looping through tabs. } //End of checking for tabs. }