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 envia_mensagem_post() {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("divRespContato");

ajaxRec.open("POST", ("mail_env_faleconosco.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
       div.innerHTML = '&nbsp;';
       alert(ajaxRec.responseText);
    }
  }
  ajaxRec.send('edtemail='+document.getElementById('edtemail').value+
               '&edtnome='+document.getElementById('edtnome').value+
               '&edtassunto='+document.getElementById('edtassunto').value+
               '&edtmensagem='+document.getElementById('edtmensagem').value);
;
}

function envia_mensagem_indica_post() {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("divRespContato");

ajaxRec.open("POST", ("mail_env_indica.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
       div.innerHTML = '&nbsp;';
       alert(ajaxRec.responseText);
    }
  }
  ajaxRec.send('edtemail='+document.getElementById('edtemail').value+
               '&edtnome='+document.getElementById('edtnome').value+
               '&edtemailamigo='+document.getElementById('edtemailamigo').value+
               '&edtnomeamigo='+document.getElementById('edtnomeamigo').value+
               '&edtassunto='+document.getElementById('edtassunto').value+
               '&edtmensagem='+document.getElementById('edtmensagem').value);
;
}

function envia_mensagem_anuncio_post() {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("divRespContato");

ajaxRec.open("POST", ("mail_env_anuncio.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
       div.innerHTML = '&nbsp;';
       alert(ajaxRec.responseText);
    }
  }
  ajaxRec.send('id_anuncio='+document.getElementById('id_anuncio').value+
               '&edtemail='+document.getElementById('edtemail').value+
               '&edtnome='+document.getElementById('edtnome').value+
               '&edtassunto='+document.getElementById('edtassunto').value+
               '&edttelefone='+document.getElementById('edttelefone').value+
               '&edtdtchegada='+document.getElementById('edtdtchegada').value+
               '&edtdtsaida='+document.getElementById('edtdtsaida').value+
               '&edtadultos='+document.getElementById('edtadultos').value+
               '&edtcriancas='+document.getElementById('edtcriancas').value+
               '&edtmensagem='+document.getElementById('edtmensagem').value);
;
}

function anuncio_preco_post(id_preco,excluir) {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("divConteudo");

ajaxRec.open("POST", ("anuncio_preco_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 = 'Processando...';
    }
    if (ajaxRec.readyState == 4) { // 1=Estado onde ainda esta processando, 4=Estado onde já processou
       location.reload(true);
       alert(ajaxRec.responseText);
    }
  }
  ajaxRec.send('id_anuncio='+document.getElementById('id_anuncio').value+
               '&id_preco='+id_preco+
               '&excluir='+excluir+
               '&edtperiodo='+document.getElementById('edtperiodo').value+
               '&edtdtinicio='+document.getElementById('edtdtinicio').value+
               '&edtdtfim='+document.getElementById('edtdtfim').value+
               '&edtpreco='+document.getElementById('edtpreco').value+
               '&edtminimodias='+document.getElementById('edtminimodias').value+
               '&edtobs='+document.getElementById('edtobs').value);
;
}

function anuncio_preco_excluir_post(id_preco,excluir) {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("divConteudo");

ajaxRec.open("POST", ("anuncio_preco_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 = 'Processando...';
    }
    if (ajaxRec.readyState == 4) { // 1=Estado onde ainda esta processando, 4=Estado onde já processou
       location.reload(true);
       alert(ajaxRec.responseText);
    }
  }
  ajaxRec.send('id_anuncio='+document.getElementById('id_anuncio').value+
               '&id_preco='+id_preco+
               '&excluir='+excluir);
;
}


function exibe_tela(file,par) {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("divConteudo");

ajaxRec.open("POST", (file+".php"+par), true);
ajaxRec.setRequestHeader("Content-Type", "text/html; charset=windows-1252");

  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
       div.innerHTML = ajaxRec.responseText;
    }
  }
  ajaxRec.send(null);
;
}

function anuncio_indisp_post(id_indisp,excluir) {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("divConteudo");

ajaxRec.open("POST", ("anuncio_indisp_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 = 'Processando...';
    }
    if (ajaxRec.readyState == 4) { // 1=Estado onde ainda esta processando, 4=Estado onde já processou
       location.reload(true);
       alert(ajaxRec.responseText);
    }
  }
  ajaxRec.send('id_anuncio='+document.getElementById('id_anuncio').value+
               '&id_indisp='+id_indisp+
               '&excluir='+excluir+
               '&edtdtinicio='+document.getElementById('edtdtinicio').value+
               '&edtdtfim='+document.getElementById('edtdtfim').value+
               '&edtobs='+document.getElementById('edtobs').value);
;
}

function anuncio_indisp_excluir_post(id_indisp,excluir) {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("divConteudo");

ajaxRec.open("POST", ("anuncio_indisp_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 = 'Processando...';
    }
    if (ajaxRec.readyState == 4) { // 1=Estado onde ainda esta processando, 4=Estado onde já processou
       location.reload(true);
       alert(ajaxRec.responseText);
    }
  }
  ajaxRec.send('id_anuncio='+document.getElementById('id_anuncio').value+
               '&id_indisp='+id_indisp+
               '&excluir='+excluir);
;
}

function anuncio_boleto_post(id_titulo,excluir) {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("divConteudo");

ajaxRec.open("POST", ("anuncio_boleto_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 = 'Processando...';
    }
    if (ajaxRec.readyState == 4) { // 1=Estado onde ainda esta processando, 4=Estado onde já processou
       location.reload(true);
       alert(ajaxRec.responseText);
    }
  }
  ajaxRec.send('id_anuncio='+document.getElementById('id_anuncio').value+
               '&edtemailanunciante='+document.getElementById('edtemailanunciante').value+
               '&id_titulo='+id_titulo+
               '&excluir='+excluir+
               '&edtdtvecto='+document.getElementById('edtdtvecto').value+
               '&edtdtpagto='+document.getElementById('edtdtpagto').value+
               '&edtvalor='+document.getElementById('edtvalor').value+
               '&edtreferente='+document.getElementById('edtreferente').value+
               '&edtsituacao='+document.getElementById('edtsituacao').value+
               '&edtobs='+document.getElementById('edtobs').value);
;
}

function anuncio_boleto_excluir_post(id_titulo,excluir) {

var ajaxRec = XMLHTTPRequest();
var div = document.getElementById("divConteudo");

ajaxRec.open("POST", ("anuncio_boleto_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 = 'Processando...';
    }
    if (ajaxRec.readyState == 4) { // 1=Estado onde ainda esta processando, 4=Estado onde já processou
       location.reload(true);
       alert(ajaxRec.responseText);
    }
  }
  ajaxRec.send('id_anuncio='+document.getElementById('id_anuncio').value+
               '&id_titulo='+id_titulo+
               '&excluir='+excluir);
;
}

