jQuery(document).ready(function($) { $('#bagua-board .board a').mouseover(function() { var klass = $(this).attr('class'); $('#bagua-board li.original').hide(); $('#bagua-board li.' + klass).show(); }); $('#bagua-board .board a').mouseout(function() { $('#bagua-board li').hide(); $('#bagua-board li.original').show(); }); }); function initPage() { var nav = document.getElementById("nav"); var sub_nav = document.getElementById("sub-nav"); if (nav) { var nodes = nav.getElementsByTagName("li"); var sub_nodes = sub_nav.getElementsByTagName("li"); for (var i = 0; i < nodes.length; i++) { nodes[i].onmouseover = function () { if (this.className.indexOf("hover") == -1) { this.className += " hover"; } } nodes[i].onmouseout = function () { this.className = this.className.replace(" hover", ""); } } for (var i = 0; i < sub_nodes.length; i++) { sub_nodes[i].onmouseover = function () { if (this.className.indexOf("hover") == -1) { this.className += " hover"; } } sub_nodes[i].onmouseout = function () { this.className = this.className.replace(" hover", ""); } } } } if (window.attachEvent && !window.opera) window.attachEvent("onload", initPage);