<!--


function validaCadastro(){


	var cpf = document.getElementById("cpf");
	var uf = document.getElementById("uf");
	var estadoProv = document.getElementById("estadoProvincia");
	var data_nasc = document.getElementById("data_nasc");
	var senha = document.getElementById("senha");
	var senha_conf = document.getElementById("senha_conf");
	var pais = document.getElementById("pais");


		if (pais.value == "0"){
			alert("Selecione um país!");
			return false;
		}

      	if (uf.value == "0" && pais.value == "Brasil"){
      		alert("Selecione um estado!");
      		return false;
      	}

      	if (uf.value != "0" && pais.value == "Brasil"){
      		document.getElementById("estadoProvincia").value = "";
      	}

    	if (estadoProv.value == "" && pais.value != "Brasil"){
      		alert("Informe o estado/provincia!");
      		return false;
      	}

		if (estadoProv.value != "" && pais.value != "Brasil"){
      		document.getElementById("estado").value = "0";
      	}


	// CPF
	if(!validaForm.isCPF(cpf.value)){
		alert("CPF inválido, verifique se digitou corretamente!");
		return false;
	}

	// DATA NASCIMENTO
	if(!validaForm.isData(data_nasc.value)){
		alert("Data de nascimento inválida, verifique se digitou corretamente!");
		return false;
	}

	if(senha.value.length < 4){
		alert("A senha deve conter no mínimo 4 caracteres!");
		return false;
	}else{
		if(senha.value != senha_conf.value){
			alert("As senhas não conferem, ou estão em branco!");
			senha.value = "";
			senha.focus();
			senha_conf.value = "";
			return false;
		}
	}

	if (pais.value == "Brasil"){
      		document.getElementById("estado").value = document.getElementById("uf").value;
      		document.getElementById("cep").value 	= document.getElementById("cep1").value;
     }

     if (pais.value != "Brasil"){
      		document.getElementById("estado").value = document.getElementById("estadoProvincia").value;
     }

	document.getElementById("formCadastro").submit();

}


function validaAlteraCadastro(){



	var uf = document.getElementById("uf");
	var estadoProv = document.getElementById("estadoProvincia");
	var pais = document.getElementById("pais");





	var ddd_res = document.getElementById("ddd_res");
	var tel_res = document.getElementById("tel_res");

	var ddd_cel = document.getElementById("ddd_cel");
	var tel_cel = document.getElementById("tel_cel");

	var ddd_com = document.getElementById("ddd_com");
	var tel_com = document.getElementById("tel_com");

	var endereco = document.getElementById("endereco");
	var numero = document.getElementById("numero");
	var bairro = document.getElementById("bairro");
	var cidade = document.getElementById("cidade");
	var cep = document.getElementById("cep");
	var email = document.getElementById("email");
	var senha = document.getElementById("senha");
	var senha_conf = document.getElementById("senha_conf");



		if (pais.value == "Brasil"){
      		document.getElementById("estado").value = document.getElementById("uf").value;
      		document.getElementById("cep").value 	= document.getElementById("cep1").value;
     	}

     	if (pais.value != "Brasil"){
      		document.getElementById("estado").value = document.getElementById("estadoProvincia").value;
    	}







	function testaEstado(){
     	var i = document.getElementById('estado').selectedIndex;
      		if (i == "0"){
      			alert("Selecione um estado!");
      			return false;
      		}
      	}


	// DDD residencial
	if(!validaForm.isNumero(ddd_res.value, 2)){
		alert("O DDD e o telefone residencial são de preenchimento obrigatório.\n Verifique se você digitou corretamente!");
		return false;
	}

	// telefone residencial
	if(!validaForm.isNumero(tel_res.value, 8)){
		alert("Telefone residencial é de preenchimento obrigatótio.\n Verifique se você digitou corretamente!");
		return false;
	}

	// DDD cel e Telefone cel
	if(tel_cel.value != ""){
		if(!validaForm.isNumero(ddd_cel.value,2)){
			alert("O DDD do telefone celular esta incorreto!");
			return false;
		}
		if(!validaForm.isNumero(tel_cel.value , 8)){
			alert("Telefone celular incorreto, verifique se digitou corretamente!");
			return false;
		}
	}

	// DDD Comercial e Telefone comercial
	if(tel_com.value != ""){
		if(!validaForm.isNumero(ddd_com.value,2)){
			alert("O DDD do telefone comercial esta incorreto!");
			return false;
		}
		if(!validaForm.isNumero(tel_com.value , 8)){
			alert("Telefone comercial incorreto, verifique se digitou corretamente!");
			return false;
		}
	}


	if(endereco.value == "" || endereco.value.length < 3){
		alert("Endereço inválido, por favor preencher corretamente!");
		return false;
	}

	if(!validaForm.isNumero(numero.value)){
		alert("Número do endereço esta incorreto, favor preencher corretamente!");
		return false;
	}

	if(bairro.value == "" || bairro.value.length < 3){
		alert("O campo bairro é obrigatório verifique se preencheu corretamente!");
		return false;
	}

	if(cidade.value == "" || cidade.value.length < 3){
		alert("Campo Cidade inválido, verifique se preencheu corretamente!");
		return false;
	}

	if(!validaForm.isNumero(cep.value,8)){
		alert("CEP inválido, favor preencher corretamente!");
		return false;
	}

	if(!validaForm.isEmail(email.value)){
		alert("Campo email inválido, favor preencher corretamente!");
		return false;
	}

	if(senha.value.length < 4){
		alert("A senha deve conter no mínimo 4 caracteres!");
		return false;
	}else{
		if(senha.value != senha_conf.value){
			alert("As senhas não conferem, ou estão em branco!");
			senha.value = "";
			senha.focus();
			senha_conf.value = "";
			return false;
		}
	}






		if (pais.value == "0"){
			alert("Selecione um país!");
			return false;
		}

      	if (uf.value == "0" && pais.value == "Brasil"){
      		alert("Selecione um estado!");
      		return false;
      	}

      	if (uf.value != "0" && pais.value == "Brasil"){
      		document.getElementById("estadoProvincia").value = "";
      	}

    	if (estadoProv.value == "" && pais.value != "Brasil"){
      		alert("Informe o estado/provincia!");
      		return false;
      	}

		if (estadoProv.value != "" && pais.value != "Brasil"){
      		document.getElementById("estado").value = "0";
      	}

      	if (pais.value == "Brasil"){
      		document.getElementById("estado").value = document.getElementById("uf").value;
      		document.getElementById("cep").value 	= document.getElementById("cep1").value;
     	}

     	if (pais.value != "Brasil"){
      		document.getElementById("estado").value = document.getElementById("estadoProvincia").value;
      		document.getElementById("cep").value 	= document.getElementById("codigoPostal").value;
    	}

	document.getElementById("formAlteraCadastro").submit();

}

function validaFormEndereco(){
	var endereco = document.getElementById("endereco");
	var numero = document.getElementById("numero");
	var bairro = document.getElementById("bairro");
	var cidade = document.getElementById("cidade");
	var cep = document.getElementById("cep");

	if(endereco.value == ""){
		alert("Por favor preencha o campo endereço!");
		return false;
	}

	if(numero.value == "" || !validaForm.isNumero(numero.value)){
		alert("Por favor preencha o campo número corretamente!");
		return false;
	}

	if(bairro.value == ""){
		alert("Por favor preencha o campo bairro!");
		return false;
	}

	if(cidade.value == ""){
		alert("Por favor preencha o campo cidade!");
		return false;
	}

	if(!validaForm.isNumero(cep.value,8)){
		alert("Por favor preencha o CEP corretamente apenas com números! ex.: 01330902");
		return false;
	}

	execFormPost('sessao','formEndereco');
}

function closeCadError(){
	var div = document.getElementById("cadError");
	div.innerHTML = "";
}


$(document).ready(
		function(){
			$("#lostPassForm").hide();
		}

	);

$("#lostPassLink").click(
	function(){
		$("#lostPassForm").show();
	}
);

-->