function AjaxInstance() {
  var ajax = null;

  if (window.XMLHttpRequest) {
    ajax = new XMLHttpRequest();                   // Mozilla
  } else if (window.ActiveXObject) {
    try {
      ajax = new ActiveXObject('Microsoft.XMLHTTP'); // ActiveX (IE)
    } catch (e) {
    }
  }

  return ajax;
}

function AjaxSendRequest(xmlhttp, url, funcao) {
  if (!xmlhttp)
    return false;

  xmlhttp.onreadystatechange = funcao;
  xmlhttp.open('GET', url, true);
  xmlhttp.send(null);
  delete xmlhttp;
  return true;
}

