function validarRecebimento()
{
	with (document.formAssociese)
	{
		if (preferencia[1].checked == true)
		{
			if (enderecopro.value.length < 3)
			{
				alert('Informe endereço profissional para poder trocar esta opção');
				preferencia[0].checked = true;
			}
		}
		else
		{
			preferencia[0].checked = true;
		}
	}
}

function validarAssociado()
{
	msgErros = '';
	cntErros = 0;
	with (document.formAssociese)
	{
		if (nome.value.length < 3)
		{
			msgErros += "-> Nome\n";
			cntErros++;
		}
		
		if (nascimento.value.length < 10)
		{
			msgErros += "-> Nascimento\n";
			cntErros++;
		}
		

		if (checkDATE(nascimento.value)!=true)
		{
			msgErros += "-> Data de nascimento inválida\n";
			cntErros++;
		}
		
		if (enderecores.value.length < 3)
		{
			msgErros += "-> Endereço residencial\n";
			cntErros++;
		}
		
		if (cidaderes.value.length < 3)
		{
			msgErros += "-> Cidade residencial\n";
			cntErros++;
		}
		
		if (ufres.selectedIndex == 0)
		{
			msgErros += "-> Selecione o estado de sua residência\n";
			cntErros++;
		}
		
		if (cepres.value.length < 3)
		{
			msgErros += "-> CEP residencial\n";
			cntErros++;
		}
		
		if (foneres.value.length < 10)
		{
			msgErros += "-> Telefone residencial\n";
			cntErros++;
		}
		
		if (celular.value.length < 10)
		{
			msgErros += "-> Celular\n";
			cntErros++;
		}
		
		if (CPFValido(cpf.value)!=true)
		{
			msgErros += "-> CPF inválido\n";
			cntErros++;
		}
		
		if (id_categoria.selectedIndex == 0)
		{
			msgErros += "-> Selecione a categoria\n";
			cntErros++;
		}
		
		
		
		
		
		if ((preferencia[0].checked == false) && (preferencia[1].checked == false))
		{
			msgErros += "-> Endereço para recebimento de correspondências?\n";
			cntErros++;
		}
	
		if (cntErros > 0)
		{
			alert("Você precisa preencher corretamente o(s) campo(s)\n abaixo para poder enviar o formulário:\n" + msgErros);
		}
		else
		{
			if (confirm("Você está de acordo com as informações contidas no formulário?"))
			{
				action = "./sitefree/cadastro_associado.php";
				submit();
			}
		}
	}

}



function validarAssociado2()
{
	msgErros = '';
	cntErros = 0;
	with (document.formAssociese)
	{
		
		if (senha.value.length < 6)
		{
			msgErros += "-> Senha deve ter, no mínimo, 6 caracteres\n";
			cntErros++;
		}
		else
		{
			if (confirmaSenha.value != senha.value)
			{
				msgErros += "-> Confirme a senha\n";
				cntErros++;
			}
		}
		
		if (nome.value.length < 3)
		{
			msgErros += "-> Nome\n";
			cntErros++;
		}
		
		if (nascimento.value.length < 10)
		{
			msgErros += "-> Nascimento\n";
			cntErros++;
		}
		

		if (checkDATE(nascimento.value)!=true)
		{
			msgErros += "-> Data de nascimento inválida\n";
			cntErros++;
		}
		
		if (enderecores.value.length < 3)
		{
			msgErros += "-> Endereço residencial\n";
			cntErros++;
		}
		
		if (cidaderes.value.length < 3)
		{
			msgErros += "-> Cidade residencial\n";
			cntErros++;
		}
		
		if (ufres.value.length < 2)
		{
			msgErros += "-> Informe o estado de sua residência\n";
			cntErros++;
		}
		
		if (cepres.value.length < 3)
		{
			msgErros += "-> CEP residencial\n";
			cntErros++;
		}
		
		if (foneres.value.length < 10)
		{
			msgErros += "-> Telefone residencial\n";
			cntErros++;
		}
		
		if (celular.value.length < 10)
		{
			msgErros += "-> Celular\n";
			cntErros++;
		}
		
		if (CPFValido(cpf.value)!=true)
		{
			msgErros += "-> CPF inválido\n";
			cntErros++;
		}
		
		if (id_categoria.selectedIndex == 0)
		{
			msgErros += "-> Selecione a categoria\n";
			cntErros++;
		}
		
		
		
		
		
		if ((preferencia[0].checked == false) && (preferencia[1].checked == false))
		{
			msgErros += "-> Endereço para recebimento de correspondências?\n";
			cntErros++;
		}
	
		if (cntErros > 0)
		{
			alert("Você precisa preencher corretamente o(s) campo(s)\n abaixo para poder enviar o formulário:\n" + msgErros);
		}
		else
		{
			if (confirm("Você está de acordo com as informações contidas no formulário?"))
			{
				action = "./sitefree/atualiza_associado.php";
				submit();
			}
		}
	}

}





	var intContaTam = 2;//posição do tamanho atual
	var vetFonte = new Array ();
	vetFonte [0] = "10px";
	vetFonte [1] = "11px";
	vetFonte [2] = "12px";
	vetFonte [3] = "13px";
	vetFonte [4] = "14px";
	
	function texto (opcao,minhadiv) {
		
		if (opcao=="+") {
			intContaTam++;
			if (intContaTam>=vetFonte.length) {
				intContaTam = vetFonte.length-1;
			}
			else {
				
				eval("document.getElementById('"+minhadiv+"')").style.fontSize = vetFonte[intContaTam];
				
				
				var p = document.getElementsByTagName('p');
				for(i=0;i<p.length;i++) {
					  if(p[i].style.fontSize) {
						 var s = parseInt(p[i].style.fontSize.replace("px",""));
					  } else {
						 var s = 12;
					  }
					  if(s!=vetFonte[intContaTam]) {
						 s += 1;
					  }
					  p[i].style.fontSize = s+"px"
					}
				
			}
				
		} else {
		
			intContaTam--;
			if (intContaTam<0) {
				intContaTam=0;
				}
			
			else {
			
				eval("document.getElementById('"+minhadiv+"')").style.fontSize = vetFonte[intContaTam];
				
				var p = document.getElementsByTagName('p');
				for(i=0;i<p.length;i++) {
					  if(p[i].style.fontSize) {
						 var s = parseInt(p[i].style.fontSize.replace("px",""));
					  } else {
						 var s = 12;
					  }
					  if(s!=vetFonte[intContaTam]) {
						 s -= 1;
					  }
					  p[i].style.fontSize = s+"px"
					}
				
			}
			
			
		}
	}
