// 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 = "#666666";	
	}
	
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 fone = document.getElementById("fone");
	if (theForm.fone.value == ""){
		fone.style.color = "#CC0000";
		theForm.fone.focus();
		msgErro.innerHTML = "Por favor, digite um telefone para contato.";
		msgErro.className = "erro";
		return (false);
	}else{
		fone.style.color = "#666666";	
	}
	
	var assunto = document.getElementById("assunto");
	if (theForm.assunto.value == ""){
		assunto.style.color = "#CC0000";
		theForm.msg.focus();
		msgErro.innerHTML = "Por favor, digite o assunto.";
		msgErro.className = "erro";
		return (false);
	}else{
		assunto.style.color = "#666666";	
	}
	
	
	var msg = document.getElementById("msg");
	if (theForm.msg.value == ""){
		msg.style.color = "#CC0000";
		theForm.msg.focus();
		msgErro.innerHTML = "Por favor, digite a mensagem.";
		msgErro.className = "erro";
		return (false);
	}else{
		msg.style.color = "#666666";	
	}
}


	
