function valida_cadastro_assinatura()
{
		
	if(document.getElementById("nome").value == '')
	{
		alert("Digite seu Nome.");
		document.getElementById("nome").focus();
		return false;
	}
		
	if(document.form_nova.email.value == "" || document.form_nova.email.value.indexOf('@')==-1 || document.form_nova.email.value.indexOf('.')==-1)
	{
		alert("Digite seu E-mail corretamente!");
		document.form_nova.email.focus();
		return false;
	}
	
	if(document.form_nova.senha.value == '')
	{
		alert("Digite a Senha.");
		document.form_nova.senha.focus();
		return false;
	}
	if(document.form_nova.conf_senha.value == '')
	{
		alert("Digite a Confirmação da Senha.");
		document.form_nova.conf_senha.focus();
		return false;
	}

	if(document.form_nova.senha.value != document.form_nova.conf_senha.value)
	{
		alert("A senha não confere com a confirmação.");
		document.form_nova.conf_senha.focus();
		return false;
	}

	if(document.getElementById("endereco").value == '')
	{
		alert("Digite o Endereço.");
		document.getElementById("endereco").focus();
		return false;
	}
	if(document.getElementById("numero").value == '')
	{
		alert("Digite o Número.");
		document.getElementById("numero").focus();
		return false;
	}
	if(isNaN(document.getElementById("numero").value))
	{
		alert("Digite somente Números!");
		document.getElementById("numero").focus();
		return false;
	}	
	if(document.getElementById("bairro").value == '')
	{
		alert("Digite o Bairro.");
		document.getElementById("bairro").focus();
		return false;
	}
	if(document.getElementById("cidade").value == '')
	{
		alert("Digite a Cidade.");
		document.getElementById("cidade").focus();
		return false;
	}
	if(document.getElementById("cep").value == '')
	{
		alert("Digite o CEP.");
		document.getElementById("cep").focus();
		return false;
	}
	if(isNaN(document.getElementById("cep").value))
	{
		alert("Digite somente Números!");
		document.getElementById("cep").focus();
		return false;
	}	
	if(document.getElementById("email").value == '')
	{
		alert("Digite seu E-mail.");
		document.getElementById("email").focus();
		return false;
	}
}

function valida_ass() {
	
	soma = 0;
	var i;
	for(i=0;i<5;i++)
	{
		if(document.form1.datav[i].checked)
		{
			soma = 1;
		}		
	}
	if(soma == 0)
	{
		alert("Escolha uma data de vencimento para o Boleto.");
		return false;
	}

}

function valida_renovacao()
{
	
	if(document.getElementById("email").value == '')
	{
		alert("Digite seu E-mail.");
		document.getElementById("email").focus();
		return false;
	}
	if(document.form_renovacao.senha.value == '')
	{
		alert("Digite sua Senha.");
		document.form_renovacao.senha.focus();
		return false;
	}
	
}


function valida_assinatura()
{
	soma = 0;
	var i;
	for(i=0;i<document.form_assinatura.id_tipo_cont.length;i++)
	{
		if(document.form_assinatura.id_tipo_cont[i].checked)
		{
			soma = 1;
		}		
	}
	if(soma == 0)
	{
		alert("Escolha um tipo de Assinatura.");
		return false;
	}

	
	soma = 0;
	var i;
	for(i=0;i<5;i++)
	{
		if(document.form_assinatura.datav[i].checked)
		{
			soma = 1;
		}		
	}
	if(soma == 0)
	{
		alert("Escolha uma data de vencimento para o Boleto.");
		return false;
	}

}

function valida_pesquisa()
{
	if(document.getElementById("nome").value == "")
	{
		alert("Digite seu Nome!");
		document.getElementById("nome").focus();
		return false;
	}
	if(document.getElementById("email").value == "" || document.getElementById("email").value.indexOf('@')==-1 || document.getElementById("email").value.indexOf('.')==-1)
	{
		alert("Digite seu E-mail corretamente!");
		document.getElementById("email").focus();
		return false;
	}
	
	if(document.formContato.sexo[0].checked == false && document.formContato.sexo[1].checked == false)
	{
		alert("Informe o Sexo!");
		return false;
	}
	
	if(document.getElementById("nacionalidade").value == "")
	{
		alert("Digite a Nacionalidade!");
		document.getElementById("nacionalidade").focus();
		return false;
	}
	
	if(document.getElementById("dia_nasc").value == "" || document.getElementById("mes_nasc").value == "" || document.getElementById("ano_nasc").value == "")
	{
		alert("Informe sua Data de Nascimento!");
		document.getElementById("dia_nasc").focus();
		return false;
	}
	
	if(document.getElementById("estado_civil").value == "")
	{
		alert("Informe seu Estado Civil!");
		document.getElementById("estado_civil").focus();
		return false;
	}
	
	if(document.getElementById("ensino").value == "")
	{
		alert("Informe sua Escolaridade!");
		document.getElementById("ensino").focus();
		return false;
	}
	
	if(document.formContato.tem_computador[0].checked == false && document.formContato.tem_computador[1].checked == false)
	{
		alert("Possui Computador?");
		return false;
	}
	
	if(document.getElementById("utiliza_net").value == "")
	{
		alert("Utiliza Internet?");
		document.getElementById("utiliza_net").focus();
		return false;
	}
	
	if(document.formContato.trabalha[0].checked == false && document.formContato.trabalha[1].checked == false)
	{
		alert("Você atualmente esta trabalhando?");
		return false;
	}
	
	if(document.formContato.trabalha[0].checked)
	{
		if(document.getElementById("profissao").value == "")
		{
			alert("Informe sua Profissão!");
			document.getElementById("profissao").focus();
			return false;
		}
	}
	
	
	if(document.getElementById("cep").value == "")
	{
		alert("Informe o CEP!");
		document.getElementById("cep").focus();
		return false;
	}
	else
	{
		if(isNaN(document.getElementById("cep").value))
		{
			alert("Digite somente Números!");
			document.getElementById("cep").focus();
			return false;
		}
	}
	
	if(document.getElementById("tipo_residencia").value == "")
	{
		alert("Informe o tipo de residência!");
		document.getElementById("tipo_residencia").focus();
		return false;
	}
	
	if(document.formContato.outro_imovel[0].checked == false && document.formContato.outro_imovel[1].checked == false)
	{
		alert("Possui outro Imóvel?");
		return false;
	}
	
	if(document.formContato.filhos[0].checked == false && document.formContato.filhos[1].checked == false)
	{
		alert("Possui Filhos?");
		return false;
	}

	if(document.formContato.filhos[0].checked)
	{
		if(document.getElementById("qtde_filhos").value == "")
		{
			alert("Informe a Quantidade de Filhos!");
			document.getElementById("qtde_filhos").focus();
			return false;
		}
		else
		{
			if(isNaN(document.getElementById("qtde_filhos").value))
			{
				alert("Digite somente Números!");
				document.getElementById("qtde_filhos").focus();
				return false;
			}
		}
	
		if(document.getElementById("idade").value == "")
		{
			alert("Informe a Idade!");
			document.getElementById("idade").focus();
			return false;
		}
	}
		
	if(document.getElementById("revista_lida").value == "")
	{
		alert("Quais revistas são lidas na sua casa?");
		document.getElementById("revista_lida").focus();
		return false;
	}
		
	if(document.getElementById("revista_coleciona").value == "")
	{
		alert("Coleciona alguma revista?");
		document.getElementById("revista_coleciona").focus();
		return false;
	}
		
	if(document.getElementById("compra_4x4").value == "")
	{
		alert("Compra a Revista 4x4 e Cia?");
		document.getElementById("compra_4x4").focus();
		return false;
	}
	
	var soma = 0;
	for(i=0;i<2;i++)
	{ 
		if(document.formContato.banca[i].checked == true)
		soma = soma + 1;
	}
	
	if(soma == 0)
	{
		alert("Existe aluguma banca próxima à sua residência?");
		return false;
	}
	else
	{
	
	if(document.formContato.banca[1].checked == true)
	{
		if(document.getElementById("banca_proxima").value == "")
		{
			alert("Onde se encontra a banca mais próxima?");
			document.getElementById("banca_proxima").focus();
			return false;
		}
	}
	
	}
	
	if(document.formContato.possui_4x4[0].checked == false && document.formContato.possui_4x4[1].checked == false)
	{
		alert("Possui Veículo 4x4?");
		return false;
	}
	
	
	if(document.formContato.possui_4x4[0].checked == true)
	{
		if(document.formContato.possui_4x4[0].checked == true)
		{
					
			if(document.getElementById("marca_4x4").value == "")
			{
				alert("Qual a Marca?");
				document.getElementById("marca_4x4").focus();
				return false;
			}
					
			if(document.getElementById("modelo_4x4").value == "")
			{
				alert("Qual o Modelo?");
				document.getElementById("modelo_4x4").focus();
				return false;
			}
	
		}
		
		if(document.formContato.regiao_nec_4x4[0].checked == false && document.formContato.regiao_nec_4x4[1].checked == false)
		{
			alert("Mora em região que necessite deste tipo de veículo?");
			return false;
		}
	
		
		if(document.formContato.regiao_nec_4x4[1].checked == true)
		{
					
			if(document.getElementById("pq_modelo_4x4").value == "")
			{
				alert("Qual outro Motivo?");
				document.getElementById("pq_modelo_4x4").focus();
				return false;
			}
			
			if(document.getElementById("pq_modelo_4x4").value == "outros")
			{
				if(document.getElementById("outros_pq_modelo_4x4").value == "")
				{
					alert("Qual outro Motivo?");
					document.getElementById("outros_pq_modelo_4x4").focus();
					return false;
				}
			}
				
		}
		
		if(document.getElementById("trocar_veiculo").value == "")
		{
			alert("Se fosse trocar de veículo por qual trocaria?");
			document.getElementById("trocar_veiculo").focus();
			return false;
		}
	}
	
	
	if(document.getElementById("pratica_off-road").value == "")
	{
		alert("Pratica atividades off-road:");
		document.getElementById("pratica_off-road").focus();
		return false;
	}
	if(document.getElementById("nao_pratica").style.display== "inline")
	{
		if(document.getElementById("pratica_outro_off-road").value == "")
		{
			alert("Qual outro tipo de off-road você pratica?");
			document.getElementById("pratica_outro_off-road").focus();
			return false;
		}
	
		if(document.getElementById("pratica_outro_off-road").value == "Outros")
		{
			if(document.getElementById("outro_off-road").value == "")
			{
				alert("Qual outro tipo de off-road você pratica?");
				document.getElementById("outro_off-road").focus();
				return false;
			}
		}
	}
	if(document.formContato.conhece_festival[0].checked == false && document.formContato.conhece_festival[1].checked == false)
	{
		alert("Conhece o Festival Brasil Off-Road?");
		return false;
	}

	if(document.formContato.conhece_festival[0].checked == true)
	{
		if(document.getElementById("conhece_festival_ano").value == "")
		{
			alert("Em que ano?");
			document.getElementById("conhece_festival_ano").focus();
			return false;
		}
		else
		{
			if(isNaN(document.getElementById("conhece_festival_ano").value))
			{
				alert("Digite somente Números!");
				document.getElementById("conhece_festival_ano").focus();
				return false;
			}
		}
	}
	
	
	
	if(document.getElementById("mostra_avaliacao").style.display== "inline")
	{
		var soma = 0;
		for(i=0;i<3;i++)
		{ 
			if(document.formContato.radio_foto[i].checked == true)
			soma = soma + 1;
		}
		
		if(soma == 0)
		{
			alert("Escolha a opção sobre as fotos da revista!");
			return false;
		}
		
		var soma = 0;
		for(i=0;i<3;i++)
		{ 
			if(document.formContato.radio_mat[i].checked == true)
			soma = soma + 1;
		}
		
		if(soma == 0)
		{
			alert("Escolha a opção sobre as matérias!");
			return false;
		}
		
		var soma = 0;
		for(i=0;i<3;i++)
		{ 
			if(document.formContato.radio_comp[i].checked == true)
			soma = soma + 1;
		}
		
		if(soma == 0)
		{
			alert("Escolha a opção sobre a compreeenção do texto!");
			return false;
		}
		
		var soma = 0;
		for(i=0;i<3;i++)
		{ 
			if(document.formContato.radio_layout[i].checked == true)
			soma = soma + 1;
		}
		
		if(soma == 0)
		{
			alert("Escolha a opção sobre o nosso layout!");
			return false;
		}
	
	
	
		var soma = 0;
		for(i=0;i<2;i++)
		{ 
			if(document.formContato.comprou_anunc[i].checked == true)
			soma = soma + 1;
		}
		
		if(soma == 0)
		{
			alert("Você efetuou uma compra, com nossos anúncios?");
			return false;
		}
		else
		{
		
		if(document.formContato.comprou_anunc[0].checked == true)
		{
			if(document.getElementById("qual_anunc").value == "")
			{
				alert("Qual anúncio comprado?");
				document.getElementById("qual_anunc").focus();
				return false;
			}
		}
		
		}
	
	}
}


