// JavaScript Document

function ValidadorInteresse(theForm)
{
	emailRE = new RegExp("^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$");

	var RegExPattern = /^((((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$/;


	if (theForm.Nome.value == "")
	{
		alert("Por favor, preencha o campo \"Nome\".");
		theForm.Nome.focus();
		return (false);
	}
	if (theForm.Email.value == "")
	{
		alert("Por favor digite seu E-mail");
		theForm.Email.focus();
		return (false);
	}
	if (emailRE.test(theForm.Email.value) != true)
	{
		alert("Este \"E-mail\" não é válido.");
		theForm.Email.focus();
		return (false);	
	}

	if (theForm.Telefone.value == "")
	{
		alert("Por favor preencha o campo \"Telefone\".");
		theForm.Telefone.focus();
		return (false);
	}
	return (true);
}

function Validador(theForm)
{
	emailRE = new RegExp("^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$");

	var RegExPattern = /^((((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$/;


	if (theForm.Nome.value == "")
	{
		alert("Por favor, preencha o campo \"Nome\".");
		theForm.Nome.focus();
		return (false);
	}
	if (theForm.Email.value == "")
	{
		alert("Por favor digite seu E-mail");
		theForm.Email.focus();
		return (false);
	}
	if (emailRE.test(theForm.Email.value) != true)
	{
		alert("Este \"E-mail\" não é válido.");
		theForm.Email.focus();
		return (false);	
	}

	if (theForm.Telefone.value == "")
	{
		alert("Por favor preencha o campo \"Telefone\".");
		theForm.Telefone.focus();
		return (false);
	}

	if (theForm.Endereco.value == "")
	{
		alert("Por favor preencha o campo \"Endereco\".");
		theForm.Endereco.focus();
		return (false);
	}
	
	if (theForm.Numero.value == "")
	{
		alert("Por favor preencha o campo \"Número\".");
		theForm.Numero.focus();
		return (false);
	}
	
	if (theForm.Numero.value.length > 9)
	{
		alert("Por favor, insira no máximo 20 caracteres no campo \"Número\".");
		theForm.Numero.focus();
		return (false);
	}
	
	if (theForm.Bairro.value == "")
	{
		alert("Por favor preencha o campo \"Bairro\".");
		theForm.Bairro.focus();
		return (false);
	}
	
	if (theForm.CEP.value == "")
	{
		alert("Por favor preencha o campo \"CEP\".");
		theForm.CEP.focus();
		return (false);
	}
	
	if (theForm.CEP.value.length > 9)
	{
		alert("Por favor, insira no máximo 9 caracteres no campo \"CEP\".");
		theForm.CEP.focus();
		return (false);
	}
	
	if (theForm.Cidade.value == "")
	{
		alert("Por favor preencha o campo \"Cidade\".");
		theForm.Cidade.focus();
		return (false);
	}
	
	if (theForm.UF.value == "")
	{
		alert("Por favor preencha o campo \"UF\".");
		theForm.UF.focus();
		return (false);
	}
	
	if (theForm.UF.value.length > 2)
	{
	alert("Por favor, insira no máximo 2 caracteres no campo \"UF\".");
	theForm.UF.focus();
	return (false);
	}
	
	return (true);
}