// JavaScript Document
function validarCurriculum(){
						
						
						//DADOS PESSOAIS
						 var nome = $('#nome').val();
						 var cpf = $('#cpf').val();
						 var dianasc = $('#dianasc').val();
						 var mesnasc = $('#mesnasc').val();
						 var anonasc = $('#anonasc').val();
						 var rg = $('#rg').val();
						 var escolaridade = $('#escolaridade').val();
						
						
						
						
						 var estado = $('#estado').val();
						 var cidade = $('#cidade').val();
						 var localizacao = $('#localizacao').val();
						 var numero = $('#numero').val();
						 var bairro = $('#bairro').val();
						 var email = $('#email').val();
						 
						 var nomecontato = $('#nomecontato').val();
						 var tel1 = $('#tel1').val();	
							
							
						
						 
						 
						 
						 
						 
						 if(nome == "" || nome == null){
							alert('Preencha o Campo Nome !');
							return false;
						 }
						 
						 
						 if(cpf == "" || cpf == null){
							alert('Preencha o Campo CPF !');
							return false;
						 }
						 
						 
						  if(dianasc == "" || dianasc == null){
							alert('Selecione o Dia de Nascimento !');
							return false;
						 }
						 
						 
						  if(anonasc == "" || anonasc == null){
							alert('Selecione o Ano do Nascimento !');
							return false;
						 }
						 
						 
						  if(mesnasc == "" || mesnasc == null){
							alert('Selecione o Mes do Nascimento !');
							return false;
						 }
						 
						 
						 if(rg == "" || rg == null){
							alert('Preencha o Campo RG !');
							return false;
						 }
						 
						 
						 if(escolaridade == "" || escolaridade == null){
							alert('Preencha o Campo Escolaridade !');
							return false;
						 }
						 
						 
						 //ENDERE�O
						  if(estado == "" || estado == null){
							alert('Preencha o Campo Estado !');
							return false;
						 }
						 
						 if(cidade == "" || cidade == null){
							alert('Preencha o Campo Cidade !');
							return false;
						 }
						 
						 
						 
						  if(localizacao == "" || localizacao == null){
							alert('Preencha o Campo Endereco !');
							return false;
						 }
						 
						 
						 
						 
						 if(numero == "" || numero == null){
							alert('Preencha o Campo Numero !');
							return false;
						 }
						 
						 
						 if(bairro == "" || bairro == null){
							alert('Preencha o Campo Bairro !');
							return false;
						 }
						 
						
						 if(email == "" || email == null){
							alert('Preencha o Campo Email !');
							return false;
						 }
						 
						 
						  if(tel1 == "" || tel1 == null){
							alert('Preencha o Campo Telefone !');
							return false;
						 }
						 
						  if(nomecontato == "" || nomecontato == null){
							alert('Preencha o Campo Nome Contato !');
							return false;
						 }
	
						
					}
					
					
					function recolher(){
						
							//document.getElementById('recolhe').disabled= "disabled";
							alert('teste');
							
					}
					
					function teste(){
						alert('teste');
					}
					
				
					function bloquearemprego(){
							
							
							if(document.getElementById('primeiroemprego').value == 1){
							
								document.getElementById('primeiroemprego').value = 0;
							
								document.getElementById('funcao1').disabled = "disabled";
								document.getElementById('empresa1').disabled = "disabled";
								document.getElementById('dddtel1').disabled = "disabled";
								document.getElementById('teltel1').disabled = "disabled";
								document.getElementById('mesperiodoentrada1').disabled = "disabled";
								document.getElementById('anoperiodoentrada1').disabled = "disabled";
								document.getElementById('mesperiodosaida1').disabled = "disabled";
								document.getElementById('anoperiodosaida1').disabled = "disabled";
								
								
								document.getElementById('funcao2').disabled = "disabled";
								document.getElementById('empresa2').disabled = "disabled";
								document.getElementById('dddtel2').disabled = "disabled";
								document.getElementById('teltel2').disabled = "disabled";
								document.getElementById('mesperiodoentrada2').disabled = "disabled";
								document.getElementById('anoperiodoentrada2').disabled = "disabled";
								document.getElementById('mesperiodosaida2').disabled = "disabled";
								document.getElementById('anoperiodosaida2').disabled = "disabled";
								
								
								document.getElementById('funcao3').disabled = "disabled";
								document.getElementById('empresa3').disabled = "disabled";
								document.getElementById('dddtel3').disabled = "disabled";
								document.getElementById('teltel3').disabled = "disabled";
								document.getElementById('mesperiodoentrada3').disabled = "disabled";
								document.getElementById('anoperiodoentrada3').disabled = "disabled";
								document.getElementById('mesperiodosaida3').disabled = "disabled";
								document.getElementById('anoperiodosaida3').disabled = "disabled";
							
							
							}
							else{
								
								document.getElementById('primeiroemprego').value = 1;
								
								document.getElementById('funcao1').disabled = "";
								document.getElementById('empresa1').disabled = "";
								document.getElementById('dddtel1').disabled = "";
								document.getElementById('teltel1').disabled = "";
								document.getElementById('mesperiodoentrada1').disabled = "";
								document.getElementById('anoperiodoentrada1').disabled = "";
								document.getElementById('mesperiodosaida1').disabled = "";
								document.getElementById('anoperiodosaida1').disabled = "";
								
								
								document.getElementById('funcao2').disabled = "";
								document.getElementById('empresa2').disabled = "";
								document.getElementById('dddtel2').disabled = "";
								document.getElementById('teltel2').disabled = "";
								document.getElementById('mesperiodoentrada2').disabled = "";
								document.getElementById('anoperiodoentrada2').disabled = "";
								document.getElementById('mesperiodosaida2').disabled = "";
								document.getElementById('anoperiodosaida2').disabled = "";
								
								
								document.getElementById('funcao3').disabled = "";
								document.getElementById('empresa3').disabled = "";
								document.getElementById('dddtel3').disabled = "";
								document.getElementById('teltel3').disabled = "";
								document.getElementById('mesperiodoentrada3').disabled = "";
								document.getElementById('anoperiodoentrada3').disabled = "";
								document.getElementById('mesperiodosaida3').disabled = "";
								document.getElementById('anoperiodosaida3').disabled = "";
							}
							
							
							
							
						
					}
					
		
                
              
					function validacpf(cpf){
						
						$.ajax({

								// Usando metodo Post
								type: 'POST',
	
								// this.action pega o script para onde vai ser enviado os dados
								url: 'sessoes/curriculo/validacpf.php?cpf'+cpf.value,
	
								// os dados que pegamos com a fun��o serialize()
								data: 'Null',
	
								// Antes de enviar
								beforeSend: function(){
										
								},
							
								success: function(txt){
								
								 	
								
								$('#testeval').innerHTML = txt;	
									
									
									 
					
									
									
								}
		
       					 })
						
						
					}
					
					
					function imprimir(id,nome){
								 var width = 750;
								  var height = 600;
								
								  var left = 99;
								  var top = 99;

  window.open('sessoes/horarios/print.php?idrota='+id+'&nomerota='+nome,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');

					}
					
					
					function indica(){
						
						document.getElementById('nomeindicacao').disabled = "";
					}
					
		
    


									
									
										
										
			function tas(){						
									
				document.getElementById('stl').innerHTML = "<style>html,body{ overflow:hidden;	}</style>";							
		
			}
								
									
									
									

	

function abrir(URL) {

  var width = 450;
  var height = 300;

  var left = 99;
  var top = 99;

  window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=yes');

}



		
		
		function gravadados(){
			
				
				document.forms['form1'].action = "sessoes/curriculo/gravadados.php";
				document.forms['form1'].submit();
		
			
		}
		
		
		
		
		function validar(a,b){
			if(a.value == '' || a.value == null){
				alert('O ' + b + ' deve ser preechido!');
				a.style.border = '1px solid red';
				document.getElementById('btn').disabled = "disabled";
				
				if(b == 'CPF'){
						
						var c = a.value;  
						
						car = c.split('.');
						
						car2 = car[2].split('-');
						
						cpf = car[0] + car[1] + car2[0] + car2[1];
						
						if((cpf = 11111111111) || (cpf = 22222222222) || (cpf = 33333333333) || (cpf = 44444444444) || (cpf = 55555555555)  ||(cpf = 66666666666) || (cpf = 77777777777) || (cpf = 88888888888) || (cpf = 99999999999)){
							alert('CPF Invalido!'); 
							
						}
						
						exp = /\.|\-/g        
						cpf = cpf.toString().replace( exp, "" );         
						var digitoDigitado = eval(cpf.charAt(9)+cpf.charAt(10));        
						var soma1=0, soma2=0;      
						var vlr =11;                
						for(i=0;i<9;i++){                
							soma1+=eval(cpf.charAt(i)*(vlr-1));               
							soma2+=eval(cpf.charAt(i)*vlr);                
							vlr--;        }               
							soma1 = (((soma1*10)%11)==10 ? 0:((soma1*10)%11));       
							soma2=(((soma2+(2*soma1))*10)%11);               
							var digitoGerado=(soma1*10)+soma2;        
							if(digitoGerado!=digitoDigitado)                      
							alert('CPF Invalido!'); 
							
				}
				
				
				
			}
			else{
				
				if(b == 'CPF'){
						var c = a.value;  
						
						car = c.split('.');
						
						car2 = car[2].split('-');
						
						cpf = car[0] + car[1] + car2[0] + car2[1];
						
								
						if((cpf = 11111111111) || (cpf = 22222222222) || (cpf = 33333333333) || (cpf = 44444444444) || (cpf = 55555555555)  ||(cpf = 66666666666) || (cpf = 77777777777) || (cpf = 88888888888) || (cpf = 99999999999)){
							alert('CPF Invalido!'); 
							a.style.border = '1px solid red';
						}
						
						exp = /\.|\-/g        
						cpf = cpf.toString().replace( exp, "" );         
						var digitoDigitado = eval(cpf.charAt(9)+cpf.charAt(10));        
						var soma1=0, soma2=0;      
						var vlr =11;                
						for(i=0;i<9;i++){                
							soma1+=eval(cpf.charAt(i)*(vlr-1));               
							soma2+=eval(cpf.charAt(i)*vlr);                
							vlr--;        }               
							soma1 = (((soma1*10)%11)==10 ? 0:((soma1*10)%11));       
							soma2=(((soma2+(2*soma1))*10)%11);               
							var digitoGerado=(soma1*10)+soma2;        
							if(digitoGerado!=digitoDigitado)                     
							alert('CPF Invalido!'); 
							
						
				}
				
				
				
				a.style.border = '1px solid silver';
				document.getElementById('btn').disabled = "";
			}
			
			
		}
		
		function fechar(){
			
			document.getElementById('teste2').style.display = "none";	
		}
		
		
		function openIntegracao(url){
			window.open('sessoes/integracao/'+url+'','','fullscreen=no, scrollbars=auto,toolbar=auto,menubar=1');
	
		}

