<!--
{
function exibemsg(texto)
{
document.getElementById("mensagem").innerHTML = texto;
document.getElementById("msgerro").style.display = 'block';
}
function exlogin()
{
       var identificacao = "";
       document.getElementById("logado").innerHTML = "<p align=center><br><br>Processando ...<br><br>Aguarde ...<br></p>";
       document.getElementById("logado").style.display = 'block';
	   document.getElementById("login").style.display = 'none';
       {
        if (document.frmlogin.opcao.checked)
         { document.frmlogin.guardar.value = "S" }
          else
         { document.frmlogin.guardar.value = "N" }
       }
       var campos = tiracento(document.frmlogin.email.value + "|" + document.frmlogin.senha.value + "|" + document.frmlogin.guardar.value);
	   var comboinst = createXMLHTTP();
	   comboinst.open("post", "obj_login.asp", true);
	   comboinst.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
	   comboinst.onreadystatechange=function(){
		   if (comboinst.readyState==4){
			   identificacao = voltacento(comboinst.responseText);
               var arr = new String(identificacao);
  	           arr = arr.split('|');
               var retorno     = arr[0];
               if (retorno=="0")
               {
               		var nomeusuario = arr[1];
               		var dtultacesso = arr[2];
               		var sexousuario = arr[3];
               		var tipousuario = arr[4];
               		var numeusuario = arr[5];
               		{
               		if (sexousuario==1)
                  		{ letra = "o" }
               		else
                  		{ letra = "a" }
               		}
              		{
              		if (tipousuario==1)
                  		{
						 tipo = "Prof."
	          		     document.getElementById("menuprof").style.display = 'block';
                        }
               		else
                  		{
						 tipo = ""
	          		     document.getElementById("menuprof").style.display = 'none';
                        }
              		}
              		var divlog = "<p align=center>&nbsp;<br>";
              		divlog = divlog + "<font class='bv'>Bem-vind" + letra + " " + tipo + "</font><br>";
              		divlog = divlog + "<font class=nu>"+nomeusuario+"</font><br>&nbsp;<br>";
              		divlog = divlog + "<font class=ua>Último acesso em<br>"+dtultacesso+"</font><br><br>";
              		divlog = divlog + '<img src="images/bt_sair_verm.gif" alt="Sair" onclick="JavaScript: sair();"></p>';
	          		document.getElementById("idusuario").innerHTML = "Usuário: "+nomeusuario+" - Último Acesso em "+dtultacesso;
	          		document.getElementById("logado").innerHTML = divlog;
	          		document.getElementById("logado").style.display = 'none';
	          		document.getElementById("btsair").style.display = 'block';
	          		document.getElementById("login").style.display = 'none';
	          		document.getElementById("mktlog").style.display = 'block';
	          }
	          else
	          {  
                 if (retorno=="1")
                   { exibemsg("Email e/ou Senha não informados.<br><br>Verifique e tente novamente."); }
                 if (retorno=="2")
                   { exibemsg("Este endereço de Email não está cadastrado no sistema.<br><br>Verifique e tente novamente."); }
                 if (retorno=="3")
                   { exibemsg("O seu cadastro ainda não está ativo.<br><br>Você precisa acessar a sua conta de emails, localizar o email de confirmação e ativar o cadastro.<br><br>Verifique e tente novamente."); }
                 if (retorno=="4")
                   { exibemsg("Senha Inválida !<br><br>Verifique e tente novamente."); }
                    document.getElementById("logado").style.display = 'none';
	                document.getElementById("login").style.display = 'block';
	          }
              }}
			   comboinst.send("p=" + campos);
			   }
}
function sair()
{
       document.getElementById("logado").innerHTML = "<p align=center><br><br>Processando ...<br><br>Aguarde ...<br></p>";
	   var saida = createXMLHTTP();
	   saida.open("post", "obj_logout.asp", true);
	   saida.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=iso-8859-1");
	   saida.onreadystatechange=function(){
		   if (saida.readyState==4){
			   var aux = saida.responseText;
               document.getElementById("logado").innerHTML = "&nbsp;";
               document.getElementById("logado").style.display = 'none';
               document.frmlogin.senha.value = "";
               document.getElementById("login").style.display = 'block';
               document.getElementById("idusuario").innerHTML = "&nbsp;";
	           document.getElementById("btsair").style.display = 'none';
         	   document.getElementById("mktlog").style.display = 'none';
               document.getElementById("menuprof").style.display = 'none';
              }}
			   saida.send("p=x");
}

function Valida()
{
{

if (document.formAL.chave.value == "")
  {
      alert ("Por favor preencha algum argumento a pesquisar !");
      document.formAL.chave.focus();
      return false;
  }
}
{
if (document.formAL.tipo.value == "0")
  {
      alert ("Por favor selecione uma opção de onde a pesquisa deve ser efetuada !");
      return false;
  }
}
    return true;
}

// -->

