var xmlHttp

function verificaReceita(id,receita,chave,campo,grupo,chef,grau)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  //alert ("Your browser does not support AJAX!");
  return;
  } 
  if((id == '')&&(receita == '')&&(chave == '')&&(campo == '')&&(grupo == '')&&(chef == '')&&(grau == '')){
document.getElementById("tab_receitas").innerHTML='';
  }
  else {
textoEspera = "<table width=400 border=0 cellspacing=0 cellpadding=0><tr><td width=400 height=270 class=font_a9pt_b><br><br><br><br><br><br>Carregando...<br><br><br><br><br><br></td></tr></table>";  
document.getElementById("tab_receitas").innerHTML=textoEspera;
var url="eap_pegaReceita.asp";
url=url+"?id="+id+"&receita="+receita+"&chave="+chave+"&campo="+campo+"&grupo="+grupo+"&chef="+chef+"&grau="+grau;
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("tab_receitas").innerHTML=xmlHttp.responseText;
window.location.href = "eap_receitas.asp#div_receitas";
}
}

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;
}