  <!--
    function check_sal(objName) {
    	var checkOK = "0123456789.";
    	var checkStr = objName;
    	var allValid = true;
    
    	for (i = 0;  i < checkStr.value.length;  i++) {
    		ch = checkStr.value.charAt(i);
    		for (j = 0;  j < checkOK.length;  j++) {
    			if (ch == checkOK.charAt(j))	break;
    			if (j == (checkOK.length -1)) {
    				allValid = false;
    				break;
    			}
    		}
		if (! allValid) break ;
    	}	
	if (! allValid) {
		alert ("O Formato do valor do salário deve ser : 999999.99") ;
	checkStr.select();
        checkStr.focus();
	}
    	return (allValid);
    }	
    //-->
    
    <!--  Função para checar os Campos Obrigatórios 
    function check (){
    	tudo_ok = true;
    	for (var i = 0 ; i < document.form1.elements.length && tudo_ok == true ; i++)  {	
         if  (document.form1.elements[i].name  == "NM_CANDIDATO" &&  document.form1.elements[i].value  == "") {
    	 		tudo_ok = false ;
    		 }
    		 if  (document.form1.elements[i].name  == "DS_SEXO" &&  document.form1.elements[i].selectedindex  == 0) {
    	 		tudo_ok = false ;
    		 }	  	  
    	 	 if  (document.form1.elements[i].name  == "DS_EST_CIVIL" &&  document.form1.elements[i].selectedindex  == 0) {
    	 		tudo_ok = false ;
    		 }
    	 	 if  (document.form1.elements[i].name  == "CD_UF" &&  document.form1.elements[i].selectedindex  == 0) {
    	 		tudo_ok = false ;
    		 }
    		 if  (document.form1.elements[i].name  == "CD_UF_NASC" &&  document.form1.elements[i].selectedindex  == 0) {
    	 		tudo_ok = false ;
    		 }
    	   	 if  (document.form1.elements[i].name  == "DOCUMENTO" &&  document.form1.elements[i].value  == "") {
    	 		tudo_ok = false ;
    		 }	  
        	 if  (document.form1.elements[i].name  == "TP_DOCUMENTO" &&  document.form1.elements[i].selectedindex  == 0) {
    	 		tudo_ok = false ;
    	 	}
    		if  (document.form1.elements[i].name  == "NR_TEL_RES" &&  document.form1.elements[i].value  == "") {
    	 		tudo_ok = false ;
    	 	}
    		if  (document.form1.elements[i].name  == "NR_TEL_RES" &&  document.form1.elements[i].value  == "") {
    	 		tudo_ok = false ;
    	 	}

    	}
    		
    	if (! tudo_ok ) {
    		alert ("Por favor, verifique se os campos obrigatórios foram preenchidos corretamente.");
    	}	   
			
			return tudo_ok;			
    }
    //-->
     
    <!-- Begin 
    function check_cep( field ) {
    		var DataField = field;
    		var data = "" ;
    		var objRegExp  = /(^\d{5}-\d{3}$)/;
      
      		data = DataField.value ;
    
    		if (DataField.value != '') {
        		   if (! objRegExp.test(data)) {
    	 		alert("O CEP deve estar no seguinte formato: 99999-999");
    		      DataField.select();
    		      DataField.focus();
    		    }		
                     } 
     }
    //-->

     
    <!-- Begin
    function check_date(valor){
    var checkstr = "0123456789";
    var DateField = field;
    var Datevalue = "";
    var DateTemp = "";
    var seperator = "/";
    var day;
    var month;
    var year;
    var leap = 0;
    var err = 0;
    var i;
       err = 0;
       DateValue = DateField.value;
       /* Delete all chars except 0..9 */
       for (i = 0; i < DateValue.length; i++) {
    	  if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
    	     DateTemp = DateTemp + DateValue.substr(i,1);
    	  }
       }
       DateValue = DateTemp;
       /* Always change date to 8 digits - string*/
       /* if year is entered as 2-digit / always assume 20xx */
       if (DateValue.length == 6) {
          DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2); }
       if (DateValue.length != 8) {
          err = 19;}
       /* year is wrong if year = 0000 */
       year = DateValue.substr(4,4);
       if (year == 0) {
          err = 20;
       }
       /* Validation of month*/
       month = DateValue.substr(2,2);
       if ((month < 1) || (month > 12)) {
          err = 21;
       }
       /* Validation of day*/
       day = DateValue.substr(0,2);
       if (day < 1) {
         err = 22;
       }

       /* Validation leap-year / february / day */
       if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
          leap = 1;
       }
       if ((month == 2) && (leap == 1) && (day > 29)) {
          err = 23;
       }
       if ((month == 2) && (leap != 1) && (day > 28)) {
          err = 24;
       }
       /* Validation of other months */
       if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
          err = 25;
       }
       if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
          err = 26;
       }
       /* if 00 ist entered, no error, deleting the entry */
       if ((day == 0) && (month == 0) && (year == 00)) {
          err = 0; day = ""; month = ""; year = ""; seperator = "";
       }
       /* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
       if (err == 0) {
          DateField.value = day + seperator + month + seperator + year;
       }
       /* Error-message if err != 0 */
       else {
          alert("Por favor, insira as datas no formato dd/mm/aaaa!");
          DateField.select();
    	  DateField.focus();
       }
    }
    //  End -->

<!---    
//limit should be an integer representing max # of characters form element accepts
function enforcechar(what,limit){
if (what.value.length>=limit)
return false
}
 // END -->

function validaCPF(intCpf) {
	cpf = intCpf;
	erro = new String;
	if (cpf.length < 11) erro += "São necessários 11 digitos para verificação do CPF! \n\n"; 
		var nonNumbers = /\D/;
		if (nonNumbers.test(cpf)) erro += "A verificacao de CPF suporta apenas numeros! \n\n"; 
		if (cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || cpf == "88888888888" || cpf == "99999999999"){
		erro += "Número de CPF inválido!"
	}

	var a = [];
	var b = new Number;
	var c = 11;
	
	for (i=0; i<11; i++){
		a[i] = cpf.charAt(i);
		if (i < 9) b += (a[i] * --c);
	}
	
	if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11-x }
	
	b = 0;
	c = 11;
	
	for (y=0; y<10; y++) b += (a[y] * c--); 
		if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11-x; }
		if ((cpf.charAt(9) != a[9]) || (cpf.charAt(10) != a[10])){
			erro +="Dígito verificador com problema!";
		}
		if (erro.length > 0){
			alert(erro);
			return false;
		}

	return true;
}

function validarEmail (txtEmail, strMsg) {

    var strEmail = trim(txtEmail.value);

    if (strEmail.length == 0 ) {
        if(typeof(strMsg) != "undefined"){
            alert(strMsg);
        }
        txtEmail.select();
        txtEmail.focus();
        return false;
    }

    var strEmailPat=/^(.+)@(.+)$/;
    var matchArray=strEmail.match(strEmailPat);

    if (matchArray==null) {
        if(typeof(strMsg) != "undefined"){
            alert(strMsg);
        }
        txtEmail.select();
        txtEmail.focus();
        return false;
    }

    return true;
}

	if(navigator.appName.indexOf('Microsoft') != -1){   
		clientNavigator = "IE";   
	}else{   
		clientNavigator = "Other";   
	}
	
function fnTeclarNumeros(evnt){   
//Função permite digitação de números   
    if(clientNavigator == "IE"){   
        if(evnt.keyCode < 48|| evnt.keyCode > 57){
			alert("Esse campo só aceita números.");
            return false; 
        }   
    }else{   
        if((evnt.charCode < 48|| evnt.charCode > 57) && evnt.keyCode == 0){   
			alert("Esse campo só aceita números.");
			return false; 
        }   
    }   
}

function teclasMoeda(event, txtInput){
    var tecla = event.keyCode;
    var strValor = txtInput.value;
    if (tecla > 47 && tecla < 58)
        return true;
    else {
        if ((tecla == 8) || ( (tecla == 44) && (strValor != '') && (strValor.indexOf(",") < 0 )))
            return true;
        else {
            if ((tecla == 8) || ( (tecla == 46) && (strValor != '') && (strValor.indexOf(".") < 0 )))
                return true;
            else
                event.keyCode = 0;
        }
    }
}

function validarData(cmbDia, cmbMes, txtAno, strMsg){
    //valida as datas no formato dd/mm/aaaa num text ...

    if (txtAno.value.length < 4){
        if(typeof(strMsg) != "undefined"){
            alert(strMsg);
        }
        return false;
    }

    var intAno = eval(txtAno.value);
    var intDia = eval(cmbDia.value);
    var intMes = eval(cmbMes.value);

    var arrMeses = new Array(13);
    arrMeses[1]  = 31;
    if((intAno % 4) == 0)
        arrMeses[2]  = 29;
    else
        arrMeses[2]  = 28;
    arrMeses[3]  = 31;
    arrMeses[4]  = 30;
    arrMeses[5]  = 31;
    arrMeses[6]  = 30;
    arrMeses[7]  = 31;
    arrMeses[8]  = 31;
    arrMeses[9]  = 30;
    arrMeses[10] = 31;
    arrMeses[11] = 30;
    arrMeses[12] = 31;

    if ((intDia < 1) || (eval(intDia) > arrMeses[eval(intMes)]) || (intMes < 1 || intMes > 12)){
        if(typeof(strMsg) != "undefined"){
            alert(strMsg);
        }
        return false;
    }

    return true;
}

function fnValidaCpf() {
	with (document.frmRh) {
		if (cpf1.value=="") {
			alert("Por favor, digite o Número do seu CPF");
			cpf1.focus();
			return false;
		}
		if (cpf2.value=="") {
			alert("Por favor, digite os dígitos do seu CPF");
			cpf2.focus();
			return false;
		}
		var intCpf = cpf1.value + cpf2.value;
		var bolValida = validaCPF(intCpf);
		if (!bolValida) {
			cpf1.focus();
			return false;
		}
	}
	
	document.frmRh.submit();
}
function fnValidaParte1() {
	with (document.frmRh) {
		if (nome.value=="") {
			alert("Por favor, digite o seu Nome");
			nome.focus();
			return false;
		}
		if (dia.value=="") {
			alert("Por favor, digite o dia do seu nascimento");
			dia.focus();
			return false;
		}
		if (mes.value=="") {
			alert("Por favor, digite o mês do seu nascimento");
			mes.focus();
			return false;
		}
		if (ano.value=="") {
			alert("Por favor, digite o ano do seu nascimento");
			ano.focus();
			return false;
		}

	   bolValida = validarData(dia,mes,ano, "Por favor informe uma data de nascimento válida.");
	   if (!bolValida)
		 return false;							   
						   
		if (estado_civil.value=="0") { 
			alert("Por favor, selecione o seu estado civil.");
			estado_civil.focus();
			return false;
		}
		if (uf_endereco.value=="0") { 
			alert("Por favor, selecione o seu estado.");
			estado.focus();
			return false;
		}		
	}
	
	document.frmRh.submit();
}
function fnValidaParte2() {
		if (document.frmRh.grau1.value=="0") {
			alert("Por favor, selecione seu grau de formação");
			document.frmRh.grau1.focus();
			return false;
		}
		if (typeof(document.frameCurso1.curso1)!="undefined") { 
			if (document.frameCurso1.curso1.value=="0") {
				alert("Por favor, selecione o seu curso de formação");
				document.frameCurso1.focus();
				return false;
			}
		}
		if (typeof(document.frameEspecializacao1.especializacao1)!="undefined") { 
			if (document.frameEspecializacao1.especializacao1.value=="0") {
				alert("Por favor, selecione a sua especialização");
				document.frameEspecializacao1.especializacao1.focus();
				return false;
			}
			document.frmRh.hdEspecializacao1.value = document.frameEspecializacao1.especializacao1.value;
		}
		if (document.frmRh.status1.value=="0") {
			alert("Por favor, selecione o status do curso");
			document.frmRh.status1.focus();
			return false;
		}		
		if (document.frmRh.instituicao1.value=="") {
			alert("Por favor, digite o nome da instituição de ensino");
			document.frmRh.instituicao1.focus();
			return false;
		}
		if (document.frmRh.local1.value=="") { 
			alert("Por favor, digite o local da instituição de ensino.");
			document.frmRh.local1.focus();
			return false;
		}
		if (document.frmRh.informacoes.lenght>800) { 
			alert("Só é permitido 800 caracteres.");
			document.frmRh.informacoes.focus();
			return false;
		}
		if (typeof(document.frameEspecializacao2.especializacao2)!="undefined") { 
			document.frmRh.hdEspecializacao2.value = document.frameEspecializacao2.especializacao2.value;
		}	
		if (typeof(document.frameEspecializacao3.especializacao3)!="undefined") { 
			document.frmRh.hdEspecializacao3.value = document.frameEspecializacao3.especializacao3.value;
		}										

	document.frmRh.submit();
}

function fnMudaGrau(tipo) {
	switch (tipo) {
		case 1:
			var intGrau = document.frmRh.grau1.value;
			document.frameCurso1.location="incCurso.php?grau="+intGrau+"&tipo="+tipo;
			break;
		case 2:
			var intGrau = document.frmRh.grau2.value;
			document.frameCurso2.location="incCurso.php?grau="+intGrau+"&tipo="+tipo;
			break;
		case 3:
			var intGrau = document.frmRh.grau3.value;
			document.frameCurso3.location="incCurso.php?grau="+intGrau+"&tipo="+tipo;
			break;
	}	
}

function fnMudaCurso(tipo) {
	switch (tipo) {
		case 1:
			var intGrau = document.frmRh.grau1.value;
			var strCurso = escape(document.frameCurso1.curso1.value);
			document.frameEspecializacao1.location="incEspecializacao.php?curso="+strCurso+"&grau="+intGrau+"&tipo="+tipo;
			break;
		case 2:
			var intGrau = document.frmRh.grau2.value;
			var strCurso = escape(document.frameCurso2.curso2.value);
			document.frameEspecializacao2.location="incEspecializacao.php?curso="+strCurso+"&grau="+intGrau+"&tipo="+tipo;
			break;
		case 3:
			var intGrau = document.frmRh.grau3.value;
			var strCurso = escape(document.frameCurso3.curso3.value);
			document.frameEspecializacao3.location="incEspecializacao.php?curso="+strCurso+"&grau="+intGrau+"&tipo="+tipo;
			break;
	}	
}

function fnValidaParte3() {
		if (document.frmRh.salario_pretendido.value=="") {
			alert("Por favor, digite o salário pretendido.");
			document.frmRh.salario_pretendido.focus();
			return false;
		}
		if (document.frmRh.empresa1.value=="") {
			alert("Por favor, digite o nome da última empresa");
			document.frmRh.empresa1.focus();
			return false;
		}		
		if (document.frmRh.de_dia_periodo1.value=="") {
			alert("Por favor, digite o dia do período de início");
			document.frmRh.de_dia_periodo1.focus();
			return false;
		}
		if (document.frmRh.de_mes_periodo1.value=="") {
			alert("Por favor, digite o mês do período de início");
			document.frmRh.de_mes_periodo1.focus();
			return false;
		}	
		if (document.frmRh.de_ano_periodo1.value=="") {
			alert("Por favor, digite o ano do período de início");
			document.frmRh.de_ano_periodo1.focus();
			return false;
		}		
		 bolValida = validarData(document.frmRh.de_dia_periodo1,document.frmRh.de_mes_periodo1.value,document.frmRh.de_ano_periodo1, "Por favor informe uma data válida.");
		 if ((document.frmRh.a_dia_periodo1.value!="") && (document.frmRh.a_mes_periodo1.value!="") && (document.frmRh.a_ano_periodo1.value!="")) {
			 bolValida = validarData(document.frmRh.a_dia_periodo1,document.frmRh.a_mes_periodo1.value,document.frmRh.a_ano_periodo1, "Por favor informe uma data válida.");	
		 }
		 
		 if ((document.frmRh.de_dia_periodo2.value!="") && (document.frmRh.de_mes_periodo2.value!="") && (document.frmRh.de_ano_periodo2.value!="")) {
			 bolValida = validarData(document.frmRh.de_dia_periodo2,document.frmRh.de_mes_periodo2.value,document.frmRh.de_ano_periodo2, "Por favor informe uma data válida.");
		 }
		 
		 if ((document.frmRh.a_dia_periodo2.value!="") && (document.frmRh.a_mes_periodo2.value!="") && (document.frmRh.a_ano_periodo2.value!="")) {
			 bolValida = validarData(document.frmRh.a_dia_periodo2,document.frmRh.a_mes_periodo2.value,document.frmRh.a_ano_periodo2, "Por favor informe uma data válida.");
		 }
		 
		 if ((document.frmRh.de_dia_periodo3.value!="") && (document.frmRh.de_mes_periodo3.value!="") && (document.frmRh.de_ano_periodo3.value!="")) {
			 bolValida = validarData(document.frmRh.de_dia_periodo3,document.frmRh.de_mes_periodo3.value,document.frmRh.de_ano_periodo3, "Por favor informe uma data válida.");
		 }
		 
		 if ((document.frmRh.a_dia_periodo3.value!="") && (document.frmRh.a_mes_periodo3.value!="") && (document.frmRh.a_ano_periodo3.value!="")) {
			 bolValida = validarData(document.frmRh.a_dia_periodo3,document.frmRh.a_mes_periodo3.value,document.frmRh.a_ano_periodo3, "Por favor informe uma data válida.");				 
		 }
		 
		if (document.frmRh.atividades1.value=="") { 
			alert("Por favor, digite as atividades exercidas.");
			document.frmRh.atividades1.focus();
			return false;
		}
		if (document.frmRh.cargo1.value=="") { 
			alert("Por favor, digite o seu último cargo.");
			document.frmRh.cargo1.focus();
			return false;
		}								
		if (document.frmRh.salario1.value=="") { 
			alert("Por favor, digite o seu último salário.");
			document.frmRh.salario1.focus();
			return false;
		}	
	
	document.frmRh.submit();
}

function fnValidaParte4() {
		if (document.frmRh.regiao.value=="0") {
			alert("Por favor, selecione a região que deseja trabalhar");
			document.frmRh.regiao.focus();
			return false;
		}
											
	
	document.frmRh.submit();
}

function EnviaTab(CampoOrigem, CampoDestino){
	if(CampoOrigem.maxLength==CampoOrigem.value.length) {
		CampoDestino.focus();
	}
}
