var func_onload = [function(){}];
function func_window_onload(){
	func_onload.forEach(
		function(f){
			try{
				f();
			}catch(e){}
		}
	);
}
window.onload = func_window_onload;
 
 


var menu_fechou = 0;

function menu_mostrar(){
    menu_sair();
    try{
        try{
            forIn(this.parentNode.parentNode.getElementsByTagName("UL"),function(e){
                e.style.display='none';
            });
        }catch(w){}
        var es = this.parentNode.getElementsByTagName("UL");

        if(es!=null)
            if(es.length>0)
                es[0].style.display="block";
    }catch(e){}
}

function menu_fechar(){
    var atual = menu_fechou;
    setTimeout(function(){
        if(atual==menu_fechou){
            forIn(menugruposjson.content.getElementsByTagName("UL"),function(e){
                e.style.display='none';
            });
        }
    }, menugruposjson.delay);
}


function menu_sair(){
    menu_fechou++;
    if(menu_fechou==10000)
        menu_fechou=0;
}


function menu_criar(){
    forIn(menugruposjson.content.getElementsByTagName("A"),function(e){
        e.onmouseover=menu_mostrar;
    });
    forIn(menugruposjson.content.getElementsByTagName("SPAN"),function(e){
        e.onmousemove=menu_mostrar;
    });
    forIn(menugruposjson.content.getElementsByTagName("LI"),function(e){
        e.onmouseout=function(){
			menu_fechar();
			this.style.backgroundColor="#FFE591";
			this.style.color="#316825";
			this.style.borderBottom="thin dotted #9c9e9b";
		};
        e.onmouseover=function(){
			menu_sair();
			this.style.backgroundColor="#FFE591";
			this.style.color="#fff";
			this.style.borderBottom="thin solid #9d9d9d";
		};
    });
    forIn(document.getElementsByTagName("LI"),function(e){
        e.style.display='block';
    });
}

