function confirma_delete(cod,xid){
  if (confirm('Deseja realmente apagar a vaga?') == 1){
       parent.makeRequest1('../testes/lista_vagas.php?op_excluir=' + cod);
  }
}

       function validar_campos_contato(){
	   //campo nome
	   if(!document.all.f.nome.value){
	     alert('preencha o campo nome');
		 document.all.f.nome.focus();
		 return false;
	   }
	   //campo email
	   if(!document.all.f.email.value){
	     alert('preencha o campo email');
		 document.all.f.email.focus();
		 return false;
	   }
	   //validar campo email
	   if(document.all.f.email.value.indexOf('@') == -1 || document.all.f.email.value.indexOf('.') == -1 ) {
	     alert('campo email inválido');
		 document.all.f.email.focus();
		 return false;
	   }
	   //campo telefone
	   if(!document.all.f.telefone.value){
	     alert('preencha o campo telefone');
		 document.all.f.telefone.focus();
		 return false;
	   }
	   //campo assunto
	   if(!document.all.f.assunto.value){
	     alert('escolha o assunto');
		 document.all.f.assunto.focus();
		 return false;
	   }
	   //campo mensagem
	   if(!document.all.f.mensagem.value){
	     alert('Digite a sua mensagem');
		 document.all.f.mensagem.focus();
		 return false;
	   }
	return true;	
	}


	function menos(op){
	   if(eval("document.all." + op + ".value") == 1){
	      return false;
	   }else{
	      var valor = eval("document.all." + op + ".value");
		   valor = (valor*1 - 1);
		  eval("document.all." + op + ".value=" + valor);
	   }
	}
	function mais(op){
		  valor = eval("document.all." + op + ".value");
		  valor = (valor*1 + 1);
		 eval("document.all." + op + ".value=" + valor);
	}




	function validar_login(){
		if(!document.all.flogin.acesso_login.value){
			alert('Digite seu email de cadastro no campo login!');
			document.all.flogin.acesso_login.focus();
			return false;
		}
		if(!document.all.flogin.acesso_senha.value){
			alert('Digite sua senha de cadastro no campo senha!');
			document.all.flogin.acesso_senha.focus();
			return false;
		}
	return true;		
	}


	function validar_esqueci(){
		if(!document.all.fesqueci.acesso_email.value){
			alert('Digite seu email de cadastro no campo E-mail!');
			document.all.fesqueci.acesso_email.focus();
			return false;
		}
		if(document.all.fesqueci.acesso_email.value.indexOf('@') == -1 || document.all.fesqueci.acesso_email.value.indexOf('.') == -1){
	      alert('Email inválido!');
		  document.all.fesqueci.acesso_email.focus();
		  return false;
	   }

	return true;		
	}


function validar_cadastro(){

//validar campo razao_social
if(!document.all.f.razao_social.value){
alert('Campo razao_social é obrigatório!');
document.all.f.razao_social.focus();
return false;
}

//validar campo cnpj
if(!document.all.f.cnpj.value){
alert('Campo cnpj é obrigatório!');
document.all.f.cnpj.focus();
return false;
}

//validar campo aniversario
if(!document.all.f.aniversario.value){
alert('Campo aniversario é obrigatório!');
document.all.f.aniversario.focus();
return false;
}

//validar campo email
if(!document.all.f.email.value){
alert('Campo email é obrigatório!');
document.all.f.email.focus();
return false;
}

//validar campo senha
if(!document.all.f.senha.value){
alert('Campo senha é obrigatório!');
document.all.f.senha.focus();
return false;
}

if(document.all.f.senha.value != document.all.f.senha1.value){
alert('Confirmação de senha não confere!');
document.all.f.senha.value='';
document.all.f.senha1.value='';
document.all.f.senha.focus();
return false;
}

//validar campo lembrete
if(!document.all.f.lembrete.value){
alert('Campo lembrete é obrigatório!');
document.all.f.lembrete.focus();
return false;
}

//validar campo telefone
if(!document.all.f.telefone.value){
alert('Campo telefone é obrigatório!');
document.all.f.telefone.focus();
return false;
}

//validar campo fax
if(!document.all.f.fax.value){
alert('Campo fax é obrigatório!');
document.all.f.fax.focus();
return false;
}

//validar campo endereco
if(!document.all.f.endereco.value){
alert('Campo endereco é obrigatório!');
document.all.f.endereco.focus();
return false;
}

//validar campo bairro
if(!document.all.f.bairro.value){
alert('Campo bairro é obrigatório!');
document.all.f.bairro.focus();
return false;
}

//validar campo cidade
if(!document.all.f.cidade.value){
alert('Campo cidade é obrigatório!');
document.all.f.cidade.focus();
return false;
}

//validar campo cep
if(!document.all.f.cep.value){
alert('Campo cep é obrigatório!');
document.all.f.cep.focus();
return false;
}

//validar campo pais
if(!document.all.f.pais.value){
alert('Campo pais é obrigatório!');
document.all.f.pais.focus();
return false;
}

//validar campo endereco_dest
if(!document.all.f.endereco_dest.value){
alert('Campo endereco_dest é obrigatório!');
document.all.f.endereco_dest.focus();
return false;
}

//validar campo bairro_dest
if(!document.all.f.bairro_dest.value){
alert('Campo bairro_dest é obrigatório!');
document.all.f.bairro_dest.focus();
return false;
}

//validar campo cidade_dest
if(!document.all.f.cidade_dest.value){
alert('Campo cidade_dest é obrigatório!');
document.all.f.cidade_dest.focus();
return false;
}

//validar campo cep_dest
if(!document.all.f.cep_dest.value){
alert('Campo cep_dest é obrigatório!');
document.all.f.cep_dest.focus();
return false;
}

//validar campo pais_dest
if(!document.all.f.pais_dest.value){
alert('Campo pais_dest é obrigatório!');
document.all.f.pais_dest.focus();
return false;
}

//validar campo razao_social_ref
if(!document.all.f.razao_social_ref.value){
alert('Campo razao_social_ref é obrigatório!');
document.all.f.razao_social_ref.focus();
return false;
}

//validar campo telefone_ref
if(!document.all.f.telefone_ref.value){
alert('Campo telefone_ref é obrigatório!');
document.all.f.telefone_ref.focus();
return false;
}
return true;
}


	function RepeteEndereco(){
	
		if(document.all.f.x.checked == true){
		
			document.all.f.endereco_dest.value = document.all.f.endereco.value;
			document.all.f.bairro_dest.value = document.all.f.bairro.value;
			document.all.f.cidade_dest.value = document.all.f.cidade.value;
			document.all.f.cep_dest.value = document.all.f.cep.value;
			document.all.f.pais_dest.value = document.all.f.pais.value;

		}else if(document.all.f.x.checked == false){

			document.all.f.endereco_dest.value = '';
			document.all.f.bairro_dest.value = '';
			document.all.f.cidade_dest.value = '';
			document.all.f.cep_dest.value = '';
			document.all.f.pais_dest.value = '';

		}
	
	}
	
	function t(x,o){
                if(o == 'c'){
                window.color = window.document.all[x].style.background;
                window.document.all[x].style.background = '#FFFFFF';
                window.document.all['bg_lateral'].style.background = '#FFFFFF';
                }else{
                window.document.all[x].style.background = '#FFFFFF';
                window.document.all['bg_lateral'].style.background = '';
                }
    }
	


 function validar_mailing(){
	   //validação do campo nome
	   if(!document.all.mailing.nome.value){
	      alert('Preencha o campo Nome!');
		  document.all.mailing.nome.focus();
		  return false;
	   }
	   
	   //validação do campo celular
	   if(!document.all.mailing.celular.value){
	      alert('Preencha o campo Celular!');
		  document.all.mailing.celular.focus();
		  return false;
	   }
	   
	   //validação do campo email
	   if(!document.all.mailing.email.value){
	      alert('Preencha o campo Email!');
		  document.all.mailing.email.focus();
		  return false;
	   }
   	   //validação do campo email
	   if(document.all.mailing.email.value.indexOf('@') == -1 || document.all.mailing.email.value.indexOf('.') == -1){
	      alert('Email inválido!');
		  document.all.mailing.email.focus();
		  return false;
	   }
	 return true;
	}


  function validar_curriculum(){
	   //campo nome
	   if(!document.all.f.nome.value){
	     alert('Campo Obrigatorio');
		 document.all.f.nome.focus();
		 return false;
	   }
	   //campo email
	   if(!document.all.f.sexo.value){
	     alert('Campo Obrigatorio');
		 document.all.f.sexo.focus();
		 return false;
	   }
	    if(!document.all.f.data_nascimento.value){
	     alert('Campo Obrigatorio');
		 document.all.f.data_nascimento.focus();
		 return false;
	   }
	   if(!document.all.f.telefone.value){
	     alert('Campo Obrigatorio');
		 document.all.f.telefone.focus();
		 return false;
	   }
	   if(!document.all.f.endereco.value){
	     alert('Campo Obrigatorio');
		 document.all.f.endereco.focus();
		 return false;
	   }
	   if(!document.all.f.ddd.value){
	     alert('Campo Obrigatorio');
		 document.all.f.ddd.focus();
		 return false;
	   }
	   if(!document.all.f.celular.value){
	     alert('Campo Obrigatorio');
		 document.all.f.celular.focus();
		 return false;
	   }
	    if(!document.all.f.estado.value){
	     alert('Campo Obrigatorio');
		 document.all.f.estado.focus();
		 return false;
	   }
	   //campo assunto
	   if(!document.all.f.cidade.value){
	     alert('Campo Obrigatorio');
		 document.all.f.cidade.focus();
		 return false;
	   }
	   //validar campo email
		 if(document.all.f.email.value.indexOf('@') == -1 || document.all.f.email.value.indexOf('.') == -1 ) {
	     alert('campo email inválido');
		 document.all.f.email.focus();
		 return false;
	   }
	   //campo telefone
	  
	   //campo mensagem
	   if(!document.all.f.cpf.value){
	     alert('Campo Obrigatorio');
		 document.all.f.cpf.focus();
		 return false;
	   }
	      if(!document.all.f.senha.value){
	     alert('Campo Obrigatorio');
		 document.all.f.senha.focus();
		 return false;
	   }


	     //campo telefone  
	   if(!document.all.f.formacao.value){
	     alert('Campo Obrigatorio');
		 document.all.f.formacao.focus();
		 return false;
	   }
	   //campo assunto
	  if(!document.all.f.area_profissional.value){
	     alert('Campo Obrigatorio');
		 document.all.f.area_profissional.focus();
		 return false;
	   }
	   //campo assunto
	   if(!document.all.f.informatica.value){
	     alert('Campo Obrigatorio');
		 document.all.f.informatica.focus();
		 return false;
	   }
	   //campo mensagem
	   if(!document.all.f.idioma.value){
	     alert('Campo Obrigatorio');
		 document.all.f.idioma.focus();
		 return false;
	   }
	    if(!document.all.f.palavraChave.value){
	     alert('Campo Obrigatorio');
		 document.all.f.palavraChave.focus();
		 return false;
	   }
	   //campo mensagem
	   if(!document.all.f.perfil.value){
	     alert('Campo Obrigatorio');
		 document.all.f.perfil.focus();
		 return false;
	   }
	  
	return true;	
	}


 function validar_cadastro_empresa(){
	   //campo nome
	  if(!document.all.f.empresa.value){
	     alert('Campo Obrigatorio');
		 document.all.f.empresa.focus();
		 return false;
	   }
	   //campo email
	   if(!document.all.f.telefone.value){
	     alert('Campo Obrigatorio');
		 document.all.f.telefone.focus();
		 return false;
	   }
	    if(document.all.f.email.value.indexOf('@') == -1 || document.all.f.email.value.indexOf('.') == -1 ) {
	     alert('campo email inválido');
		 document.all.f.email.focus();
		 return false;
	   }
	   //campo assunto
	   if(!document.all.f.cnpj.value){
	     alert('Campo Obrigatorio');
		 document.all.f.cnpj.focus();
		 return false;
	   }
	//campo mensagem
	   if(!document.all.f.endereco.value){
	     alert('Campo Obrigatorio');
		 document.all.f.endereco.focus();
		 return false;
	   }
	      if(!document.all.f.estado.value){
	     alert('Campo Obrigatorio');
		 document.all.f.estado.focus();
		 return false;
	   }
	    if(!document.all.f.cidade.value){
	     alert('Campo Obrigatorio');
		 document.all.f.cidade.focus();
		 return false;
	   }
	     //campo telefone  
	   if(!document.all.f.nomecontato.value){
	     alert('Campo Obrigatorio');
		 document.all.f.nomecontato.focus();
		 return false;
	   }
	   //campo assunto
	  if(!document.all.f.cargo.value){
	     alert('Campo Obrigatorio');
		 document.all.f.cargo.focus();
		 return false;
	   }
	   //campo assunto
	  if(document.all.f.email_contato.value.indexOf('@') == -1 || document.all.f.email.value.indexOf('.') == -1 ) {
	     alert('campo email inválido');
		 document.all.f.email_contato.focus();
		 return false;
	   }
	return true;	
	}



 function validar_anunciar_vagas(){
	   //campo nome
	   if(!document.all.f.estado.value){
	     alert('Campo Obrigatorio');
		 document.all.f.estado.focus();
		 return false;
	   }
	   //campo email
	   if(!document.all.f.cidade.value){
	     alert('Campo Obrigatorio');
		 document.all.f.cidade.focus();
		 return false;
	   }	   
	   if(!document.all.f.area_profissional.value){
	     alert('Campo Obrigatorio');
		 document.all.f.area_profissional.focus();
		 return false;
	   }
	  if(!document.all.f.nivel_hierarquico.value){
	     alert('Campo Obrigatorio');
		 document.all.f.nivel_hierarquico.focus();
		 return false;
	   }
	   //campo email
	   if(!document.all.f.segmento_empresa.value){
	     alert('Campo Obrigatorio');
		 document.all.f.segmento_empresa.focus();
		 return false;
	   }	   
	   if(!document.all.f.titulo_vaga.value){
	     alert('Campo Obrigatorio');
		 document.all.f.titulo_vaga.focus();
		 return false;
	   }
	   if(document.all.f.email_contato.value.indexOf('@') == -1 || document.all.f.email.value.indexOf('.') == -1 ) {
	     alert('campo email inválido');
		 document.all.f.email_contato.focus();
		 return false;
	   }
	return true;	
	}



    function validar_campos_contato(){
	   //campo nome
	   if(!document.all.f.nome.value){
	     alert('preencha o campo nome');
		 document.all.f.nome.focus();
		 return false;
	   }
	   //campo email
	   if(!document.all.f.email.value){
	     alert('preencha o campo email');
		 document.all.f.email.focus();
		 return false;
	   }
	   //validar campo email
	   if(document.all.f.email.value.indexOf('@') == -1 || document.all.f.email.value.indexOf('.') == -1 ) {
	     alert('campo email inválido');
		 document.all.f.email.focus();
		 return false;
	   }
	   //campo telefone
	   if(!document.all.f.telefone.value){
	     alert('preencha o campo telefone');
		 document.all.f.telefone.focus();
		 return false;
	   }
	   //campo assunto
	   if(!document.all.f.assunto.value){
	     alert('escolha o assunto');
		 document.all.f.assunto.focus();
		 return false;
	   }
	   //campo mensagem
	   if(!document.all.f.mensagem.value){
	     alert('Digite a sua mensagem');
		 document.all.f.mensagem.focus();
		 return false;
	   }
	return true;	
	}

function LoginUsuario(){
		pagina_contato.location.href='./includes/validar_acesso.inc.php';
	}
		
function LoginEmpresa(tipo){
		pagina_contato.location.href='./includes/validar_empresa.inc.php?tipo='+tipo;
	}
		
function mandar(){
		alert('Seu curriculo foi enviado com sucesso!');

}




////////////////////////////////////////////////////////////// MASCARAS /////////////////////////////////////////////

function mascaraCPF(objeto){
	if (objeto.value.length == 3 || objeto.value.length == 7){
	objeto.value = objeto.value+".";
	}
	if (objeto.value.length == 11 ){
	objeto.value = objeto.value+"-";
	}
	if (objeto.value.length == 14 ){
		return validaCGC_CPF(objeto.value);
	}
}


function mascaraCNPJ(objeto){
	if (objeto.value.length == 3 || objeto.value.length == 7){
	objeto.value = objeto.value+".";
	}
	if (objeto.value.length == 11 ){
	objeto.value = objeto.value+"/";
	}
	if (objeto.value.length == 16 ){
	objeto.value = objeto.value+"-";
	}
	if (objeto.value.length == 19 ){
		//return check_cgc(objeto.value);
	}
}

function mascaraCPFCNPJ(objeto){
	if (objeto.value.length == 3 || objeto.value.length == 7){
	objeto.value = objeto.value+".";
	}
	if (objeto.value.length == 11 ){
	objeto.value = objeto.value+"-";
	}
	if (objeto.value.length == 16 ){
	var monta = objeto.value.substr(0,11)+'/'+objeto.value.substr(12,16)+'-';
	objeto.value = monta;
	}
	if (objeto.value.length == 19 ){
		//return check_cgc(objeto.value);
	}
}



function mascaraCEP(objeto){
	if (objeto.value.length == 2){
	objeto.value = objeto.value+".";
	}
	if (objeto.value.length == 6 ){
	objeto.value = objeto.value+"-";
	}
}




function Numero(e)
{
navegador = /msie/i.test(navigator.userAgent);
if (navegador)
var tecla = event.keyCode;
else
var tecla = e.which;

if(tecla > 47 && tecla < 58) // numeros de 0 a 9
return true;
else
{
if (tecla != 8) // backspace
return false;
else
return true;
}
}


function barra(objeto){

	   var DiaR = objeto.value.substr(0,2);

if(objeto.value.length == 2){
   if(objeto.value == '00' || objeto.value > '31'){
   alert('Dia invalido!');
   objeto.value = '';
   return false;
   }
}
if(objeto.value.length == 5){
   if(objeto.value.substr(3,5) == '00' || objeto.value.substr(3,5) > '12'){
   alert('Mes invalido!');
   objeto.value = objeto.value.substr(0,3);
   return false;
   }
   
  if(DiaR > 29 && objeto.value.substr(3,5) == '02'){
	 alert('Data invalida!');
	 objeto.value = '';
	 return false;
	   }
   
}



if(objeto.value.length == 10){
   
	   DAtual = new Date()

		AnoAtual = DAtual.getYear();
		MesAtual = DAtual.getMonth();
		DiaAtual = DAtual.getDate();
   
   if( (objeto.value.substr(6,10) < AnoAtual) && (objeto.value.substr(3,2) < (MesAtual + 1)) && (objeto.value.substr(0,2) < DiaAtual) ){
   alert('Data invalida para reserva!');
   objeto.value = '';
   return false;
   }
}


if (objeto.value.length == 2 || objeto.value.length == 5 ){
objeto.value = objeto.value+"/";
}
}








function hora(objeto){

	   var DiaR = objeto.value.substr(0,2);

if(objeto.value.length == 2){
   if(objeto.value > '24'){
   alert('Hora invalido!');
   objeto.value = '';
   return false;
   }
}

if (objeto.value.length == 2){
objeto.value = objeto.value+":";
}
}



function check_cpf (StrCPF)
{
x = 0;
soma = 0;
dig1 = 0;
dig2 = 0;
texto = "";
StrCPF1="";
len = StrCPF.length;
x = len -1;
for (var i=0; i <= len - 3; i++)
{
y = StrCPF.substring(i,i+1);
soma = soma + ( y * x);
x = x - 1;
texto = texto + y;
}
dig1 = 11 - (soma % 11);
if (dig1 == 10) dig1=0 ;
if (dig1 == 11) dig1=0 ;
StrCPF1 = StrCPF.substring(0,len - 2) + dig1 ;
x = 11; soma=0;
for (var i=0; i <= len - 2; i++)
{
soma = soma + (StrCPF1.substring(i,i+1) * x);
x = x - 1;
}
dig2= 11 - (soma % 11);
if (dig2 == 10) dig2=0;
if (dig2 == 11) dig2=0;
if ((dig1 + "" + dig2) == StrCPF.substring(len,len-2))
{
// alert ("Número do CPF Válido !");
return true;
}
alert ("Número do CPF Inválido !");
document.all.f.cpf.value='';
return false;
}


function check_cgc (StrCGC) {

StrCGC = StrCGC.substr(0,3) + StrCGC.substr(4,3) + StrCGC.substr(8,3) + StrCGC.substr(12,4) + StrCGC.substr(17,2);

//alert(StrCGC);




var varFirstChr = StrCGC.charAt(0);
var vlMult,vlControle,s1, s2 = "";
var i,j,vlDgito,vlSoma = 0;
for ( var i=0; i<=13; i++ ) {
	var c = StrCGC.charAt(i);
	if( ! (c>="0")&&(c<="9") )
{
alert("Número do CGC Inválido !");
document.all.f.cnpj.value='';
return false; 
}
if( c!=varFirstChr ) { vaCharCGC = true; }
}
if( ! vaCharCGC ) {

alert("Número do CGC Inválido !");
document.all.f.cnpj.value='';
return false ;
}

s1 = StrCGC.substring(0,12);
s2 = StrCGC.substring(12,15);
vlMult = "543298765432";
vlControle = "";
for ( j=1; j<3; j++ ) {

vlSoma = 0;
for ( i=0; i<12; i++ )
{ vlSoma += eval( s1.charAt(i) )* eval( vlMult.charAt(i) );}
if( j == 2 ){ vlSoma += (2 * vlDgito); }
vlDgito = ((vlSoma*10) % 11);
if( vlDgito == 10 ){ vlDgito = 0; }
vlControle = vlControle + vlDgito;
vlMult = "654329876543";
}
if( vlControle != s2 ) {
alert("Número do CGC Inválido !");
document.all.f.cnpj.value='';
return false;
}
else {
// alert("Número do CGC Válido !");
return true;
}


}

function validaCGC_CPF(StrData) {
	//alert('aqui');
	//var StrData = document.cadastro.cpf_cnpj.value;
	var CGCPat = /^(\d{2}).(\d{3}).(\d{3})\/(\d{4})-(\d{2})/;
	var CGCPat2 = /^(\d{14})/;
	var CPFPat = /^(\d{3}).(\d{3}).(\d{3})-(\d{2})/;
	var CPFPat2 = /^(\d{11})/;
	
	var matchCGCArray = StrData.match(CGCPat);
	var matchCGCArray2 = StrData.match(CGCPat2);
	var matchCPFArray = StrData.match(CPFPat);
	var matchCPFArray2 = StrData.match(CPFPat2);
	 if(     StrData == "000.000.000-00" || 
 			 StrData == "111.111.111-11" || 
 			 StrData == "222.222.222-22" || 
 			 StrData == "333.333.333-33" || 
 			 StrData == "444.444.444-44" || 
 			 StrData == "555.555.555-55" || 
 			 StrData == "666.666.666-66" || 
 			 StrData == "777.777.777-77" || 
 			 StrData == "888.888.888-88" || 
 			 StrData == "999.999.999-99") {
 							
 		alert('Vc deve fornecer um CPF valido');
		document.all.f.cpf.value='';
		return false;
 	}else if (matchCGCArray == null && matchCGCArray2 == null && matchCPFArray == null && matchCPFArray2 == null) {
		cpfalert = 'O número do CPF deve ser informado incluindo-se os dois dígitos verificadores. Não são necessários zeros à esquerda.\nExemplo:000.000.000-00 ou 00000000000\n\n';
		//cgcalert = 'O número do CGC deve ser informado incluindo-se os 14 dígitos.Não são necessários zeros à esquerda.\nExemplo: 00.000.000\/0000-00 ou 00000000000000';
		
		alert('Vc deve fornecer um CPF valido\n\n' + cpfalert + cgcalert);
		document.all.f.cpf.value='';
		return false;
	} else if (matchCGCArray != null) {
		StrData = matchCGCArray[1] + matchCGCArray[2] + matchCGCArray[3] +
		matchCGCArray[4] + matchCGCArray[5] ;
		return check_cgc(StrData);
	} else if(matchCGCArray2 != null) {
		StrData = matchCGCArray2[1];
		return check_cgc(StrData);
	} else if(matchCPFArray != null) {
		StrData = matchCPFArray[1] + matchCPFArray[2] + matchCPFArray[3] +
		matchCPFArray[4];
		return check_cpf(StrData);
	} else if(matchCPFArray2 != null) {
		StrData = matchCPFArray2[1];
		return check_cpf(StrData);
	}
	return true;
}		

function validar_campos_cadastro(){
	   //campo nome
	   if(!document.all.f.nome.value){
	     alert('preencha o campo nome');
		 document.all.f.nome.focus();
		 return false;
	   }
	   //campo email
	   if(!document.all.f.email.value){
	     alert('preencha o campo email');
		 document.all.f.email.focus();
		 return false;
	   }
	   //validar campo email
	   if(document.all.f.email.value.indexOf('@') == -1 || document.all.f.email.value.indexOf('.') == -1 ) {
	     alert('campo email invalido');
		 document.all.f.email.focus();
		 return false;
	   }
	   //campo telefone
	   if(!document.all.f.telefone.value){
	     alert('preencha o campo telefone');
		 document.all.f.telefone.focus();
		 return false;
	   }
	   //campo endereco
	   if(!document.all.f.area_atuacao.value){
	     alert('preencha o campo endereco');
		 document.all.f.area_atuacao.focus();
		 return false;
	   }
	   //campo curso

	return true;	
	}
	
	function validar_campos_cadastro_empresa(){
	   //campo empresa
	   if(!document.all.f2.empresa.value){
	     alert('Preencha o campo empresa!');
		 document.all.f2.empresa.focus();
		 return false;
	   }
	   //campo cnpj
	   if(!document.all.f2.cnpj.value){
	     alert('Preencha o campo cnpj!');
		 document.all.f2.cnpj.focus();
		 return false;
	   }
	   	   //campo responsavel
	   if(!document.all.f2.responsavel.value){
	     alert('Preencha o campo pessoa responsável!');
		 document.all.f2.responsavel.focus();
		 return false;
	   }
	   //campo cargo
	   if(!document.all.f2.cargo.value){
	     alert('Preencha o campo cargo!');
		 document.all.f2.cargo.focus();
		 return false;
	   }	
	   //campo telefone
	   if(!document.all.f.telefone.value){
	     alert('Preencha o campo telefone!');
		 document.all.f.telefone.focus();
		 return false;
	   }	   
	   //validar campo email
	   if(document.all.f.email.value.indexOf('@') == -1 || document.all.f.email.value.indexOf('.') == -1 ) {
	     alert('Campo email invalido!');
		 document.all.f.email.focus();
		 return false;
	   }

	return true;	
	}
	
function mascaraTelDDD(objeto){
	if(objeto.value.length == 2){
		vl = objeto.value;
	   objeto.value = '('+vl+') ';
	}
	if(objeto.value.length == 9){
		vl = objeto.value;
	   objeto.value = vl+'-';
	}
}

function abre_janela(janela){
	w = window.open(janela,'vaga','width=500,heigth=600,resizable=yes,scrollbars=yes');
	w.focus();
	
	}

