function Nav_Validator(theForm)
{

	if (theForm.f_NomeDoAssociado.value == "")
	{
		alert("Informe o NOME DO ASSOCIADO.");
		theForm.f_NomeDoAssociado.focus();
		return (false);
	}

	if (theForm.f_NomeDoAssociado.value.length < 3)
	{
		alert("É necessário informar o NOME DO ASSOCIADO.");
		theForm.f_NomeDoAssociado.focus();
		return (false);
	}

	if (theForm.f_Email.value.indexOf("@")==-1)
	{
		alert("E-mail inválido.");
		theForm.f_Email.focus();
		return (false);
	} 

	if (theForm.f_Email.value.indexOf(".")==-1)
	{
		alert("E-mail inválido.");
		theForm.f_Email.focus();
		return (false);
	} 

	if (theForm.f_Endereco.value == "")
	{
		alert("Informe o ENDEREÇO.");
		theForm.f_Endereco.focus();
		return (false);
	}

	if (theForm.f_Endereco.value.length < 5)
	{
		alert("É necessário informar o ENDEREÇO.");
		theForm.f_Endereco.focus();
		return (false);
	}

	if (theForm.f_Cep1.value != "")
	{
		if (theForm.f_Cep1.value.length < 5)
		{
			alert("O CEP deve conter 8 dígitos.");
			theForm.f_Cep1.focus();
			return (false);
		}
	
		if (!/(^\d+$)|(^\d+\.\d+$)/.test(theForm.f_Cep1.value))
		{
			alert("Digite apenas números para o CEP.");
			theForm.f_Cep1.focus();
			return (false);
		}
	}

	if (theForm.f_Cep2.value != "")
	{
		if (theForm.f_Cep2.value.length < 3)
		{
			alert("O CEP deve conter 8 dígitos.");
			theForm.f_Cep2.focus();
			return (false);
		}
	
		if (!/(^\d+$)|(^\d+\.\d+$)/.test(theForm.f_Cep2.value))
		{
			alert("Digite apenas números para o CEP.");
			theForm.f_Cep2.focus();
			return (false);
		}
	}

	if (theForm.f_Cidade.value == "")
	{
		alert("Informe o MUNICÍPIO.");
		theForm.f_Cidade.focus();
		return (false);
	}

	if (theForm.f_Cidade.value.length < 3)
	{
		alert("É necessário informar o MUNICÍPIO.");
		theForm.f_Cidade.focus();
		return (false);
	}

	if (theForm.f_Pais.value == "")
	{
		alert("Informe o PAÍS.");
		theForm.f_Pais.focus();
		return (false);
	}

	if (theForm.f_Pais.value.length < 3)
	{
		alert("É necessário informar o PAÍS.");
		theForm.f_Pais.focus();
		return (false);
	}

	return (true);
}


function limpacomentario()
{
	document.cadastrando.f_Comentario.value=""
}
 

function depura(tipo,obj){
    var sequencia;

    if(tipo == 'num') // campos numéricos
        sequencia = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZçÇáéíóúÁÉÍÓÚàÀâêîôûÂÊÎÔÛãõÃÕäëïöüÄËÏÖÜ@*.,;:~!?/|\\'\"<>()[]{}&%#-_=+";
    if(tipo == 'numd') // campos com números fracionados
        sequencia = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZçÇáéíóúÁÉÍÓÚàÀâêîôûÂÊÎÔÛãõÃÕäëïöüÄËÏÖÜ@*;:~!?/|\\'\"<>()[]{}&%#-_=+";
    else if(tipo == 'data') // campos de data
        sequencia = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZçÇáéíóúÁÉÍÓÚàÀâêîôûÂÊÎÔÛãõÃÕäëïöüÄËÏÖÜ@*.,;:~!?|\\'\"<>()[]{}&%#-_=+";
    else if(tipo == 'cep') // campos de cep
        sequencia = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZçÇáéíóúÁÉÍÓÚàÀâêîôûÂÊÎÔÛãõÃÕäëïöüÄËÏÖÜ@*,;:~!?/|\\'\"<>()[]{}&%#_=+";
    else if(tipo == 'cpfcnpj') // campos de cnpj e cpf
        sequencia = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZçÇáéíóúÁÉÍÓÚàÀâêîôûÂÊÎÔÛãõÃÕäëïöüÄËÏÖÜ@*,;:~!?|\\'\"<>()[]{}&%#_=+";
    else if(tipo == 'fone') // campos de telefone
        sequencia = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZçÇáéíóúÁÉÍÓÚàÀâêîôûÂÊÎÔÛãõÃÕäëïöüÄËÏÖÜ@*.,;:~!?/|\\'\"<>[]{}&%#_=+";
    else if(tipo == 'letra_az') // campos alfabéticos A - Z
        sequencia = "1234567890.,;:~!?/|\\\"<>[]{}&%#_=+";
    else if(tipo == 'letra') // campos alfabéticos
        sequencia = "1234567890";

    if(obj.value != ''){
        tam = sequencia.length;
        for(x=0;x<tam;x++){
            if(obj.value.indexOf(sequencia.substr(x,1)) != -1){
                obj.value = obj.value.substr(0,obj.value.length-1)
                break;
            }
        }
    }
}

// <input type="text" name="textbox" onFocus="depura('letra',this);" onKeyDown="depura('letra',this);" onKeyUp="depura('letra',this);">

/*
Auto tabbing script- By JavaScriptKit.com
http://www.javascriptkit.com
This credit MUST stay intact for use
*/
function autotab(original,destino){
	if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
	destino.focus();
}
