var xmlHttp

function verificaAno(ano,cod)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  //alert ("Your browser does not support AJAX!");
  return;
  } 
  if(ano == ''){
document.getElementById("div_ano").innerHTML='';
  }
  else {
textoEspera = "<table width=155 border=0 cellspacing=0 cellpadding=0><tr><td class=font_a9pt_b><br><br><br>Carregando...<br><br><br></td></tr></table>";  
document.getElementById("div_ano").innerHTML=textoEspera;
var url="na_pegaAno.asp";
url=url+"?ano="+ano+"&cod="+cod;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
xmlHttp.send(null);
  }
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("div_ano").innerHTML=xmlHttp.responseText;
//window.location.href = "na_eabima.asp#div_ano";
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}