// JavaScript Document
function depoimento(pagina, adiv){
	if (window.ActiveXObject){
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		xmlhttp = new XMLHttpRequest();
	}
	document.getElementById(adiv).style.textAlign = "center";
	document.getElementById(adiv).innerHTML='<br /><br /><img src="images/preloader.gif" width="160" height="24" /><br />Carregando...';
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4){
			document.getElementById(adiv).style.textAlign = "left";
			document.getElementById(adiv).innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET",pagina,true);
	xmlhttp.send(null);
}
function depoimento_auto(odepoimento){
	var adiv = "depoimento";
	var pagina = "depoimentos.php?limit="+odepoimento;
	if (window.ActiveXObject){
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		xmlhttp = new XMLHttpRequest();
	}
	document.getElementById(adiv).style.textAlign = "center";
	document.getElementById(adiv).innerHTML='<br /><br /><img src="images/preloader.gif" width="160" height="24" /><br />Carregando...';
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4){
			document.getElementById(adiv).style.textAlign = "left";
			document.getElementById(adiv).innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET",pagina,true);
	xmlhttp.send(null);
	
	odepoimento++;
	if(odepoimento == 5){
		odepoimento = 1;
	}
	setTimeout('depoimento_auto('+odepoimento+')', 25000);
}
