// JavaScript Document
function mascara(o,f){
    v_obj=o;
    v_fun=f;
    setTimeout("execmascara()",1);
}

function execmascara(){
    v_obj.value=v_fun(v_obj.value);
}

function telefone(v){
    v=v.replace(/\D/g,"");                 	//Remove tudo o que não é dígito
    v=v.replace(/^(\d\d)(\d)/g,"($1)$2"); 	//Coloca parênteses em volta dos dois primeiros dígitos
    v=v.replace(/(\d{4})(\d)/,"$1-$2");    	//Coloca hífen entre o quarto e o quinto dígitos
    return v;
}

function data(v){
	v=v.replace(/\D/g,"");
	v=v.replace(/(\d{2})(\d)/,"$1/$2");
	v=v.replace(/(\d{2})(\d)/,"$1/$2");
	return v;
}


function cpf(v){
    v=v.replace(/\D/g,"");                    //Remove tudo o que não é dígito
    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");       //Coloca um ponto entre o terceiro e o quarto dígitos
                                             //de novo (para o segundo bloco de números)
    v=v.replace(/(\d{3})(\d{1,2})$/,"$1-$2"); //Coloca um hífen entre o terceiro e o quarto dígitos
    return v;
}

function rg(v){
    v=v.replace(/\D/g,"");                    //Remove tudo o que não é dígito
    v=v.replace(/(\d{1})(\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
                                             //de novo (para o segundo bloco de números)
    v=v.replace(/(\d{3})(\d{1,2})$/,"$1-$2"); //Coloca um hífen entre o terceiro e o quarto dígitos
    return v;
}

function cep(v){
    v=v.replace(/\D/g,"");                //Remove tudo o que não é dígito
    v=v.replace(/^(\d{5})(\d)/,"$1-$2"); //Esse é tão fácil que não merece explicações
    return v;
}

function numero(v){
    v=v.replace(/[a-z\?\!\'\"\+\[\]\{\}\(\)\@\#\$\%\&\*\¨\´\`\~\^\-\_\=]/g,"");                 //Remove tudo o que não é dígito
    return v;
}

function cnpj(v){
    v=v.replace(/\D/g,"");                           //Remove tudo o que não é dígito
    v=v.replace(/^(\d{2})(\d)/,"$1.$2");             //Coloca ponto entre o segundo e o terceiro dígitos
    v=v.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3"); //Coloca ponto entre o quinto e o sexto dígitos
    v=v.replace(/\.(\d{3})(\d)/,".$1/$2");           //Coloca uma barra entre o oitavo e o nono dígitos
    v=v.replace(/(\d{4})(\d)/,"$1-$2");              //Coloca um hífen depois do bloco de quatro dígitos
    return v;
}

function inscricao(v){
    v=v.replace(/\D/g,"");                           //Remove tudo o que não é dígito
    v=v.replace(/^(\d{2})(\d)/,"$1.$2");             //Coloca ponto entre o segundo e o terceiro dígitos
    v=v.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3"); //Coloca ponto entre o quinto e o sexto dígitos
    v=v.replace(/\.(\d{3})(\d)/,".$1/$2");           //Coloca uma barra entre o oitavo e o nono dígitos
    v=v.replace(/(\d{4})(\d)/,"$1-$2");              //Coloca um hífen depois do bloco de quatro dígitos
    return v;
}

function virgulaParaPonto(v) {
	v=v.replace(/\,/g,".");                 //Substitui a virgula por um ponto.
    return v;
}

function validarCurriculo1() {
	if (document.getElementById('txNome').value == '') {
		alert('Campo "Nome" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txNome').focus();

		return false;
	}
	if ((!document.form.rbSexo[0].checked) && (!document.form.rbSexo[1].checked)) {
		alert('Campo "Sexo" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbSexo').focus();

		return false;
	}
	if (document.getElementById('txDataNascimento').value.length < 10) {
		alert('Campo "Data de nascimento" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txDataNascimento').focus();

		return false;
	}
	if (document.getElementById('txIdade').value == '') {
		alert('Campo "Idade" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txIdade').focus();

		return false;
	}
	if ((!document.form.rbEstadoCivil[0].checked) && (!document.form.rbEstadoCivil[1].checked) && (!document.form.rbEstadoCivil[2].checked) && (!document.form.rbEstadoCivil[3].checked)) {
		alert('Campo "Estado civil" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbEstadoCivil').focus();

		return false;
	}
	if (document.getElementById('txEndereco').value == '') {
		alert('Campo "Endereço" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEndereco').focus();

		return false;
	}
	if (document.getElementById('txNumero').value == '') {
		alert('Campo "Número" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txNumero').focus();

		return false;
	}
	if (document.getElementById('txBairro').value == '') {
		alert('Campo "Bairro" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txBairro').focus();

		return false;
	}
	if (document.getElementById('txCidade').value == '') {
		alert('Campo "Cidade" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCidade').focus();

		return false;
	}
	if (document.getElementById('slEstado').value == '') {
		alert('Campo "Estado" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('slEstado').focus();

		return false;
	}
	if (document.getElementById('txTelefone').value == '') {
		alert('Campo "Telefone" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txTelefone').focus();

		return false;
	}
	if (document.getElementById('txTelefone').value.length < 13) {
		alert('Campo "Telefone" deve ser no formato (00)0000-0000!');
		document.getElementById('txTelefone').focus();

		return false;
	}
	if (document.getElementById('txCelular').value == '') {
		alert('Campo "Celular" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txCelular').value.length < 13) {
		alert('Campo "Celular" deve ser no formato (00)0000-0000!');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txCelular').value == '') {
		alert('Campo "Celular" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txEmail').value == '') {
		alert('Campo "E-mail" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEmail').focus();

		return false;
	}
	if ((document.getElementById('txEmail').value != '') && (!verificarEmail('txEmail'))) {
		alert('Campo "E-mail" deve ser no formato g5seguranca@g5seguranca.com.br!');
		document.getElementById('txEmail').focus();

		return false;
	}
	if (!verificarTexto('txRG')) {
		alert('Campo "RG" inválido! Verifique. O RG deve estar no formato 0.000.000-0!');
		document.getElementById('txRG').focus();

		return false;
	}
	if (!valida_cpf()) {
		alert('Campo "CPF" inválido! Verifique. O CPF deve estar no formato 000.000.000-00!');
		document.getElementById('txCPF').focus();

		return false;
	}
	if (document.getElementById('txAltura').value == '') {
		alert('Campo "Altura" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txAltura').focus();

		return false;
	}
	if (document.getElementById('txPeso').value == '') {
		alert('Campo "Peso" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txPeso').focus();

		return false;
	}
	if ((!document.form.rbHabilitacao[0].checked) && (!document.form.rbHabilitacao[1].checked)) {
		alert('Campo "Habilitação" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbHabilitacao').focus();

		return false;
	}
	if ((document.form.rbHabilitacao[0].checked) && (document.getElementById('txCategoria').value == '')) {
		alert('Campo "Categoria" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCategoria').focus();

		return false;
	}
	if ((document.form.rbHabilitacao[0].checked) && (document.getElementById('txPrimeiraHabilitacao').value.length < 10)) {
		alert('Campo "Data da primeira habilitação" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txPrimeiraHabilitacao').focus();

		return false;
	}
	if ((document.form.rbHabilitacao[0].checked) && ((!document.form.rbProvisoria[0].checked) && (!document.form.rbProvisoria[1].checked))) {
		alert('Campo "Provisória" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbHabilitacao').focus();

		return false;
	}
	if ((!document.form.rbNivel[0].checked) && (!document.form.rbNivel[1].checked) && (!document.form.rbNivel[2].checked) && (!document.form.rbNivel[3].checked)) {
		alert('Campo "Nivel" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbNivel').focus();

		return false;
	}
	if (document.getElementById('txAreaFormacao').value == '') {
		alert('Campo "Área de formação" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txAreaFormacao').focus();

		return false;
	}
	if (document.getElementById('txEstabelecimento').value == '') {
		alert('Campo "Estabelecimento de ensino" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEstabelecimento').focus();

		return false;
	}
	if (document.getElementById('txAnoConclusao').value == '') {
		alert('Campo "Ano de conclusão" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txAnoConclusao').focus();

		return false;
	}
	if ((!document.form.rbCursoVigilante[0].checked) && (!document.form.rbCursoVigilante[1].checked)) {
		alert('Campo "Curso de vigilante" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbCursoVigilante').focus();

		return false;
	}
	if ((document.form.rbCursoVigilante[0].checked) && (document.getElementById('txDataCurso').value.length < 10)) {
		alert('Campo "Data do curso de vigilante" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txDataCurso').focus();

		return false;
	}
	if ((document.form.rbCursoVigilante[0].checked) && (document.getElementById('txEscolaFormacao').value == '')) {
		alert('Campo "Escola de form. de vigilante" deve ser informado!');
		document.getElementById('txEscolaFormacao').focus();

		return false;
	}
	if ((document.form.rbCursoVigilante[0].checked) && (document.getElementById('txCidadeFormacao').value == '')) {
		alert('Campo "Cidade de formação" deve ser informado!');
		document.getElementById('txCidadeFormacao').focus();

		return false;
	}
	if ((document.form.rbCursoVigilante[0].checked) && ((!document.form.rbReciclagem[0].checked) && (!document.form.rbReciclagem[1].checked))) {
		alert('Campo "Reciclagem" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbReciclagem').focus();

		return false;
	}
	if ((document.form.rbReciclagem[0].checked) && (document.getElementById('txDataReciclagem').value.length < 10)) {
		alert('Campo "Data da última reciclagem" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txDataReciclagem').focus();

		return false;
	}
	if ((document.getElementById('ckOutro').checked) && (document.getElementById('txOutro').value == '')) {
		alert('É necessário informar qual outro conhecimento você possui!');
		document.getElementById('txOutro').focus();

		return false;
	}
	if (document.getElementById('txUltimaEmpresa').value == '') {
		alert('Campo "Nome da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaEmpresa').focus();

		return false;
	}
	if (document.getElementById('txUltimaRamo').value == '') {
		alert('Campo "Ramo da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaRamo').focus();

		return false;
	}
	if (document.getElementById('txUltimaTelefone').value == '') {
		alert('Campo "Telefone da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaTelefone').focus();

		return false;
	}
	if (document.getElementById('txUltimaTelefone').value.length < 13) {
		alert('Campo "Telefone da última empresa" deve ser no formato (00)0000-0000!');
		document.getElementById('txUltimaTelefone').focus();

		return false;
	}
	if (document.getElementById('txUltimaAdmissao').value.length < 10) {
		alert('Campo "Data de admissão na última empresa" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txUltimaAdmissao').focus();

		return false;
	}
	if (document.getElementById('txUltimaDemissao').value.length < 10) {
		alert('Campo "Data de demissão na última empresa" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txUltimaDemissao').focus();

		return false;
	}
	if (document.getElementById('txUltimaFuncao').value == '') {
		alert('Campo "Função na última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaFuncao').focus();

		return false;
	}
	if (document.getElementById('txUltimaTarefas').value == '') {
		alert('Campo "Tarefas realizadas na última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaTarefas').focus();

		return false;
	}
	if (document.getElementById('txPretensao').value == '') {
		alert('Campo "Salário pretendido" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txPretensao').focus();

		return false;
	}

	return true;
}



function validarCurriculo2() {
	if (document.getElementById('txNome').value == '') {
		alert('Campo "Nome" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txNome').focus();

		return false;
	}
	if ((!document.form.rbSexo[0].checked) && (!document.form.rbSexo[1].checked)) {
		alert('Campo "Sexo" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbSexo').focus();

		return false;
	}
	if (document.getElementById('txDataNascimento').value.length < 10) {
		alert('Campo "Data de nascimento" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txDataNascimento').focus();

		return false;
	}
	if (document.getElementById('txIdade').value == '') {
		alert('Campo "Idade" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txIdade').focus();

		return false;
	}
	if ((!document.form.rbEstadoCivil[0].checked) && (!document.form.rbEstadoCivil[1].checked) && (!document.form.rbEstadoCivil[2].checked) && (!document.form.rbEstadoCivil[3].checked)) {
		alert('Campo "Estado civil" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbEstadoCivil').focus();

		return false;
	}
	if (document.getElementById('txEndereco').value == '') {
		alert('Campo "Endereço" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEndereco').focus();

		return false;
	}
	if (document.getElementById('txNumero').value == '') {
		alert('Campo "Número" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txNumero').focus();

		return false;
	}
	if (document.getElementById('txBairro').value == '') {
		alert('Campo "Bairro" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txBairro').focus();

		return false;
	}
	if (document.getElementById('txCidade').value == '') {
		alert('Campo "Cidade" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCidade').focus();

		return false;
	}
	if (document.getElementById('slEstado').value == '') {
		alert('Campo "Estado" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('slEstado').focus();

		return false;
	}
	if (document.getElementById('txTelefone').value == '') {
		alert('Campo "Telefone" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txTelefone').focus();

		return false;
	}
	if (document.getElementById('txTelefone').value.length < 13) {
		alert('Campo "Telefone" deve ser no formato (00)0000-0000!');
		document.getElementById('txTelefone').focus();

		return false;
	}
	if (document.getElementById('txCelular').value == '') {
		alert('Campo "Celular" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txCelular').value.length < 13) {
		alert('Campo "Celular" deve ser no formato (00)0000-0000!');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txCelular').value == '') {
		alert('Campo "Celular" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txEmail').value == '') {
		alert('Campo "E-mail" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEmail').focus();

		return false;
	}
	if ((document.getElementById('txEmail').value != '') && (!verificarEmail('txEmail'))) {
		alert('Campo "E-mail" deve ser no formato g5seguranca@g5seguranca.com.br!');
		document.getElementById('txEmail').focus();

		return false;
	}
	if (!verificarTexto('txRG')) {
		alert('Campo "RG" inválido! Verifique. O RG deve estar no formato 0.000.000-0!');
		document.getElementById('txRG').focus();

		return false;
	}
	if (!valida_cpf()) {
		alert('Campo "CPF" inválido! Verifique. O CPF deve estar no formato 000.000.000-00!');
		document.getElementById('txCPF').focus();

		return false;
	}
	if ((!document.form.rbNivel[0].checked) && (!document.form.rbNivel[1].checked) && (!document.form.rbNivel[2].checked) && (!document.form.rbNivel[3].checked)) {
		alert('Campo "Nivel" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbNivel').focus();

		return false;
	}
	if (document.getElementById('txAreaFormacao').value == '') {
		alert('Campo "Área de formação" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txAreaFormacao').focus();

		return false;
	}
	if (document.getElementById('txEstabelecimento').value == '') {
		alert('Campo "Estabelecimento de ensino" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEstabelecimento').focus();

		return false;
	}
	if (document.getElementById('txAnoConclusao').value == '') {
		alert('Campo "Ano de conclusão" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txAnoConclusao').focus();

		return false;
	}
	if ((document.getElementById('ckOutro').checked) && (document.getElementById('txOutro').value == '')) {
		alert('É necessário informar qual outro conhecimento você possui!');
		document.getElementById('txOutro').focus();

		return false;
	}
	if (document.getElementById('txUltimaEmpresa').value == '') {
		alert('Campo "Nome da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaEmpresa').focus();

		return false;
	}
	if (document.getElementById('txUltimaRamo').value == '') {
		alert('Campo "Ramo da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaRamo').focus();

		return false;
	}
	if (document.getElementById('txUltimaTelefone').value == '') {
		alert('Campo "Telefone da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaTelefone').focus();

		return false;
	}
	if (document.getElementById('txUltimaTelefone').value.length < 13) {
		alert('Campo "Telefone da última empresa" deve ser no formato (00)0000-0000!');
		document.getElementById('txUltimaTelefone').focus();

		return false;
	}
	if (document.getElementById('txUltimaAdmissao').value.length < 10) {
		alert('Campo "Data de admissão na última empresa" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txUltimaAdmissao').focus();

		return false;
	}
	if (document.getElementById('txUltimaDemissao').value.length < 10) {
		alert('Campo "Data de demissão na última empresa" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txUltimaDemissao').focus();

		return false;
	}
	if (document.getElementById('txUltimaFuncao').value == '') {
		alert('Campo "Função na última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaFuncao').focus();

		return false;
	}
	if (document.getElementById('txUltimaTarefas').value == '') {
		alert('Campo "Tarefas realizadas na última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaTarefas').focus();

		return false;
	}
	if (document.getElementById('txPretensao').value == '') {
		alert('Campo "Salário pretendido" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txPretensao').focus();

		return false;
	}

	return true;
}



function validarCurriculo3() {
	if (document.getElementById('slVaga').value == '') {
		alert('Campo "Vaga pretendida" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('slVaga').focus();

		return false;
	}
	if (document.getElementById('txNome').value == '') {
		alert('Campo "Nome" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txNome').focus();

		return false;
	}
	if ((!document.form.rbSexo[0].checked) && (!document.form.rbSexo[1].checked)) {
		alert('Campo "Sexo" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbSexo').focus();

		return false;
	}
	if (document.getElementById('txDataNascimento').value.length < 10) {
		alert('Campo "Data de nascimento" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txDataNascimento').focus();

		return false;
	}
	if (document.getElementById('txIdade').value == '') {
		alert('Campo "Idade" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txIdade').focus();

		return false;
	}
	if ((!document.form.rbEstadoCivil[0].checked) && (!document.form.rbEstadoCivil[1].checked) && (!document.form.rbEstadoCivil[2].checked) && (!document.form.rbEstadoCivil[3].checked)) {
		alert('Campo "Estado civil" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbEstadoCivil').focus();

		return false;
	}
	if (document.getElementById('txEndereco').value == '') {
		alert('Campo "Endereço" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEndereco').focus();

		return false;
	}
	if (document.getElementById('txNumero').value == '') {
		alert('Campo "Número" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txNumero').focus();

		return false;
	}
	if (document.getElementById('txBairro').value == '') {
		alert('Campo "Bairro" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txBairro').focus();

		return false;
	}
	if (document.getElementById('txCidade').value == '') {
		alert('Campo "Cidade" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCidade').focus();

		return false;
	}
	if (document.getElementById('slEstado').value == '') {
		alert('Campo "Estado" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('slEstado').focus();

		return false;
	}
	if (document.getElementById('txTelefone').value == '') {
		alert('Campo "Telefone" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txTelefone').focus();

		return false;
	}
	if (document.getElementById('txTelefone').value.length < 13) {
		alert('Campo "Telefone" deve ser no formato (00)0000-0000!');
		document.getElementById('txTelefone').focus();

		return false;
	}
	if (document.getElementById('txCelular').value == '') {
		alert('Campo "Celular" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txCelular').value.length < 13) {
		alert('Campo "Celular" deve ser no formato (00)0000-0000!');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txCelular').value == '') {
		alert('Campo "Celular" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txEmail').value == '') {
		alert('Campo "E-mail" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEmail').focus();

		return false;
	}
	if ((document.getElementById('txEmail').value != '') && (!verificarEmail('txEmail'))) {
		alert('Campo "E-mail" deve ser no formato g5seguranca@g5seguranca.com.br!');
		document.getElementById('txEmail').focus();

		return false;
	}
	if (!verificarTexto('txRG')) {
		alert('Campo "RG" inválido! Verifique. O RG deve estar no formato 0.000.000-0!');
		document.getElementById('txRG').focus();

		return false;
	}
	if (!valida_cpf()) {
		alert('Campo "CPF" inválido! Verifique. O CPF deve estar no formato 000.000.000-00!');
		document.getElementById('txCPF').focus();

		return false;
	}
	if ((!document.form.rbHabilitacao[0].checked) && (!document.form.rbHabilitacao[1].checked)) {
		alert('Campo "Habilitação" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbHabilitacao').focus();

		return false;
	}
	if ((document.form.rbHabilitacao[0].checked) && (document.getElementById('txCategoria').value == '')) {
		alert('Campo "Categoria" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCategoria').focus();

		return false;
	}
	if ((document.form.rbHabilitacao[0].checked) && (document.getElementById('txPrimeiraHabilitacao').value.length < 10)) {
		alert('Campo "Data da primeira habilitação" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txPrimeiraHabilitacao').focus();

		return false;
	}
	if ((document.form.rbHabilitacao[0].checked) && ((!document.form.rbProvisoria[0].checked) && (!document.form.rbProvisoria[1].checked))) {
		alert('Campo "Provisória" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbHabilitacao').focus();

		return false;
	}
	if ((!document.form.rbNivel[0].checked) && (!document.form.rbNivel[1].checked) && (!document.form.rbNivel[2].checked) && (!document.form.rbNivel[3].checked)) {
		alert('Campo "Nivel" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbNivel').focus();

		return false;
	}
	if (document.getElementById('txAreaFormacao').value == '') {
		alert('Campo "Área de formação" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txAreaFormacao').focus();

		return false;
	}
	if (document.getElementById('txEstabelecimento').value == '') {
		alert('Campo "Estabelecimento de ensino" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEstabelecimento').focus();

		return false;
	}
	if (document.getElementById('txAnoConclusao').value == '') {
		alert('Campo "Ano de conclusão" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txAnoConclusao').focus();

		return false;
	}
	if (document.getElementById('txUltimaEmpresa').value == '') {
		alert('Campo "Nome da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaEmpresa').focus();

		return false;
	}
	if (document.getElementById('txUltimaRamo').value == '') {
		alert('Campo "Ramo da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaRamo').focus();

		return false;
	}
	if (document.getElementById('txUltimaTelefone').value == '') {
		alert('Campo "Telefone da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaTelefone').focus();

		return false;
	}
	if (document.getElementById('txUltimaTelefone').value.length < 13) {
		alert('Campo "Telefone da última empresa" deve ser no formato (00)0000-0000!');
		document.getElementById('txUltimaTelefone').focus();

		return false;
	}
	if (document.getElementById('txUltimaAdmissao').value.length < 10) {
		alert('Campo "Data de admissão na última empresa" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txUltimaAdmissao').focus();

		return false;
	}
	if (document.getElementById('txUltimaDemissao').value.length < 10) {
		alert('Campo "Data de demissão na última empresa" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txUltimaDemissao').focus();

		return false;
	}
	if (document.getElementById('txUltimaFuncao').value == '') {
		alert('Campo "Função na última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaFuncao').focus();

		return false;
	}
	if (document.getElementById('txUltimaTarefas').value == '') {
		alert('Campo "Tarefas realizadas na última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaTarefas').focus();

		return false;
	}
	if (document.getElementById('txPretensao').value == '') {
		alert('Campo "Salário pretendido" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txPretensao').focus();

		return false;
	}

	return true;
}



function validarCurriculo4() {
	if (document.getElementById('txNome').value == '') {
		alert('Campo "Nome" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txNome').focus();

		return false;
	}
	if ((!document.form.rbSexo[0].checked) && (!document.form.rbSexo[1].checked)) {
		alert('Campo "Sexo" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbSexo').focus();

		return false;
	}
	if (document.getElementById('txDataNascimento').value.length < 10) {
		alert('Campo "Data de nascimento" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txDataNascimento').focus();

		return false;
	}
	if (document.getElementById('txIdade').value == '') {
		alert('Campo "Idade" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txIdade').focus();

		return false;
	}
	if ((!document.form.rbEstadoCivil[0].checked) && (!document.form.rbEstadoCivil[1].checked) && (!document.form.rbEstadoCivil[2].checked) && (!document.form.rbEstadoCivil[3].checked)) {
		alert('Campo "Estado civil" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbEstadoCivil').focus();

		return false;
	}
	if (document.getElementById('txEndereco').value == '') {
		alert('Campo "Endereço" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEndereco').focus();

		return false;
	}
	if (document.getElementById('txNumero').value == '') {
		alert('Campo "Número" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txNumero').focus();

		return false;
	}
	if (document.getElementById('txBairro').value == '') {
		alert('Campo "Bairro" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txBairro').focus();

		return false;
	}
	if (document.getElementById('txCidade').value == '') {
		alert('Campo "Cidade" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCidade').focus();

		return false;
	}
	if (document.getElementById('slEstado').value == '') {
		alert('Campo "Estado" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('slEstado').focus();

		return false;
	}
	if (document.getElementById('txTelefone').value == '') {
		alert('Campo "Telefone" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txTelefone').focus();

		return false;
	}
	if (document.getElementById('txTelefone').value.length < 13) {
		alert('Campo "Telefone" deve ser no formato (00)0000-0000!');
		document.getElementById('txTelefone').focus();

		return false;
	}
	if (document.getElementById('txCelular').value == '') {
		alert('Campo "Celular" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txCelular').value.length < 13) {
		alert('Campo "Celular" deve ser no formato (00)0000-0000!');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txCelular').value == '') {
		alert('Campo "Celular" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCelular').focus();

		return false;
	}
	if (document.getElementById('txEmail').value == '') {
		alert('Campo "E-mail" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEmail').focus();

		return false;
	}
	if ((document.getElementById('txEmail').value != '') && (!verificarEmail('txEmail'))) {
		alert('Campo "E-mail" deve ser no formato g5seguranca@g5seguranca.com.br!');
		document.getElementById('txEmail').focus();

		return false;
	}
	if (!verificarTexto('txRG')) {
		alert('Campo "RG" inválido! Verifique. O RG deve estar no formato 0.000.000-0!');
		document.getElementById('txRG').focus();

		return false;
	}
	if (!valida_cpf()) {
		alert('Campo "CPF" inválido! Verifique. O CPF deve estar no formato 000.000.000-00!');
		document.getElementById('txCPF').focus();

		return false;
	}
	if ((!document.form.rbHabilitacao[0].checked) && (!document.form.rbHabilitacao[1].checked)) {
		alert('Campo "Habilitação" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbHabilitacao').focus();

		return false;
	}
	if ((document.form.rbHabilitacao[0].checked) && (document.getElementById('txCategoria').value == '')) {
		alert('Campo "Categoria" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txCategoria').focus();

		return false;
	}
	if ((document.form.rbHabilitacao[0].checked) && (document.getElementById('txPrimeiraHabilitacao').value.length < 10)) {
		alert('Campo "Data da primeira habilitação" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txPrimeiraHabilitacao').focus();

		return false;
	}
	if ((document.form.rbHabilitacao[0].checked) && ((!document.form.rbProvisoria[0].checked) && (!document.form.rbProvisoria[1].checked))) {
		alert('Campo "Provisória" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbHabilitacao').focus();

		return false;
	}
	if ((document.form.rbHabilitacao[0].checked) && ((!document.form.rbAutomovel[0].checked) && (!document.form.rbAutomovel[1].checked))) {
		alert('Campo "Possui automóvel" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbHabilitacao').focus();

		return false;
	}
	if ((document.form.rbAutomovel[0].checked) && (document.getElementById('txMarcaAno').value == '')) {
		alert('Campo "Marca/Ano" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txMarcaAno').focus();

		return false;
	}
	if ((!document.form.rbNivel[0].checked) && (!document.form.rbNivel[1].checked) && (!document.form.rbNivel[2].checked) && (!document.form.rbNivel[3].checked)) {
		alert('Campo "Nivel" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('rbNivel').focus();

		return false;
	}
	if (document.getElementById('txAreaFormacao').value == '') {
		alert('Campo "Área de formação" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txAreaFormacao').focus();

		return false;
	}
	if (document.getElementById('txEstabelecimento').value == '') {
		alert('Campo "Estabelecimento de ensino" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txEstabelecimento').focus();

		return false;
	}
	if (document.getElementById('txAnoConclusao').value == '') {
		alert('Campo "Ano de conclusão" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txAnoConclusao').focus();

		return false;
	}
	if (document.getElementById('txUltimaEmpresa').value == '') {
		alert('Campo "Nome da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaEmpresa').focus();

		return false;
	}
	if (document.getElementById('txUltimaRamo').value == '') {
		alert('Campo "Ramo da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaRamo').focus();

		return false;
	}
	if (document.getElementById('txUltimaTelefone').value == '') {
		alert('Campo "Telefone da última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaTelefone').focus();

		return false;
	}
	if (document.getElementById('txUltimaTelefone').value.length < 13) {
		alert('Campo "Telefone da última empresa" deve ser no formato (00)0000-0000!');
		document.getElementById('txUltimaTelefone').focus();

		return false;
	}
	if (document.getElementById('txUltimaAdmissao').value.length < 10) {
		alert('Campo "Data de admissão na última empresa" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txUltimaAdmissao').focus();

		return false;
	}
	if (document.getElementById('txUltimaDemissao').value.length < 10) {
		alert('Campo "Data de demissão na última empresa" deve ser informado e deve estar no formato dd/mm/aaaa!');
		document.getElementById('txUltimaDemissao').focus();

		return false;
	}
	if (document.getElementById('txUltimaFuncao').value == '') {
		alert('Campo "Função na última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaFuncao').focus();

		return false;
	}
	if (document.getElementById('txUltimaTarefas').value == '') {
		alert('Campo "Tarefas realizadas na última empresa" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txUltimaTarefas').focus();

		return false;
	}
	if (document.getElementById('txPretensao').value == '') {
		alert('Campo "Salário pretendido" deve ser informado! Preecha todos os campos com *.');
		document.getElementById('txPretensao').focus();

		return false;
	}

	return true;
}




function verificarTexto(componente){
	var valida = false;

	switch(componente){
		case 'txRG':
			if(document.getElementById(componente).value.length < 11){
				return false;
			}else{
				return true;
			}
		break;
	}

	return valida;
}

function verificarEmail(componente){
	if(document.getElementById(componente).value == ''){
		return false;
	}else{
		var er = /[\'\"\,\´\`\~\^\]\[\{\}\#\$\%\¨\&\*\(\)\!]/;
		if(er.test(document.getElementById(componente).value)){
			return false;
		}else{
			var er = /^[^\s]+[a-z0-9\.\_\-]+@+[a-z0-9\-\_\.]+\.+([com]|[org]|[edu])/;
			if(er.test(document.getElementById(componente).value)){
				return true;
			}else{
				return false;
			}
		}
	}
	return valida;
}

function valida_cpf(){
	var cpf = document.form.txCPF.value;

	if(cpf.length < 14){
		return false;
	}else{
		var numeros, digito_um, digito_dois, digitos, soma, i, j, resto, digitos_ver, multiplicador;

		cpf = cpf.replace(".", "");
		cpf = cpf.replace(".", "");
		cpf = cpf.split("-");
		digitos_ver = cpf[1];
		numeros = cpf[0];
		soma = 0;
		multiplicador = 10;
		tam = numeros.length;

		digitos_iguais = 0;
		for (i=0; i < tam - 1; i++){
			if (numeros.charAt(i) == numeros.charAt(i+1)){
				digitos_iguais++;
			}
		}
		if(digitos_iguais > 7){
			return false;
		}else{
			for(i = 0; i < numeros.length; i++){
				soma+= multiplicador * numeros.charAt(i);
				multiplicador--;
			}
			resto = soma%11;
			if(resto > 2){
				digito_um = 11-resto;
			}else{
				digito_um = 0;
			}
			numeros+=digito_um;
			soma = 0;
			multiplicador = 11;
			for(i = 0; i < numeros.length; i++){
				num = numeros.charAt(i);
				soma+= multiplicador*num;
				multiplicador--;
			}
			resto = soma%11;
			if(resto > 2){
				digito_dois = 11-resto;
			}else{
				digito_dois = 0;
			}
			digitos = digito_um+""+digito_dois;
			if(digitos == digitos_ver){
				return true;
			}else{
				return false;
			}
		}
	}
}
