// JavaScript - LSF - PORTAL MEDICO

// ATENCAO !!!!!!
// FUNCAO RESPONSAVEL POR ABRIR E FECHAR O MENU
// SEMPRE QUE ALTERAR A QUANTIDADE DE ITENS EXPANDIVEIS NO MENU DO SITE
// ALTERAR AS VARIAVEIS "qtdext" E "qtdsub" PARA A QUANTIDADE ATUAL DE ITENS
// EXPANDIVEIS DO MENU EXTERIOR E INTERIOR RESPECTIVAMENTE
function ShowHide(id,tipo){
	var obj    = document.getElementById(id);
	var qtdext =  1; // Quantidade de itens externos extendiveis
	var qtdsub =  2; // Quantidade de sub itens extendiveis
	
	if (tipo == 1){ // Item do tipo externo ( principais )
		// Fechando todos os menus externos
		for (i = 1; i<= qtdext ;i++){
			var fobj = document.getElementById("sub" + i);
			if (fobj.style.display == 'block' && fobj != obj ){
				fobj.style.display = 'none';
			}		
		}	
	}else if (tipo == 2){// Item do tipo interno ( submenus )
		// Fechando todos os sub menus ( internos )

		for (i = 1; i<= qtdsub ;i++){
			var fobj = document.getElementById("ssub" + i);
			if (fobj.style.display == 'block' && fobj != obj ){
				fobj.style.display = 'none';
			}		
		}
	}	
	
	obj.style.display = (obj.style.display == 'none') ? 'block' : 'none';
}


