function contasegundos2()
{	
  segundos--;  
  document.getElementById('atualizando').innerHTML=segundos;
  if(segundos != 0){setTimeout('contasegundos2()',1000);}
  else{window.location.reload();}
}
function pagAjax(pagina,destino)
{	
	xmlHttp=GetXmlHttpObject()
	xmlHttp.onreadystatechange=pagAjaxChanged
	url=pagina;
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	document.getElementById(destino).innerHTML="carregando...";
	function pagAjaxChanged()
	{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		
	w=xmlHttp.responseText
	//alert(w)
		if(w !="")
		{
		
		document.getElementById(destino).innerHTML=w;
		
		  if(document.getElementById('acerto_s')!=null){
			 
			  if(document.getElementById('acerto_s').value>0)
			  {		document.getElementById('operacao').value=0;
				  document.getElementById(destino).innerHTML=document.getElementById(destino).innerHTML+"<div class='aviso'>ATUALIZANDO EM <label id='atualizando'>3</label></label>";
				 
				  segundos=3;
				  contasegundos2();
				  
			  }
			  
		  }
		}
	}
	}
}




function GetXmlHttpObject()
{
var objXMLHttp=null
	if (window.XMLHttpRequest)
	{objXMLHttp=new XMLHttpRequest()}
	else if (window.ActiveXObject)
	{objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")}
return objXMLHttp
}
