function memu_mostra(linha, linha_titulo){
	var elem = document.getElementById(linha);
	elem.style.display = 'block';
	var elem = document.getElementById(linha_titulo);
	elem.style.backgroundColor = '#EEF3FA';	
	elem.style.fontWeight = 'bold';
}

function memu_mostra2(linha_titulo){
	var elem = document.getElementById(linha_titulo);
	elem.style.backgroundColor = '#EEF3FA';	
	elem.style.fontWeight = 'bold';
}

function memu_apaga(num_linhas,num_linhas2){
	for(i=1; i <= num_linhas; i++){
		var linha = 'lin_'+i;
		var elem = document.getElementById(linha);
		elem.style.display = 'none';
	}
	for(i=1; i <= num_linhas2; i++){
		var linha_t = 'lin_titulo'+i;
		var elem = document.getElementById(linha_t);
		elem.style.backgroundColor = '#FFFFFF';	
		elem.style.fontWeight = 'normal';		
	}
}
function abrir() {
	var windowFeatures = "", nomeArquivo = "", nomeJanela = "", erro = null
	Argumentos = abrir.arguments; noArgumentos = Argumentos.length; nomeArquivo = Argumentos[0]
	for (i = 1; i < noArgumentos; i++) {
		valor = Argumentos[i].substring(2,Argumentos[i].length)
		switch(Argumentos[i].substring(0,2)) {
			case "nj" : nomeJanela = valor; break
			case "to" : windowFeatures += "top=" + valor + ", "; break
			case "le" : windowFeatures += "left=" + valor + ", "; break
			case "he" : windowFeatures += "height=" + valor + ", "; break
			case "wi" : windowFeatures += "width=" + valor + ", "; break
			case "lb" : windowFeatures += "location=" + valor + ", "; break
			case "mb" : windowFeatures += "menubar=" + valor + ", "; break
			case "sc" : windowFeatures += "scrollbars=" + valor + ", "; break
			case "st" : windowFeatures += "status=" + valor + ", "; break
			case "tb" : windowFeatures += "toolbar=" + valor + ", "; break
			case "tt" : windowFeatures += "titlebar=" + valor + ", "; break
			case "re" : windowFeatures += "resizable=" + valor + ", "; break
			default : erro = '"Código de atributo não informado no '+(i+1)+' º argumento (' +Argumentos[i]+ ')"'
		}
	}
	windowFeatures = windowFeatures.substring(0,windowFeatures.lastIndexOf(","))
	if (erro) { alert(erro) } else { novaJanela = window.open(nomeArquivo, nomeJanela, windowFeatures) }
}

	function subMenu(id)
	{
		if (document.getElementById(id).style.display == 'none') 
		{
			document.getElementById(id).style.display = 'inline';

			if (id.indexOf('Modulo') > -1)
			{
				if (document.getElementById('strIdAberto').value != '')
					document.getElementById(document.getElementById('strIdAberto').value).style.display = 'none';			
					
				document.getElementById('strIdAberto').value = id;
			}			
		}
		else
		{
			document.getElementById(id).style.display = 'none';
		}
	}


	function subMenuProd(idLinha, idSubLinha, idColecao){
		  	if (document.getElementById(idLinha)){
				  document.getElementById(idLinha).style.display = 'inline';
			}
			if (document.getElementById(idSubLinha)){
				  document.getElementById(idSubLinha).style.display = 'inline';
			}
			if (document.getElementById(idColecao)){
				  document.getElementById(idColecao).style.display = 'inline';
			}
	}
