var menu_id = "menu" initMenu = function() { var nav_items = getElementsBySelector("#" + menu_id + " li"); for (i=0; i 2) { node.onmouseover=function() { this.className+=" over"; } node.onmouseout=function() { this.className=this.className.replace("over", ""); } } } } EventUtils.addEventListener(window,'load',initMenu);