﻿function expandeMenu(id)
{
    var strReferencia = "menuS_"+id;
    if(window.document.getElementById(strReferencia))
    {
        var TrPrincipal = window.document.getElementById(strReferencia);
        var proxItem = TrPrincipal.nextSibling;
        
        for(var x=0;x< 5;x++)
        {
            if(TrPrincipal.childNodes[x].nodeType == 1)
            {
                if(TrPrincipal.childNodes[x].className == "submenu_bg01A_ativo")
                    TrPrincipal.childNodes[x].className = "submenu_bg01A";
                else
                    TrPrincipal.childNodes[x].className = "submenu_bg01A_ativo";
                    
                break;
            }
        }
        if(proxItem.getAttribute("rel") == strReferencia)
            expandeItens(proxItem,strReferencia)
        return false;
    }
}

function expandeItens(obj,ref){
    if(obj.style.display == "none"){
        obj.style.display = "";
    }
    else{
        obj.style.display = "none";
    }
    var proxItem = obj.nextSibling;
    while(true){
        if(proxItem.nodeType == 1)  
            break;
        else
            proxItem = proxItem.nextSibling;
    }

    if(proxItem.getAttribute("rel") == ref)
        expandeItens(proxItem,ref)
}
