function buildsubmenus(){
    var lis=document.getElementById("mainmenu").getElementsByTagName("A");
    for (var i=0; i<lis.length; i++){
	    lis[i].parentNode.onmouseover=function(){
	    	this.bgc = this.getElementsByTagName("A")[0].style.backgroundColor;
	    	this.fntclr = this.getElementsByTagName("A")[0].style.color;
		    this.getElementsByTagName("A")[0].style.backgroundColor="#132C97";
		    if(this.parentNode.id=='mainmenu')
			    this.getElementsByTagName("A")[0].style.background="#132C97 url('img/menuiconon.gif') 30px 12px no-repeat";
		    this.getElementsByTagName("A")[0].style.color="#ffffff";
		    
		     this.style.position="relative";
		     
		     try{	
				this.getElementsByTagName("DIV")[0].style.display="block";
			 }catch(e){}	
	    }	
	    lis[i].parentNode.onmouseout=function(){
		    this.getElementsByTagName("A")[0].style.backgroundColor=this.bgc;
		    this.getElementsByTagName("A")[0].style.color=this.fntclr;
		    if(this.parentNode.id=='mainmenu')
			    this.getElementsByTagName("A")[0].style.backgroundImage="url('img/menuicon.gif')";
		    this.style.position="static";
		    
		    try{	
				this.getElementsByTagName("DIV")[0].style.display="none";
			}catch(e){}		    
	    }
    }    
}
if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)