function validanewpass() {
   if( document.newpass.senha1.value == "") {
       erro('Informe a nova senha');
       return false;
   }
   if( document.newpass.senha2.value == "") {
       erro('Confirme a nova senha');
	   return false;
   }
}
function validarepass() {
   if( document.repass.email.value == "") {
       erro('Informe o e-mail de cadastro');
       return false;
   }
}
function validad() {
	if( document.dad.nomeuser.value == "") {
       erro('Informe um nome para este usuário');
	   return false;
   }
   if( document.dad.loginuser.value == "") {
       erro('Informe um login para este usuário');
	   return false;
   }
   if( document.dad.emailuser.value == "") {
       erro('Informe um e-mail para contato');
	   return false;
   }
   if( document.dad.emailuser.value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1) {
       erro('Informe um e-mail válido');
	   return false;
   }
   if( document.dad.sexo.value == "") {
       erro('Por favor, informe o seu sexo');
	   return false;
   }
   if( document.dad.endereco.value == "") {
       erro('Informe o seu endereço');
	   return false;
   }
   if( document.dad.fone.value == "") {
       erro('Informe seu telefone');
	   return false;
   }
   if( document.dad.cep.value == "") {
       erro('Informe seu CEP');
	   return false;
   }
}
function validauser() {
	   if( document.user.nomeuser.value == "") {
       erro('Informe um nome para este usuário');
	   return false;
   }
   if( document.user.loginuser.value == "") {
       erro('Informe um login para este usuário');
	   return false;
   }
   if( document.user.senhauser.value == "") {
       erro('Informe uma senha para este usuário');
	   return false;
   }
   if( document.user.emailuser.value == "") {
       erro('Informe um e-mail para contato');
	   return false;
   }
   if( document.user.emailuser.value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1) {
       erro('Informe um e-mail válido');
	   return false;
   }
   if( document.user.sexo.value == "") {
       erro('Por favor, informe o seu sexo');
	   return false;
   }
   if( document.user.niveluser.value == "") {
       erro('Informe um nível para seu cadastro');
	   return false;
   }
}
function validaingresso() {
   if( document.ingresso.local.value == "") {
       erro('Informe o evento dos ingressos');
       return false;
   }
   if( document.ingresso.qtd.value == "") {
       erro('Informe a quantidade de ingresso masculino');
       return false;
   }
   if( document.ingresso.qtdf.value == "") {
       erro('Informe a quantidade de ingresso feminino');
       return false;
   }
   if( document.ingresso.dataevento.value == "") {
       erro('Informe a data do sorteio');
       return false;
   }
}
function validadance() {
   if( document.dance.arquivo.value == "") {
       erro('Insira uma imagem/logomarca desta danceteria');
       return false;
   }
   if( document.dance.dance.value == "") {
       erro('Insira o nome da danceteria');
       return false;
   }
} 
function validafot() {
   if( document.fot.dataevento.value == "") {
       erro('Insira a data do evento');
       return false;
   }
   if( document.fot.nome.value == "") {
       erro('Insira o nome do evento');
       return false;
   }
}

function validasetor() {
   if( document.setor.assunto.value == "") {
       erro('Informe o nome do contato');
       return false;
   }
   if( document.setor.email.value == "") {
       erro('Informe seu email para contato');
       return false;
   }
   if( document.setor.email.value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1) {
       erro('O e-mail informado não é válido');
	   return false;
   }
}


function validaprol() {
   if( document.prol.nome.value == "") {
       erro('Insira um nome para este produto');
       return false;
   }
   if( document.prol.descricao.value == "") {
       erro('Insira uma descricção para este produto');
       return false;
   }
}


function validacontato() {
   if( document.contato.nome.value == "") {
       erro('Informe o seu nome');
       return false;
   }
   if( document.contato.email.value == "") {
       erro('Informe seu email para contato');
       return false;
   }
   if( document.contato.email.value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1) {
       erro('O e-mail informado não é válido');
	   return false;
   }
   if( document.contato.assunto.value == "") {
       erro('Informe o assunto do contato');
       return false;
   }
   if( document.contato.fone.value == "") {
       erro('Informe o telefone para contato');
       return false;
   }
   if( document.contato.mensagem.value == "") {
       erro('Por favor, descreva a mensagem do contato');
       return false;
   }
}

function validanov() {
   if( document.nov.titulo.value == "") {
       erro('Por favor, insira o titulo do classificado');
       return false;
   }
   if( document.nov.contato.value == "") {
       erro('Por favor, insira o contato do classificado');
       return false;
   }
   if( document.nov.desc.value == "") {
       erro('Por favor, insira uma descrição');
       return false;
   }
}

function validaagendatopo() {
   if( document.agendatopo.arquivo.value == "") {
       erro('Por favor, insira uma imagem');
       return false;
   }
   if( document.agendatopo.empresa.value == "") {
       erro('Por favor, insira o titulo do evento');
       return false;
   }
   if( document.agendatopo.parcelas.value == "") {
       erro('Por favor, insira o local do evento');
       return false;
   }
   if( document.agendatopo.site.value == "") {
       erro('Por favor, insira uma descrição do evento');
       return false;
   }
}

function validaadd() {
   if( document.add.email.value == "") {
       erro('Por favor, insira um e-mail');
       return false;
   }
   if( document.add.email.value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1) {
       erro('Informe um e-mail válido');
	   return false;
   }
}
function validanews2() {
   if( document.user.msg_para.value == "") {
       erro('Informe um nome para este receptor');
	   return false;
   }
   if( document.user.msg_assunto.value == "") {
       erro('Informe um assunto para este e-mail');
	   return false;
   }
}

function validanews() {
   if( document.news.email.value == "Informe seu e-mail...") {
       erro('Informe um e-mail');
	   return false;
   }
   if( document.news.email.value == "") {
       erro('Informe um e-mail');
	   return false;
   }
   if( document.news.email.value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1) {
       erro('Informe um e-mail válido');
	   return false;
   }
}
function validabanner() {
   if( document.banner.arquivo.value == "") {
       erro('Selecione o banner que deseja adicionar');
	   return false;
   }
   if( document.banner.empresa.value == "") {
       erro('Insira um comentário');
	   return false;
   }
}
function validarec() {
   if( document.rec.conteudo.value == "") {
       erro('Informe o recado que deseja postar');
	   return false;
   }
   if( document.rec.nomerecado.value == "") {
       erro('Informe seu nome');
	   return false;
   }
   if( document.rec.emailrecado.value == "") {
       erro('Informe seu e-mail');
	   return false;
   }
   if( document.rec.codigo.value == "") {
       erro('Informe o código de segurança');
	   return false;
   }
}
function validacadastro() {
   if( document.cadastro.nomeuser.value == "") {
       erro('Informe um nome');
	   return false;
   }
   if( document.cadastro.sexo.value == "") {
       erro('Por favor, informe o seu sexo');
	   return false;
   }
   if( document.cadastro.loginuser.value == "") {
       erro('Informe um login');
	   return false;
   }
   if( document.cadastro.senhauser.value == "") {
       erro('Informe uma senha');
	   return false;
   }
   if( document.cadastro.emailuser.value == "") {
       erro('Informe um e-mail');
	   return false;
   }
   if( document.cadastro.emailuser.value.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1) {
       erro('Informe um e-mail válido');
	   return false;
   }

}
function confirma(del, volta) {
    $(document).ready(function() { 
        $('#'+del+'').click(function() { 
            $.blockUI({ message: $('#question'), css: { width: '100%', left: '-3px' } }); 
        });  
        $('#yes').click(function() { 
            $.blockUI({ message: "<br /><br /><span class='txt22'>Processando comando...</span><br /><br /><br />", css: { width: '100%', left: '-3px' } });  
            $.ajax({ 
                url: ''+volta+'&del='+del+'', 
                cache: true, 
                complete: function() { 
                    $.unblockUI(); 
                } 
            }); 
			history.go(0);
			location.hef=''+volta+''
        });  
        $('#no').click(function() { 
            $.unblockUI();
            return false; 
        }); 
 
    });
}
function confirma2(del, p, volta) {
    $(document).ready(function() { 
        $('#'+del+'').click(function() { 
            $.blockUI({ message: $('#question'), css: { width: '100%', left: '-3px' } }); 
        });  
        $('#yes').click(function() { 
            $.blockUI({ message: "<br /><br /><span class='txt22'>Processando comando...</span><br /><br /><br />", css: { width: '100%', left: '-3px' } });  
            $.ajax({ 
                url: ''+volta+'&it='+del+'&p='+p+'', 
                cache: true, 
                complete: function() { 
                    $.unblockUI(); 
                } 
            }); 
			history.go(0);
			location.hef=''+volta+''
        });  
        $('#no').click(function() { 
            $.unblockUI();
            return false; 
        }); 
 
    });
}

function tudo(del, volta) {
    $(document).ready(function() { 
        $('#all').click(function() { 
            $.blockUI({ message: $('#question'), css: { width: '100%', left: '-3px' } }); 
        });  
        $('#yes').click(function() { 
            $.blockUI({ message: "<br /><br /><span class='txt22'>Processando comando...</span><br /><br /><br />", css: { width: '100%', left: '-3px' } });  
            $.ajax({ 
                url: ''+volta+'&all=del', 
                cache: true, 
                complete: function() { 
                    $.unblockUI(); 
                } 
            }); 
			history.go(0);
			location.hef=''+volta+''
        });  
        $('#no').click(function() { 
            $.unblockUI();
            return false; 
        }); 
 
    });
}
function msg(msg, icon, volta) {
$(document).ready(function() { 
	$.blockUI({ message: "<center><table width='900' height='90' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td width='280' align='right' valign='middle' height='64'><img src='img/"+icon+".png' width='64' height='64' alt='Ok' /></td><td width='20' align='center' valign='middle' height='64'>&nbsp;</td><td width='600' align='left' valign='middle' height='64' class='txt22'>"+msg+"</td></tr></table></center>", css: { width: '100%', left: '-3px' } });  
	setTimeout($.unblockUI, 800);
	setTimeout("location.href='"+volta+"'",1200);
    }); 
}
function erro(msg) {
$(document).ready(function() { 
	$.blockUI({ message: "<center><table width='900' height='90' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td width='280' align='right' valign='middle' height='64'><img src='img/atencao.png' width='64' height='64' alt='Ok' /></td><td width='20' align='center' valign='middle' height='64'>&nbsp;</td><td width='600' align='left' valign='middle' height='64' class='txt22'>"+msg+"...</td></tr></table></center>", css: { width: '100%', left: '-3px' } });  
	setTimeout($.unblockUI, 2000);
    }); 
}
function pass(msg, volta) {
$(document).ready(function() { 
	$.blockUI({ message: "<center><table width='900' height='90' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td width='280' align='right' valign='middle' height='64'><img src='img/atencao.png' width='64' height='64' alt='Ok' /></td><td width='20' align='center' valign='middle' height='64'>&nbsp;</td><td width='600' align='left' valign='middle' height='64' class='txt22'>"+msg+"...</td></tr></table></center>", css: { width: '100%', left: '-3px' } });  
	setTimeout($.unblockUI, 2000);
	setTimeout("location.href='"+volta+"'",2400);
    }); 
}
