function linke(url){
myAjax = new parent.Ajax.Updater('cont','inc.'+url+'.php',{onLoading:fcarregando,onComplete:fcarrega});
}
function linkenq(odiv, url){
myAjax = new Ajax.Updater(odiv,url);
}

function suporte() {
window.open('suporte/suporte.php', '', 'top=150,left=400,width=400,height=450,resizable=0,scrollbars=1');
}

function AL(id){
tot=18;
for(i=1; i<=tot; i++){
parent.document.getElementById('l'+i).style.textDecoration='none';
}
parent.document.getElementById(id).style.textDecoration='underline';
for(i=1; i<=tot; i++){
pli=id.split('l');
pli=pli[1];
if(i!=pli){
parent.document.getElementById('l'+i).style.textDecoration='';
}
}
}

function fcarregando(){
document.getElementById("icrr").innerHTML="<img src=\"imgs/ict.gif\" width=\"69\" height=\"17\" border=\"0\">";
}
function scarregou(){
document.getElementById("icrr").innerHTML="<img src=\"imgs/icc.gif\" width=\"69\" height=\"17\" border=\"0\">";
}
function fcarrega(){
scarregou();
setTimeout("scarregou()", 100);
setTimeout("scarregou()", 1000);
setTimeout("scarregou()", 2000);
}


function abredes(imagem, altura, larg, foue, tit){
ami = document.getElementById('amini').style;
ami.display="block";
ami.height=altura;
alti=altura-140;
//document.body.style.display='none';
document.getElementById('tudo').style.display='none';
document.getElementById('amini').innerHTML='<div align="center" style="margin-top:25px;cursor:default;"><table border="0" cellspacing="0" cellpadding="0"><tr><td align="right"><img src="imgs/bf.gif" style="cursor:pointer"></td></tr><tr><td style="font-weight:bold;color:#FFF;text-align:center;">'+tit+'</td></tr><tr><td style="background:#FFFFFF url(\'imgs/fc.gif\');border:10px solid #FFFFFF;cursor:pointer;"><img border="0" src="'+foue+'/g_'+imagem+'" height="'+alti+'" width="'+larg+'"></td></tr><tr><td align="right"><img src="imgs/bf.gif" style="cursor:pointer"></td></tr></table></div>';
document.location='#';
}

function fechades(){
ami = document.getElementById('amini').style;
ami.display="none";
document.getElementById('tudo').style.display='inline';
}

function abredL(em, uget){
document.getElementById('dvprin').style.visibility="hidden";
document.getElementById('dvprin').style.display="none";
sdc=document.getElementById('dvcomp');
sdc.innerHTML="<img src=\"imgs/comp.gif\">";
sdc.style.visibility="visible";
sdc.style.display="inline";

ami = document.getElementById('dlogin').style;
ami.display="block";
if(em!=null && em!='null'){
ami.height='230px';
document.getElementById('dlogin').innerHTML='<div style="margin-top:5px;"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-left:10px;"><tr><td><font size="3" color="#FFFFFF"><b>Fazer login</b></font></td><td align="right"><img src="imgs/bf.gif" style="cursor:pointer" onclick="fechadL()"></td></tr><tr><td style="background:#2767AD;padding:10px;" colspan="2"><form action="login.grava.php" method="post"><input type="hidden" name="env" value="s"><input type="hidden" name="uget" value="'+uget+'"><table border="0"><tr><td colspan="2" bgcolor="#FFFFFF" style="cursor:default;padding:5px;"><font color=#990000><b>Dados não conferem!</b></font></td></tr><tr><td height="5"></td></tr><tr><td>E-mail:</td><td><input type="text" name="email" class="input" maxlength="100" value="'+em+'"></td></tr><tr><td>Senha:</td><td><input class="input" type="password" name="senha" maxlength="255"></td></tr><tr><td colspan="2" align="right">(esqueci minha senha)</td></tr><tr><td colspan="2"><input type="checkbox" name="cookie" value="s" id="atic"><label for="atic"> Permanecer logado</label></td></tr></table><center><input type="submit" value="Logar" class="submit"></center></form></td></tr></table></div>';
}else{
ami.height='200px';
document.getElementById('dlogin').innerHTML='<div style="margin-top:5px;"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-left:10px;"><tr><td><font size="3" color="#FFFFFF"><b>Fazer login</b></font></td><td align="right"><img src="imgs/bf.gif" style="cursor:pointer" onclick="fechadL()"></td></tr><tr><td style="background:#2767AD;padding:10px;" colspan="2"><form action="login.grava.php" method="post"><input type="hidden" name="env" value="s"><input type="hidden" name="uget" value="'+uget+'"><table border="0"><tr><td>E-mail:</td><td><input type="text" name="email" class="input" maxlength="100"></td></tr><tr><td>Senha:</td><td><input class="input" type="password" name="senha" maxlength="255"></td></tr><tr><td colspan="2" align="right">(esqueci minha senha)</td></tr><tr><td colspan="2"><input type="checkbox" name="cookie" value="s" id="atic"><label for="atic"> Permanecer logado</label></td></tr></table><center><input type="submit" value="Logar" class="submit"></center></form></td></tr></table></div>';
}

}

function fechadL(){
document.getElementById('dvprin').style.visibility="visible";
document.getElementById('dvprin').style.display="inline";
sdc=document.getElementById('dvcomp').style;
sdc.visibility="hidden";
sdc.display="none";

ami = document.getElementById('dlogin').style;
ami.display="none";
}




function confAR(id) 
{
	if (confirm("Tem certeza que deseja apagar este recado?")) {
		location.replace("./?superforma=mural&del="+id);
	}
	exit;
}




function lc(a){
ge=document.getElementById(a);
if(ge.value==a){
ge.value='';
}
}
function vvc(a){
ge=document.getElementById(a);
if(ge.value==''){
ge.value=a;
}
}
function apvd(a){
document.getElementById(a).innerHTML='';
}

function vem(){
var email = document.cad.xpemail.value;
var url = 'verificaemail.php';
var pars = 'email=' + email;
var myAjax = new Ajax.Updater(
'mostra_rve',
url,
{
method: 'get',
parameters: pars
});
}

function vemC(){
f=document.cad;

if(f.xpconfemail.value != f.xpemail.value){
document.getElementById("mostra_rve").innerHTML="<font style=\"font-size: 8pt\" color=red>E-mail e Confirmação de E-mail não conferem.</font>";
f.xpconfemail.focus();
return false;
}else{document.getElementById("mostra_rve").innerHTML="";}
}

function vse(){
f=document.cad;

if(f.xpconfsenha.value != f.xpsenha.value){
document.getElementById("mostra_rvs").innerHTML="<font style=\"font-size: 8pt\" color=red>Senha e Confirmação de Senha não conferem.</font>";
f.xpconfsenha.focus();
return false;
}else{document.getElementById("mostra_rvs").innerHTML="";}
}

function ValidarFC(a, alt){
form=document.cad;
for (i=0;i<form.length;i++){
var obg = form[i].name.indexOf("xp");
if (obg!=-1){
if (form[i].value == ""){
var nome = form[i].id;
alert("Por favor, preencha o campo " + nome + ".")
form[i].focus();
return false
}
}
}
ValidarFC2(a, alt);
}

function ValidarFC2(a, alt){
f=document.cad;
if(document.getElementById('mostra_rvs').innerHTML.indexOf('conferem')!=-1){
alert('Senha e Confirmação de Senha não conferem...');
f.xpconfsenha.focus();
return false;
}
if(document.getElementById('mostra_rve').innerHTML.indexOf('conferem')!=-1){
alert('E-mail e Confirmação não conferem...');
f.xpconfemail.focus();
return false;
}
if(document.getElementById('mostra_rve').innerHTML.indexOf('inv')!=-1){
alert('E-mail informado é inválido!');
f.xpemail.focus();
return false;
}
else{
if(alt!='altera'){
alticad(a);
setTimeout("f.submit()", 2000);
}else{f.submit();}
}
}

function alticad(a){
if(a=='cad'){
document.getElementById('btsbmt').innerHTML="<img src=\"imgs/l.gif\" width=\"150\" height=\"50\" border=\"0\">";
}
}
