// JavaScript Document

//Validação de Formulário
function checa_formulario(Cadastro){

//Tipo Nome
if (Cadastro.nome.value == ""){
alert("O campo (Nome) está vazio!");
Cadastro.nome.focus();
return (false);
}
//E-mail Requerido
if (Cadastro.email.value == ""){
alert("O campo (Email) está vazio!");
Cadastro.email.focus();
return (false);
}

//E-mail válido apenas com @
if (Cadastro.email.value.indexOf('@', 0) == -1){
alert("O Email é inválido!");
Cadastro.email.focus();
return (false);
}
if (Cadastro.senha.value == ""){
alert("Sua Senha não foi preenchida!");
Cadastro.senha.focus();
return (false);
}
if (Cadastro.senhaConfirma.value == ""){
alert("Confirme sua Senha");
Cadastro.senhaConfirma.focus();
return (false);
}
if (Cadastro.senha.value != Cadastro.senhaConfirma.value){
alert("Atenção! A Senha e a confirmação da senha estão diferentes");
Cadastro.senhaConfirma.focus();
return (false);
}

else return true; 
}
