// JavaScript Document
<!--
function valida(){
	cor_erro = '#dba2a3';
	cor_alert = '#feffe6';
	cor_original = '#f3f3f3';
	
	with(document.membros){
		if(mem_nome.value == ''){
			mem_nome.style.background = cor_erro;
		} else {
			mem_nome.style.background = cor_original;
		}
		
		if(mem_sobrenome.value == ''){
			mem_sobrenome.style.background = cor_erro;
		} else {
			mem_sobrenome.style.background = cor_original;
		}
		
		if(mem_nascimento_dia.value == '' || mem_nascimento_mes.value == '' || mem_nascimento_ano.value == ''){
			mem_nascimento_dia.style.background = cor_erro;
			mem_nascimento_mes.style.background = cor_erro;
			mem_nascimento_ano.style.background = cor_erro;
		} else {
			mem_nascimento_dia.style.background = cor_original;
			mem_nascimento_mes.style.background = cor_original;
			mem_nascimento_ano.style.background = cor_original;
		}
		
		if(mem_bairro.value == ''){
			mem_bairro.style.background = cor_erro;
		} else {
			mem_bairro.style.background = cor_original;
		}
		
		if(mem_uf.value == ''){
			mem_uf.style.background = cor_erro;
		} else {
			mem_uf.style.background = cor_original;
		}
		
		if(mem_telefone.value == ''){
			mem_telefone.style.background = cor_erro;
		} else {
			mem_telefone.style.background = cor_original;
		}
		
		if(mem_email.value == ''){
			mem_email.style.background = cor_erro;
		} else {
			mem_email.style.background = cor_original;
		}
		
		if(mem_senha.value == ''){
			mem_senha.style.background = cor_erro;
		} else {
			mem_senha.style.background = cor_original;
		}
		
		if(mem_nome.style.background == cor_erro || mem_sobrenome.style.background == cor_erro || mem_nascimento_dia.style.background == cor_erro || mem_nascimento_mes.style.background == cor_erro || mem_nascimento_ano.style.background == cor_erro || mem_bairro.style.background == cor_erro || mem_uf.style.background == cor_erro || mem_telefone.style.background == cor_erro || mem_email.style.background == cor_erro || mem_senha.style.background == cor_erro){
			alert("Os campos em vermelho são de preenchimento obrigatório!");
			return false
		}
		
		// Verifica formatação dos campos	
		if(mem_email.value.indexOf('@') > -1){
			mem_email.style.background = cor_original;
		} else {
			mem_email.style.background = cor_alert;
		}
	
		if(mem_email.style.background == cor_alert){
			alert("Verifique a formatação dos campos amarelos, siga os exemplos indicados ao lado do campo.");
			return false
		}
	}
}
-->