
raiz = "http://www.rubikaz.com/";


activateMenu = function(nav) {

    /* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) {  
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");  
        for (i=0; i<lis.length; i++) {
			
           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
							
            
                /* assign the function to the LI */
                if( lis[i].parentNode == navroot ) {
                   lis[i].onmouseover=function() {	
                     this.style.backgroundImage = "url("+raiz+"imagenes/menu/backgroundarribab.jpg)";
                     /* display the inner menu */
                     this.lastChild.style.display="block";
                  }
                  lis[i].onmouseout=function() {                       
                     this.style.backgroundImage = "url("+raiz+"imagenes/menu/backgroundarriba.jpg)";
                     this.lastChild.style.display="none";
                  }
                } else {
                   lis[i].onmouseover=function() {	
                     this.style.backgroundImage = "url("+raiz+"imagenes/menu/backgroundb.jpg)";
                     /* display the inner menu */
                     this.lastChild.style.display="block";
                  }
                  lis[i].onmouseout=function() {                       
                     this.style.backgroundImage = "url("+raiz+"imagenes/menu/background.jpg)";
                     this.lastChild.style.display="none";
                  }
                }
            } else {
              lis[i].onmouseover=function(){this.style.backgroundImage = "url("+raiz+"imagenes/menu/backgroundb.jpg)";};
              lis[i].onmouseout=function(){this.style.backgroundImage = "url("+raiz+"imagenes/menu/background.jpg)";};
            }
        }
    }
}


function init(){
    activateMenu('nav'); 

}
window.onload=init; 
