function ajaxInit() {
	var ajax;
	
	try {
		ajax = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (e) {
		try {
			ajax = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (ex) {
			try {
				ajax = new XMLHttpRequest();
			}
			catch (exc) {
				alert("Seu navegador não suporta ajax!");
				alert("Que tal um upgrade?");

				location.href = 'http://www.mozilla.com/en-US/products/download.html?product=firefox-2.0&os=win&lang=pt-BR';
				ajax = null;
			}
		}
	}
	
	return ajax;
}

//Exibe a lista de conteúdo antigo
//Archimedes Fagundes Jr. - 02/12/2006 - 01:21am
function showMaisCont(x, y, secao, subsecao) {
	var div = document.getElementById("maisCont");

	if (div.style.display == "block")
		div.style.display = "none";
	else {
		div.style.display = "block";
	}
	
	geraMaisCont(div, secao, subsecao);
}

function geraMaisCont(div, secao, subsecao) {
	var ajax = ajaxInit();

	if (ajax) {
		ajax.open("POST", "estrutura/maisCont.php", true);
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

		ajax.onreadystatechange = function() {
			if (ajax.readyState == 4) {
				if (ajax.status == 200) {
					result = ajax.responseText
					div.innerHTML = result;
				}
				else {
					alert(ajax.statusText);
				}
			}
		}
		ajax.send("sec_id=" + secao + "&sub_id=" + subsecao);
	}
}

function hideMaisCont() {
	document.getElementById("maisCont").style.display = "none";
}


function alerta(){
	busca = document.getElementById("busca");
	
	if(busca.value == ""){
		alert("Digite uma palavra para a busca");
	}
	else{
		document.buscaform.submit();	
	}

}


function alerta2(){
	nome = document.getElementById("nome");
	setor = document.getElementById("setor");
	
	if(nome.value == ""){
		alert("Digite uma palavra para a busca");
	}
	else{
		document.busca2.submit();	
	}

}
// Função que fecha o pop-up ao clicar no link fechar
function popup(){
window.open('popup.php','popup','width=650 height =400 ,scroll=yes,top=0,left=0')
}