// JavaScript Document

function validaEgresso1() {
	var nome 		= document.getElementById("nome");
	var curso 		= document.getElementById("curso");
	var inicio 		= document.getElementById("inicio");
	var conclusao 	= document.getElementById("conclusao");
	var endereco 	= document.getElementById("endereco");
	var numero 		= document.getElementById("numero");
	var bairro		= document.getElementById("bairro");
	var cidade 		= document.getElementById("cidade");
	var estado 		= document.getElementById("estado");
	var cep 		= document.getElementById("cep");
	var cepZona 	= document.getElementById("zonacep");
	var dddfone 	= document.getElementById("dddfone");
	var fone 		= document.getElementById("fone");
	var email 		= document.getElementById("email");
	
	if (nome.value.length < 10) {
		alert("Preencha seu nome completo.");
		alteraCor(nome);
		return false;
	}
	
	if (curso.value == 0) {
		alert("Selecione seu curso.");
		alteraCor(curso);
		return false;
	}
	
	if (inicio.value.length < 8) {
		alert("Preencha a data de início de seu curso.")
		alteraCor(inicio);
		return false
	}
	
	if (conclusao.value.length < 8) {
		alert("Preencha a data de conclusão de seu curso.")
		alteraCor(conclusao);
		return false
	}
	
	if (endereco.value.length < 10) {
		alert("Preencha seu Endereço.");
		alteraCor(endereco);
		return false;
	}
	
	if (!numero.value.length > 0 || isNaN(numero.value)) {
		alert("Verifique a digitação do número de seu endereço.");
		alteraCor(numero);
		return false;
	}

	if (bairro.value.length < 3) {
		alert("Preencha o bairro.");
		alteraCor(bairro);
		return false;
	}
	


	if (cidade.value.length < 3) {
		alert("Preencha a cidade.");
		alteraCor(cidade);
		return false;
	}
	
	if (estado.value == 0){
		alert("Selecione seu Estado.");
		alteraCor(estado);
		return false;
	}
	
	if (cep.value.length != 5 || cepZona.value.length != 3) {
		alert("O CEP deve ser preenchido.");
		alteraCor(cepZona);
		alteraCor(cep);
		return false;
	}
	
	if (dddfone.value.length != 2) {
		alert("Preencha o DDD de seu telefone.");
		alteraCor(dddfone);
		return false;
	}
	
	if (fone.value.length != 8) {
		alert("Preencha seu número de telefone.");
		alteraCor(fone);
		return false;
	}
	
	if (!checaMail(email.value)) {
		alert("Preencha seu e-mail corretamente.");
		alteraCor(email);
		return false;
	}
	
}
