

 /*******************************************
	CODIGO PARA MOSTRAR E ESCONDER AS TABLES
*******************************************/

/*
	var objLastMenuShown = null;
	
	function show(objMenu) {

		if (objMenu == null) return;
	
		if (objLastMenuShown != null)
		{
			showSubMenu(objLastMenuShown, false);
	
		}
		if (objLastMenuShown != objMenu)
		{
			showSubMenu(objMenu, true);
			objLastMenuShown = objMenu;
		}
		else
		{
		objLastMenuShown = null;
		}
	}
	
	function showSubMenu(objMenu, blnShow)
	{
		if (objMenu == null || blnShow == null) return false;
	
		if (blnShow){
			objMenu.style.display = '';
		}
		else
		{
			objMenu.style.display = 'none';
		}
		return true;
	}
  */




idActualNivel0 = 0;

function mostraElemento(id) {
    //var objLastPrimeiroMenuShown = null;
    document.getElementById("cat" + id + "_sub").style.display = document.getElementById("cat" + id + "_sub").style.display == 'block' ? 'none' : 'block';
    //document.getElementById("linkNivel0" + id).className = document.getElementById("linkNivel0" + id).className == 'menuPaiSel' ? 'menuPai' : 'menuPaiSel';
    
    if (idActualNivel0 > 0) {
        document.getElementById("cat" + idActualNivel0 + "_sub").style.display = document.getElementById("cat" + idActualNivel0 + "_sub").style.display == 'block' ? 'none' : 'block';
        document.getElementById("linkNivel0" + idActualNivel0).className = document.getElementById("linkNivel0" + idActualNivel0).className == 'menuPaiSel' ? 'menuPai' : 'menuPaiSel';    
    }

    idActualNivel0 = id;
   
    //objLastPrimeiroMenuShown = id;
    //window.alert(objLastPrimeiroMenuShown);

}

idActualNivel1 = 0;
idActualNivel2 = 0;
function tdClickNivel2(id) {

    if (idActualNivel1 > 0) {
        document.getElementById("linkNivel1" + idActualNivel1).className = document.getElementById("linkNivel1" + idActualNivel1).className == 'menuNivel2Sel' ? 'menuNivel2' : 'menuNivel2Sel';
    }

    idActualNivel1 = id;
}


function tdOverPai(id) {
    document.getElementById("linkNivel0" + id).className = 'menuPaiSel';
}
function tdOutPai(id) {
    if (id != idActualNivel0) {
        document.getElementById("linkNivel0" + id).className = 'menuPai';
    }
}

function tdOverNivel2(id) {
    document.getElementById("linkNivel1" + id).className = 'menuNivel2Sel';
}

function tdOutNivel2(id) {
    if (id != idActualNivel1) {
        document.getElementById("linkNivel1" + id).className = 'menuNivel2';
    }
}

function tdOverNivel3(id) {
    document.getElementById("linkNivel2" + id).className = 'menuNivel3Sel';
}

function tdOutNivel3(id) {
    if (id != idActualNivel2) {
        document.getElementById("linkNivel2" + id).className = 'menuNivel3';
    }
}




