function XMLHTTPRequest() {
  try {
    return new XMLHttpRequest();
  } catch(ee) {
    try {
      return new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
      try {
        return new ActiveXObject("Microsoft.XMLHTTP");
      } catch(E) {
        return false;
      }
    }
  }
}

function gera_cad_excluir(nome_funcao) {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("div_programa");

ajaxRec.open("POST", (nome_funcao), true);
ajaxRec.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

  ajaxRec.onreadystatechange = function() {
    if (ajaxRec.readyState == 1) { // 1=Estado onde ainda esta processando, 4=Estado onde já processou
       //div.innerHTML = '<font face="Verdana" size="1">Aguarde processando...</font>';
    }
    if (ajaxRec.readyState == 4) { // 1=Estado onde ainda esta processando, 4=Estado onde já processou
       alert(ajaxRec.responseText);
    }
  }
  
  ajaxRec.send(null);
;
}

function gera_cad_tool_post() {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("div_programa");

ajaxRec.open("POST", 'gera_cad_tool_post.php', true);
ajaxRec.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

  ajaxRec.onreadystatechange = function() {
    if (ajaxRec.readyState == 1) { // 1=Estado onde ainda esta processando, 4=Estado onde já processou
       //div.innerHTML = '<font face="Verdana" size="1">Aguarde processando...</font>';
    }
    if (ajaxRec.readyState == 4) { // 1=Estado onde ainda esta processando, 4=Estado onde já processou
       alert(ajaxRec.responseText);
    }
  }

  ajaxRec.send('edtid_modulo='+document.getElementById('edtid_modulo').value+
               '&edtid_funcao='+document.getElementById('edtid_funcao').value+
               '&edtnome_funcao='+document.getElementById('edtnome_funcao').value+
               '&edtgrupo='+document.getElementById('edtgrupo').value+
               '&edttabelabd='+document.getElementById('edttabelabd').value);
;
}

