// JavaScript Document
	function conexao(){
		//verifica se o browser tem suporte a ajax
		try{
			this.ajax = new ActiveXObject("Microsoft.XMLHTTP");
			this.erro = "";
		}catch(e){
			try{
				this.ajax = new ActiveXObject("Msxml2.XMLHTTP");
				this.erro = "";
			}catch(ex){
				try{
					this.ajax = new XMLHttpRequest();
					this.erro = "";
				}catch(exc){
					this.erro = "Esse browser não tem recursos para uso do Ajax";
					this.ajax = null;
				}
			}
		}
	}	
	//
	function atualizaSessao(url, pars){
		var con = new conexao();
		if(con.erro=="") {
			con.ajax.open("POST", url, true);
			con.ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			//passa o código do estado escolhido
			var params = "idmenu="+pars;
			con.ajax.send(params);
		}else{
			alert(con.erro);
		}	
	}  
	//
	function abir(opcao,raiz){
		for (i=1;i<=8;i++){
			if (i != opcao) document.getElementById("sub_"+i).style.display = "none";
		}
		if (document.getElementById("sub_"+opcao).style.display == "block"){
			document.getElementById("sub_"+opcao).style.display = "none";
		}else{
			document.getElementById("sub_"+opcao).style.display = "block";
		}
		atualizaSessao(raiz+"portal/setsessao.php",opcao);
	}
	//
	function rzaltura(){
		var hmenu=document.getElementById("lateral").clientHeight;
		var hcorpo=document.getElementById("corpo").clientHeight;
		var hcont=document.getElementById("conteudo").clientHeight;
		if (parseInt(hcorpo)<parseInt(hmenu) && parseInt(hcont)<parseInt(hmenu)){
			document.getElementById("corpo").style.height = (hmenu+5)+"px";
		}else{
			document.getElementById("corpo").style.height = (hcont+5)+"px";
		}
	}	
	
	
	
	
    function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}
