eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('b l(){7 d=5;4(d.z){4(!d.8)d.8=f m();7 i,j=d.8.6,a=l.o;9(i=0;i<a.6;i++)4(a[i].q("#")!=0){d.8[j]=f A;d.8[j++].c=a[i]}}}b B(){7 i,x,a=5.g;9(i=0;a&&i<a.6&&(x=a[i])&&x.e;i++)x.c=x.e}b h(n,d){7 p,i,x;4(!d)d=5;4((p=n.q("?"))>0&&r.s.6){d=r.s[n.t(p+1)].5;n=n.t(0,p)}4(!(x=d[n])&&d.u)x=d.u[n];9(i=0;!x&&i<d.v.6;i++)x=d.v[i][n];9(i=0;!x&&d.k&&i<d.k.6;i++)x=h(n,d.k[i].5);4(!x&&d.w)x=d.w(n);C x}b y(){7 i,j=0,x,a=y.o;5.g=f m;9(i=0;i<(a.6-2);i+=3)4((x=h(a[i]))!=D){5.g[j++]=x;4(!x.e)x.e=x.c;x.c=a[i+2]}}',40,40,'||||if|document|length|var|MM_p|for||function|src||oSrc|new|MM_sr|MM_findObj|||layers|MM_preloadImages|Array||arguments||indexOf|parent|frames|substring|all|forms|getElementById||MM_swapImage|images|Image|MM_swapImgRestore|return|null'.split('|'),0,{}))


function SomenteNumero(e){
    var tecla=(window.event)?event.keyCode:e.which;
    if((tecla > 47 && tecla < 58) || tecla == 0) return true;
    else{
    if (tecla != 8) return false;
    else return true;
    }
}

function PesquisaCEP() {
	if($.trim($("#txtCEP").val()) != ""){

			$.getScript("http://cep.republicavirtual.com.br/web_cep.php?formato=javascript&cep="+$("#txtCEP").val(), function(){
					if(resultadoCEP["resultado"] && resultadoCEP["bairro"] != ""){
						//	$("#txtTipoLogradouro").val(unescape(resultadoCEP["tipo_logradouro"]));
							$("#txtEndereco").val(unescape(resultadoCEP["tipo_logradouro"]) + " " + unescape(resultadoCEP["logradouro"]));
							$("#txtBairro").val(unescape(resultadoCEP["bairro"]));
							$("#txtCidade").val(unescape(resultadoCEP["cidade"]));
							//$("#txtEstado").val(unescape(resultadoCEP["uf"]));
							$("#txtNumero").focus();

					}else{
							alert("Endereço não encontrado");
							return false;
					}
			});                             
	}
    else
    {
        alert('Antes, preencha o campo CEP!');
    }
    }
    
 function MoveNext(field,nextFieldID){
  if(field.value.length >= field.maxLength){
    document.getElementById(nextFieldID).focus();
  }
}

/**
 * MASCARAS DOS CAMPOS CPF,CEP,DATA DE NASCIMENTO, SÓ NUMEROS, TELEFONE (com DDD)
**/

function mascara(o,f){ //VERIFICA MASCARA
    v_obj=o
    v_fun=f
    setTimeout("execmascara()",1)
}

function execmascara(){ //EXECUTA MASCARA
    v_obj.value=v_fun(v_obj.value)
}


function maskcpf(v){ //MASCARA DE CPF
    v=v.replace(/\D/g,"")                    
    v=v.replace(/(\d{3})(\d)/,"$1.$2")      
    v=v.replace(/(\d{3})(\d)/,"$1.$2")     
                                             
    v=v.replace(/(\d{3})(\d{1,2})$/,"$1-$2") 
    return v
}

function soNumeros(v){ //MASCARA DE SOMENTE NUMEROS
    return v.replace(/\D/g,"")
}

function Numeros(v){ //MASCARA DE TELEFONE com DDD 
	v=v.replace(/\D/g,"")               
    return v
}

function masktelefoneddd(v){ //MASCARA DE TELEFONE sem DDD
	v=v.replace(/\D/g,"")               
    //v=v.replace(/(\d{2})(\d)/,"$1-$2") 
    v=v.replace(/(\d{2})(\d{4})(\d{4})/,"($1) $2-$3")
    return v
}
function masktelefone(v){ //MASCARA DE TELEFONE sem DDD
	v=v.replace(/\D/g,"")               
    v=v.replace(/(\d{4})(\d)/,"$1-$2") 
    return v
}
function masknascimento(v){ //MASCARA DE DATA DE NASCIMENTO
    v=v.replace(/\D/g,"")    
	v=v.replace(/(\d{2})(\d)/,"$1/$2") 
	v=v.replace(/(\d{2})(\d)/,"$1/$2")
    return v
}

function maskcep(v){ // MACARA DE CEP
    v=v.replace(/\D/g,"")
    v=v.replace(/^(\d{5})(\d)/,"$1-$2")
    return v
}
function maskcnpj(v){
    v=v.replace(/\D/g,"")                    //Remove tudo o que não é dígito
    v=v.replace(/(\d{2})(\d)/,"$1.$2")       //Coloca um ponto entre o terceiro e o quarto dígitos
    v=v.replace(/(\d{3})(\d)/,"$1.$2")       //Coloca um ponto entre o terceiro e o quarto dígitos
    v=v.replace(/(\d{3})(\d)/,"$1/$2")                                       //de novo (para o segundo bloco de números)
    v=v.replace(/(\d{4})(\d{1,2})$/,"$1-$2") //Coloca um hífen entre o terceiro e o quarto dígitos
    return v
}



function VerificaTrabalheConosco()
{
	with(document.frmTrabalhe)
	{
		if(txtCPF.value == '')
		{
			alert('Digite o CPF');
			txtCPF.focus();
			return false;
		}
		else if(txtSenha2.value == '')
		{
			alert('Digite a Senha');
			txtSenha2.focus();
			return false;
		}
		else if(txtEmail.value == '')
		{
			alert('Digite o Email');
			txtEmail.focus();
			return false;
		}
		else if(txtCEP.value == '')
		{
			alert('Digite o CEP');
			txtCEP.focus();
			return false;
		}
		else if(txtEndereco.value == '')
		{
			alert('Digite o Endereço');
			txtEndereco.focus();
			return false;
		}
		else if(txtNumero.value == '')
		{
			alert('Digite o Número');
			txtNumero.focus();
			return false;
		}
		else if(txtBairro.value == '')
		{
			alert('Digite o Bairro');
			txtBairro.focus();
			return false;
		}
		else if(txtCidade.value == '')
		{
			alert('Digite a Cidade');
			txtCidade.focus();
			return false;
		}
		else if(ddlEstado.value == '')
		{
			alert('Selecione o Estado');
			ddlEstado.focus();
			return false;
		}
		else if(txtDataNascimento.value == '')
		{
			alert('Digite a Data de Nascimento');
			txtDataNascimento.focus();
			return false;
		}
		else if(ddlSexo.value == '')
		{
			alert('Selecione o Sexo');
			ddlSexo.focus();
			return false;
		}
		else if(ddlEstadoCivil.value == '')
		{
			alert('Selecione o Estado Civil');
			ddlEstadoCivil.focus();
			return false;
		}
		else if(txtTelefone.value == '')
		{
			alert('Digite o Telefone');
			txtTelefone.focus();
			return false;
		}
		else if(txtObjetivos.value == '')
		{
			alert('Digite os Objetivos');
			txtObjetivos.focus();
			return false;
		}
		else if(txtQualificacoes.value == '')
		{
			alert('Digite as Qualificações');
			txtQualificacoes.focus();
			return false;
		}
	}
}
