function secao(id) {
	window.location = "secao.asp?idSecao=" + id;
} 

function alteraEdicao() {
	window.location='index.asp?edicao='+document.getElementById('edAnteriores').value;
	//alert(document.getElementById('edAnteriores').value);
}
function altura(div1,div2) {
	alturaDiv1 = document.getElementById(div1).offsetHeight;
	alturaDiv2 = document.getElementById(div2).offsetHeight;
	if (alturaDiv1 > alturaDiv2) {
		document.getElementById(div2).style.height = alturaDiv1 + "px";
	}
}

function ShowDiv(div) {
	document.getElementById(div).style.display = "block";
	/*document.getElementById(div).style.left = event.x;
	document.getElementById(div).style.top = event.y + 15;*/
}

function HideDiv(div) {
	document.getElementById(div).style.display = "none";
}

function openAjax(url) {
	var ajax = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		ajax = new XMLHttpRequest();
		if (ajax.overrideMimeType) {
			ajax.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			ajax = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			ajax = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!ajax) {
		alert('Ocorreu um erro!');
		return false;
	} else {
		return ajax;
	}
}

function getURL(URL, Destino)//URL: página que vc quer exibir, Destino: id da div que receberá o resultado
{
	if(document.getElementById)//verifica se o navegador é compatível
	{ 
		var ajax = openAjax(); //lembra da nossa função lá em cima?
		//*** Bug Cache IE ***
		URL = URL + parseInt(Math.random()*99999999);
		ajax.open("GET", URL, true); //faz a requisição da nossa URL, mais a diante vc entederá pq o parâmetro por GET
		//document.all.url.value=URL;
		//document.getElementById("ddd").innerHTML = "muda";
		//Como vc deve ter visto na página da W3C, o objeto ajax possui vários estados
		//Cada estado tem seu significado
		//State Description
		//0 The request is not initialized
		//1 The request has been set up
		//2 The request has been sent
		//3 The request is in process
		//4 The request is completed
		//Essa função a baixo executa os procedimentos a cada vez que o estado muda.
		ajax.onreadystatechange = function() {         
			if(ajax.readyState == 1) { 
				document.getElementById(Destino).innerHTML = "<img src='images/carregando.gif' /> Carregando...";
			}
			if(ajax.readyState == 4) { 
				if(ajax.status == 200) {         
					var resultado = ajax.responseText; 
					resultado = resultado.replace(/\+/g," "); 
					document.getElementById(Destino).innerHTML = unescape(resultado);
				} else {    
					document.getElementById(Destino).innerHTML =  "Erro (" + ajax.status + ")"; 
				}
			}
		}
		ajax.send(null);//enfim envia a requisição!
	}
}