setEvents = function() {
    nRoot = document.getElementById("menu");
    for (i=0; i<nRoot.childNodes.length; i++) 
    {
        node = nRoot.childNodes[i];
        if (node.nodeName=="LI") 
        {
            //alert(node.childNodes[0].childNodes[0].nodeName);
       
            if(node.childNodes[0].nodeName=="A" && node.childNodes[0].childNodes[0].src.indexOf('_a.gif') != -1)
            {
	            if(node.childNodes[0].rel != '')
	            {
	            	node.onmouseover=function() {
		                this.childNodes[0].childNodes[0].src = this.childNodes[0].childNodes[0].src.replace('_a.gif', '_b.gif');
		                showElement(this.childNodes[0].rel);
		            }
	         
		            node.onmouseout=function() {
		                this.childNodes[0].childNodes[0].src = this.childNodes[0].childNodes[0].src.replace('_b.gif', '_a.gif');
		                hideElement(this.childNodes[0].rel);
		            }
		            
		            document.getElementById(node.childNodes[0].rel).onmouseover=function() {
		            	showElement(this.id);
		            }
		            document.getElementById(node.childNodes[0].rel).onmouseout=function() {
		            	hideElement(this.id);
		            }
		            
	            }
	            else
	            {
	            	node.childNodes[0].onmouseover=function() {
		                this.childNodes[0].src = this.childNodes[0].src.replace('_a.gif', '_b.gif');
		            }
	         
		            node.childNodes[0].onmouseout=function() {
		                this.childNodes[0].src = this.childNodes[0].src.replace('_b.gif', '_a.gif');
		            }
	            }
	            
           	}
        }
    }
}
window.onload=setEvents; 
