function criarXMLHttpRequestArea()
{
   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 XHR_criado = criarXMLHttpRequestArea();

//Aqui ficam as funções refentes ao formulario

function enviarCombo(url,send,tag)
  {
    variavel = send;
    var send = document.getElementById(send).value;
    XHR_criado.open("post",url,true);
    XHR_criado.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    XHR_criado.setRequestHeader('Cache-Control', 'no-store, no-cache, must-revalidate');
    XHR_criado.onreadystatechange = SaidaHttpPOST;
    
    XHR_criado.send(variavel+"="+send);
    function SaidaHttpPOST()
    {
      if(XHR_criado.readyState!=4)
	  {
	    document.getElementById(tag).innerHTML= "CARREGANDO...";
	  }
	  if(XHR_criado.readyState==4)
	  {
	    document.getElementById(tag).innerHTML= XHR_criado.responseText;
      }
    }
}
