<script type="text/javascript"> //window.onload loads functions once the page as completed. window.onload = function() { //selects container of navigation area which has the id "menu" var container = document.getElementById("menu"); //selects divs that exist as child of container var divs = container.getElementsByTagName("div"); //loop over each div and set its hover states for(var i=0;i<divs.length;i++) { divs[i].onMouseOver = function() { this.className = "hover"; } divs[i].onMouseOut = function() { this.className = ""; } } }</script>