//funçoes que valida campo contato e cadastro

function validaContato() {

	var nome = document.contato.nome.value.length;
	var email = document.contato.email.value.length;
	var telefone = document.contato.telefone.value.length;
	var assuntos = document.contato.assunto.value.length;

	if (nome<1){
	window.alert("Campo NOME não pode ser vazio!");
	document.contato.nome.focus();
	return false;
	}

	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.contato.email.value))) {
		alert("Email inválido, digite novamente por favor.");
		document.contato.email.focus();
		return false;
	}

	if (telefone<1){
	window.alert("Campo TELEFONE não pode ser vazio!");
	document.contato.telefone.focus();
	return false;
	}

	if (assuntos<1){
	window.alert("Campo ASSUNTO não pode ser vazio!");
	document.contato.assunto.focus();
	return false;
	}
}

function validaNews() {

	var nome = document.news.nome.value.length;

	if (nome<1){
	window.alert("Campo NOME não pode ser vazio!");
	document.news.nome.focus();
	return false;
	}

	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.news.email.value))) {
		alert("Email inválido, digite novamente por favor.");
		document.news.email.focus();
		return false;
	}
}
