/* behaviour_rules.js - Rules for use with the behaviour.js library. Behaviour lets you use CSS selectors to specify elements to which JavaScript events should be added. http://bennolan.com/behaviour */ var brules = { '.group' : function(element){ element.onmouseover = function(){ this.className = "group show"; } element.onmouseout = function(){ clearGroups(); } }, '#prodSearch' : function(element){ element.onfocus = function(){ if (this.value=="Product Search") this.value = ""; } element.onblur = function(){ if (this.value=="") this.value = "Product Search"; } }, 'div#foot ul#footNav li a' : function(element) { element.onmouseover = function() { clearHovers(); this.parentNode.className = 'active'; } }, 'div#foot ul#footNav ul li a' : function(element) { element.onmouseover = function() { ; } } }; Behaviour.register(brules); function clearGroups() { var divs = document.getElementsByTagName("div"); for (i=0; i