var xmlhttp;
var Mozilla=false;
var XMLFuncion = ""

var XMLParms;
if (navigator.appName.indexOf("Microsoft")!=-1)
{
  Mozilla=false;
}
else
{
  Mozilla=true;
}

function loadXMLDoc(URL, Method, Vars, Function, Async)
{
  if (Async==undefined)
  {
    Async=true;
  }
  XMLFuncion = Function;
  if (window.XMLHttpRequest)
  {
    xmlhttp=new XMLHttpRequest();
    xmlhttp.onreadystatechange=xmlhttpChange;
    xmlhttp.open(Method, URL, Async);
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.send(Vars);
  }
  else 
  {
    if (window.ActiveXObject)
    {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
      if (xmlhttp)
      {
        xmlhttp.onreadystatechange=xmlhttpChange;
        xmlhttp.open(Method, URL, Async);
        xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xmlhttp.send(Vars);
      }
    }
  }
}

function cancelXMLDoc(Function)
{
  if (xmlhttp!=undefined)
  {
    xmlhttp.abort();
  }
  if (Function!=undefined)
  {
    eval(Function);
  }
  return true;
}


function xmlhttpChange()
{
  if (xmlhttp.readyState==4)
  {
    if (xmlhttp.status==200)
    {
      var root=xmlhttp.responseXML.documentElement;
      eval(XMLFuncion+"(root)");
      XMLFuncion = "";
    }
    else
    {
      alert("Hubo un problema al intentar obtener la Informacion")
    }
  }
}


