//Desenvolvido por Visual Planet Web
function conteudo(id,num,url)
{
	function createXMLHttpRequest()
	{
		try{ return new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){}
		try{ return new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){}
		try{ return new XMLHttpRequest(); }catch(e){}
		alert("XMLHttpRequest not supported");
		return null;
	}
	var xhReq = createXMLHttpRequest();
	xhReq.open("post",url,true);
	xhReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	document.getElementById(id+num).style.display= "block";
	xhReq.onreadystatechange = function do_readyStateChange(to) {
		if (xhReq.readyState == 4)
		{
			//document.getElementById(id+"1").style.display= "none";
			document.getElementById(id+num).innerHTML = xhReq.responseText;
			window.location = '#'+id+num;
		}
		else
		{
			document.getElementById(id+num).innerHTML = '<p style="text-align:center; padding-top: 50px;"><img src="imagens/ajax-loader.gif"><br /><br />Carregando...</p>';
		}
	}
	xhReq.send("&a=1");
}
function hide(id,num)
{
	document.getElementById(id+num).style.display = "none";
}
function getPageScroll(){
	var yScroll;
	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// Todos outros Exploreres
		yScroll = document.body.scrollTop;
	}
	arrayPageScroll = new Array('',yScroll)
	return arrayPageScroll;
}
//
function getPageSize(){
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // Topdos Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...tambem funciona para Explorer 6, Mozilla e Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// Todos exceto Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Modo Explorer 6
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // outros Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	// para páginas pequenas menores que a altura
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}
	// para páginas pequenas menores que a largura
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}
function carrega(nome,tm)
{
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	var boxTop = arrayPageScroll[1] + (arrayPageSize[3] / 15)+20;
	if (boxTop<380) boxTop=380;
	//arrayPageScroll[1] + (arrayPageSize[3] / 15)+50;
	document.getElementById('mapa').style.top=boxTop+'px';
	document.getElementById('imagem').innerHTML='<IMG name="img" src="imagens/'+nome+'.jpg" id="big">';
	document.getElementById('mapa').style.display='block';
	var tamanho=document.img.width;
	var meio=tm/2;
	document.getElementById('mapa').style.margin='0 -'+meio+'px 0 -'+meio+'px';
}
