
// 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 = "#ff0000";
		theForm.nome.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		nome.style.color = "#333333";	
	}
	
	var email = document.getElementById("email");
	if (theForm.email.value == ""){
		email.style.color = "#ff0000";
		theForm.email.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		email.style.color = "#333333";	
	}
	
	var mensagem = document.getElementById("mensagem");
	if (theForm.mensagem.value == ""){
		mensagem.style.color = "#ff0000";
		theForm.mensagem.focus();
		msgErro.innerHTML = "Por favor, verifique o preencimento dos campos indicados e tente novamente.";
		msgErro.className = "erro";
		return (false);
	}else{
		mensagem.style.color = "#333333";	
	}
}

function valida_boletim(theForm){
	
		
	var nome = document.getElementById("nome");
	if (theForm.nome.value == ""){
		theForm.nome.focus();
		alert("Favor preencher o campo Nome");
		return false;
	}
	
	var email = document.getElementById("email");
	if (theForm.email.value == ""){
		theForm.email.focus();
		alert("Favor preencher o campo E-mail");
		return false;
	}
	
	var endereco = document.getElementById("endereco");
	if (theForm.endereco.value == ""){
		theForm.endereco.focus();
		alert("Favor preencher o campo Endereço");
		return false;
	}
	
	var cep = document.getElementById("cep");
	if (theForm.cep.value == ""){
		theForm.cep.focus();
		alert("Favor preencher o campo CEP");
		return false;
	}
	
	var cidade = document.getElementById("cidade");
	if (theForm.cidade.value == ""){
		theForm.cidade.focus();
		alert("Favor preencher o campo Cidade");
		return false;
	}
	
	var estado = document.getElementById("estado");
	if (theForm.estado.value == ""){
		theForm.estado.focus();
		alert("Favor preencher o campo Estado");
		return false;
	}
	
}
function valida_imprensa(){

	if(document.form3.nome.value == ""){
		alert("PREENCHA O CAMPO NOME!");
		document.form3.nome.focus();
		return false;
	}
	
	if(document.form3.veiculo.value == ""){
		alert("PREENCHA O CAMPO VEÍCULO!");
		document.form3.veiculo.focus();
		return false;
	}
	
	if(document.form3.funcao.value == ""){
		alert("PREENCHA O CAMPO FUNÇÃO!");
		document.form3.funcao.focus();
		return false;
	}
	
	if(document.form3.cidade.value == ""){
		alert("PREENCHA O CAMPO CIDADE!");
		document.form3.cidade.focus();
		return false;
	}
	
	if(document.form3.uf.value == ""){
		alert("PREENCHA O CAMPO ESTADO!");
		document.form3.uf.focus();
		return false;
	}
	
	if(document.form3.email.value == ""){
		alert("PREENCHA O CAMPO E-MAIL!");
		document.form3.email.focus();
		return false;
	}
	if(document.form3.login.value == ""){
		alert("PREENCHA O CAMPO LOGIN!");
		document.form3.login.focus();
		return false;
	}
	if(document.form3.senha.value == ""){
		alert("PREENCHA O CAMPO SENHA!");
		document.form3.senha.focus();
		return false;
	}
	if((document.form3.senha.value != document.form3.conf_senha.value) || document.form3.conf_senha.value == ""){
		alert("A SENHA NÃO CONFERE!");
		document.form3.conf_senha.focus();
		return false;
	}
return true;

}

function esconde(){

	formulario.style.display='none';

}

function mostra(){
	data_doacao.style.display='none';
	formulario.style.display='';
	document.form1.data_doador.disabled 
	
}

function mostra2(){
	
	data_doacao.style.display='';
	formulario.style.display='';
	document.form1.data_doador.disabled = (document.form1.data_doador.disabled) ? 0 : 1;
	
}
