// JavaScript Document
function requestCustomerInfo()
{
  var sNome = 'nome=' + document.getElementById("txtNome").value + '&email=' + document.getElementById("txtEmail").value + '&codigo=' + document.getElementById("txtCodigo").value + '&lingua=' + document.getElementById("txtLingua").value;
  var oXHR = zXmlHttp.createRequest();
  oXHR.open("get", "salvanews.php?"+sNome , true);
  oXHR.onreadystatechange = function ()
  {
    if (oXHR.readyState == 4) {
      if (oXHR.status == 200 || oXHR.status == 304) {
        displayCustomerInfo(oXHR.responseText);
      } else {
        displayCustomerInfo("Ocorreu um erro: " + oXHR.statusText); //statusText is not always accurate
      }
    }
  };
  oXHR.send(null);
}

function displayCustomerInfo(sText)
{
  var divCustomerInfo = document.getElementById("resposta");
  divCustomerInfo.innerHTML = sText;
  if (sText == '<p align="center"><b>E-mail cadastrado com sucesso!</b></p>') {
      document.getElementById("btnOk").disabled=true;
  }
}

function popup(pagina,janela,w,h,rolagem,maxi) {

 lar = screen.width;
 alt = screen.height;

 if (maxi == '') maxi = 'no';
 if (rolagem == '') rolagem = 'no';

 var winDt = window.open(pagina,janela,'width='+w+',height='+h+',scrollbars='+rolagem+',toolbar=no,location=no,status=no,menubar=no,resizable='+maxi+',left='+((lar-w)/2)+',top='+((alt-h)/2)+'');

 winDt.focus();
}