

function titulo () {
	document.write("<meta http-equiv = \"Content-Type\" content = \"text/html; charset=ISO-8859-1\"><title>FCC - Funda&ccedil;&atilde;o Carlos Chagas</title>");
}

function objXMLHttp(){
	var xmlhttp=null;

	if (window.XMLHttpRequest){// code for Firefox, Opera, IE7, etc.
		xmlhttp=new XMLHttpRequest();
		return xmlhttp;
	}
	else if (window.ActiveXObject){// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		return xmlhttp;
	}
	return false;
}

/* Carrega Arquivo Com Objetos  */
function montarObjeto(url,idMenu,subMenu,indexSubMenu,subMenuSuperior){
	var ajax = objXMLHttp();
	if (ajax) {
		ajax.open("GET", url, true);
		ajax.onreadystatechange = function() {
			if (ajax.readyState == 4) {
				if (ajax.status == 200) {
					document.getElementById(idMenu).innerHTML = ajax.responseText;
					
					/* -- ABRE MENU  --*/
					if(subMenu!=null){
						AbrirFecharSubMenu(subMenu);
					}
					
					/* -- DEIXA SUBMENU SELECIONADO --*/
					if(indexSubMenu!=null){
						destaqueSubMenu(subMenu,indexSubMenu);
					}
					
					/* -- Abre SubMenuSuperior --*/
					if(subMenuSuperior!=null){
						showSubMenu(subMenuSuperior);
					}
					
				} else {
					alert('Erro ao carregar o menu.');
				}
			}
		}
	}
	ajax.send(null);
}
	
/*  Efeito Menu Slide   -*/
function AbrirFecharSubMenuAlterarImagem(subMenu,imagem) {
	if(document.getElementById(subMenu).style.display == "block"){
		document.getElementById(subMenu).style.display = "none";
		document.getElementById(imagem).src = "/imgs_menu/abrenovo.gif";
	}
	else {
		for (var i=0; i < document.getElementsByTagName('td').length; i++){
			if (document.getElementById("subMenu0"+i)!=null){
				document.getElementById("subMenu0"+i).style.display = "none";
				document.getElementById("imagem0"+i).src = "http://www.fcc.org.br/imgs_menu/abrenovo.gif";
			}
		}
		document.getElementById(subMenu).style.display = "block";
		document.getElementById(imagem).src = "http://www.fcc.org.br/imgs_menu/fechanovo.gif";
	}
}

/* Marca item do menu, linha fica selecionada */

function linhaSelected(subMenu,indexItem){
	var subMenuObj = document.getElementById(subMenu);
	for (var i=0; i < subMenuObj.getElementsByTagName('td').length; i++){
		if (subMenuObj.getElementsByTagName('td')[i].id=="submenu_lateral"+indexItem){
			subMenuObj.getElementsByTagName('td')[i].style.background = "#DCDCDC";
		}
	}
}
	
<!--Marca item do menu, linha fica selecionada quando mouse fica -->
function linhaOver(obj){
	var subMenuObj = "";
	for (var i=1; i < document.getElementsByTagName('td').length; i++){
		subMenuObj = document.getElementById("subMenu0"+i);
		if (subMenuObj != null){
			for (var j=0; j < subMenuObj.getElementsByTagName('td').length; j++){
				if (subMenuObj.getElementsByTagName('td')[j].id=="submenu_lateral" + (j+1)){
					subMenuObj.getElementsByTagName('td')[j].style.background = "#E8E8E8";
				}
			}
		}
	}
	obj.style.background = "#DCDCDC";
}

function linhaOut(){
	var subMenuObj = "";
	for (var i=1; i < document.getElementsByTagName('td').length; i++){
		subMenuObj = document.getElementById("subMenu0"+i);
		if (subMenuObj != null){
			for (var j=0; j < subMenuObj.getElementsByTagName('td').length; j++){
				if (subMenuObj.getElementsByTagName('td')[j].id=="submenu_lateral" + (j+1)){
					subMenuObj.getElementsByTagName('td')[j].style.background = "#E8E8E8";
				}
			}
		}
	}
	linhaSelected(subMenu,itemSubMenu);
}

/* Monstra subMenu do Menu Superior */
function showSubMenu(showSubMenu){
	if(document.all) var obj = eval("document.all.subMenu");
	else var obj = document.getElementsByName('subMenu');

	for(var i=0; i<obj.length; i++){
		if(i == (showSubMenu - 1)) obj[i].style.display = 'block';
		else obj[i].style.display = 'none';
	}
	
}

function AbrirFecharSubMenu(subMenu) {
	if(document.getElementById(subMenu).style.display == "block")
		document.getElementById(subMenu).style.display = "none";
	else {
		for (var i=0; i < document.getElementsByTagName("td").length; i++){
			if (document.getElementById("subMenu0"+i)!=null){
				document.getElementById("subMenu0"+i).style.display = "none";
			}
		}
		document.getElementById(subMenu).style.display = "block";
	}
}

function ocultarMostrar(nomeObj) {
	var obj = document.getElementById(nomeObj);
	if (obj.style.display == "none")
		obj.style.display = "block"
	else
		obj.style.display = "none"
}

/* Coloca SubMenu em destaque e proibe link para a mesma pagina  */

function destaqueSubMenu(subMenu,indexItem){                   
        var subMenuObj = document.getElementById(subMenu);            
 	    subMenuObj.getElementsByTagName('td')[indexItem].getElementsByTagName("a")[0].style.color = "darkgray";
 	    var paginaOrigem = subMenuObj.getElementsByTagName('td')[indexItem].getElementsByTagName("a")[0].href;
 	    var paginaAtual = document.location;
 	    if(paginaOrigem == paginaAtual)
 	    {
	 	   
	 	    subMenuObj.getElementsByTagName('td')[indexItem].getElementsByTagName("a")[0].href="#";
	 	    subMenuObj.getElementsByTagName('td')[indexItem].getElementsByTagName("a")[0].style.cursor="default";
	 	  	subMenuObj.getElementsByTagName('td')[indexItem].getElementsByTagName("a")[0].style.textDecoration="none";
 	    }
    }

function bloquearMenu(){ 
	alert("ok");
}	       