// JavaScript Document
function valida(theForm){
	
	var msgErro = document.getElementById("msgErro");
	msgErro.innerHTML = "";
	msgErro.className = "";
	
	var nome = document.getElementById("nome");
	if (theForm.nome.value == ""){
		nome.style.color = "#CC0000";
		theForm.nome.focus();
		msgErro.innerHTML = "Por favor, digite seu nome";
		msgErro.className = "erro";
		return (false);
	}else{
		nome.style.color = "#000000";	
	}
	
var email = document.getElementById("email");
	if (theForm.email.value == ""){
		email.style.color = "#CC0000";
		theForm.email.focus();
		msgErro.innerHTML = "Por favor, digite seu e-mail";
		msgErro.className = "erro";
		return (false);
	}else{
		email.style.color = "#666666";	
	}
	
	var email = document.getElementById("email");
	var filtro=/^.+@.+\..{2,3}$/;
	if (filtro.test(theForm.email.value) == false){
		email.style.color = "#CC0000";
		theForm.email.focus();
		msgErro.innerHTML = "E-mail inválido";
		msgErro.className = "erro";
		return (false);
	}else{
		email.style.color = "#666666";	
	}
	

	var n_grupo = document.getElementById("n_grupo");
	if (theForm.n_grupo.value == ""){
		n_grupo.style.color = "#CC0000";
		theForm.n_grupo.focus();
		msgErro.innerHTML = "Por favor, digite o número do seu grupo.";
		msgErro.className = "erro";
		return (false);
	}else{
		n_grupo.style.color = "#000000";	
	}
	var n_cota = document.getElementById("n_cota");
	if (theForm.n_cota.value == ""){
		n_cota.style.color = "#CC0000";
		theForm.n_cota.focus();
		msgErro.innerHTML = "Por favor, digite o número da sua cota.";
		msgErro.className = "erro";
		return (false);
	}else{
		n_cota.style.color = "#000000";	
	}

}