<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
var obj = MM_findObj('objName');
if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
if (theValue == true || theValue == false)
eval("obj."+theProp+"="+theValue);
else eval("obj."+theProp+"='"+theValue+"'");
}
}
//-->


function janela(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function txtBoxFormat(objeto, sMask, evtKeyPress) {
    var i, nCount, sValue, fldLen, mskLen,bolMask, sCod, nTecla;


if(document.all) { // Internet Explorer
    nTecla = evtKeyPress.keyCode;
} else if(document.layers) { // Nestcape
    nTecla = evtKeyPress.which;
} else {
    nTecla = evtKeyPress.which;
    //alert(nTecla);
    if (nTecla == 8 || nTecla == 0) {
        return true;
    }
}

    sValue = objeto.value;

    // Limpa todos os caracteres de formatação que
    // já estiverem no campo.
    sValue = sValue.toString().replace( "-", "" );
    sValue = sValue.toString().replace( "-", "" );
    sValue = sValue.toString().replace( ".", "" );
	sValue = sValue.toString().replace( ",", "" );
    sValue = sValue.toString().replace( ".", "" );
    sValue = sValue.toString().replace( "/", "" );
    sValue = sValue.toString().replace( "/", "" );
    sValue = sValue.toString().replace( ":", "" );
    sValue = sValue.toString().replace( ":", "" );
    sValue = sValue.toString().replace( "(", "" );
    sValue = sValue.toString().replace( "(", "" );
    sValue = sValue.toString().replace( ")", "" );
    sValue = sValue.toString().replace( ")", "" );
    sValue = sValue.toString().replace( " ", "" );
    sValue = sValue.toString().replace( " ", "" );
    fldLen = sValue.length;
    mskLen = sMask.length;

    i = 0;
    nCount = 0;
    sCod = "";
    mskLen = fldLen;

    while (i <= mskLen) {
      bolMask = ((sMask.charAt(i) == "-") || (sMask.charAt(i) == ".") || (sMask.charAt(i) == "/") || (sMask.charAt(i) == ":"))
      bolMask = bolMask || ((sMask.charAt(i) == "(") || (sMask.charAt(i) == ")") || (sMask.charAt(i) == " "))

      if (bolMask) {
        sCod += sMask.charAt(i);
        mskLen++; }
      else {
        sCod += sValue.charAt(nCount);
        nCount++;
      }

      i++;
    }

    objeto.value = sCod;

    if (nTecla != 8) { // backspace
      if (sMask.charAt(i-1) == "9") { // apenas números...
        return ((nTecla > 47) && (nTecla < 58)); }
      else { // qualquer caracter...
        return true;
      }
    }
    else {
      return true;
    }
}
function valida_campos() {
	
	var botao_submit = document.getElementById('botao_submit');
	botao_submit.disabled = true;
	
	str="";
	valido=true;
	cor="#FF8F3E";
	
	if(document.form1.area_atuacao.value=="") {
		str+="\n- O campo Área de Atuação é obrigatório";
		document.form1.area_atuacao.style.backgroundColor=cor;
		valido=false;
	}								
	
	if(document.form1.candidado_funcao.value.length<3) {
		str+="\n- O campo Cargo de seu interesse é obrigatório";
		document.form1.candidado_funcao.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.nome.value.length<1) {
		str+="\n- O campo Nome é obrigatório";
		document.form1.nome.style.backgroundColor=cor;
		valido=false;
	}
	
	var dia = (document.form1.data_nascimento.value.substr(0,2));
	var mes = (document.form1.data_nascimento.value.substr(3,2));
	var ano = (document.form1.data_nascimento.value.substr(6,4));
	
	if(document.form1.data_nascimento.value.length<10) {
		str+="\n- Preencha o campo Data de Nascimento corretamente. Formato: dd/mm/aaaa";
		document.form1.data_nascimento.style.backgroundColor=cor;
		valido=false;
		}else if(dia < 1 || dia >31){
			str+="\n- Dia inválido no campo Data de Nascimento!";
			str+="\n- Preencha o campo Data de Nascimento corretamente. Formato: dd/mm/aaaa";
			document.form1.data_nascimento.style.backgroundColor=cor;
			valido=false;
			}else if(mes < 1 || mes >12){
				str+="\n- Mês inválido no campo Data de Nascimento!";
				str+="\n- Preencha o campo Data de Nascimento corretamente. Formato: dd/mm/aaaa";
				document.form1.data_nascimento.style.backgroundColor=cor;
				valido=false;
				}else if(ano < 1900){
					str+="\n- Ano inválido no campo Data de Nascimento";
					str+="\n- Preencha o campo Data de Nascimento corretamente. Formato: dd/mm/aaaa";
					document.form1.data_nascimento.style.backgroundColor=cor;
					valido=false;
	}
	
	
	if (!(document.form1.sexo[0].checked || document.form1.sexo[1].checked)){
		str+="\n- O campo Sexo é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;								
	}
	
	if(document.form1.estado_civil.value=="") {
		str+="\n- O campo Estado Civil é obrigatório";
		document.form1.estado_civil.style.backgroundColor=cor;
		valido=false;
	}

	if(document.form1.altura.value.length<4) {
		str+="\n- O campo Altura é obrigatório";
		document.form1.altura.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.peso.value.length<1) {
		str+="\n- O campo Peso é obrigatório";
		document.form1.peso.style.backgroundColor=cor;
		valido=false;
	}
	
	/*if(document.form1.telefone_residencial.value.length<13) {
		str+="\n- O campo Telefone Residencial é obrigatório";
		document.form1.telefone_residencial.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.telefone_comercial.value.length<13) {
		str+="\n- O campo Telefone Comercial é obrigatório";
		document.form1.telefone_comercial.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.telefone_celular.value.length<13) {
		str+="\n- O campo Telefone Celular é obrigatório";
		document.form1.telefone_celular.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.telefone_recado.value.length<13) {
		str+="\n- O campo Telefone de Recado é obrigatório";
		document.form1.telefone_recado.style.backgroundColor=cor;
		valido=false;
	}*/
	
	if(document.form1.email.value.length>0){
		if(! ValidarEmail(document.form1.email.value)){
			str+="\n- O campo E-mail é inválido";
			document.form1.email.style.backgroundColor=cor;
			valido=false;
		}
	}
	
	if (!(document.form1.nacionalidade[0].checked || document.form1.nacionalidade[1].checked)){
		str+="\n- O campo Nacionalidade é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;								
	}
	
	if(document.form1.naturalidade.value.length<1) {
		str+="\n- O campo Naturalidade é obrigatório";
		document.form1.naturalidade.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.endereco_rua.value.length<1) {
		str+="\n- O campo Endereço Logradouro é obrigatório";
		document.form1.endereco_rua.style.backgroundColor=cor;
		valido=false;
	}

	if(document.form1.endereco_numero.value.length<1) {
		str+="\n- O campo Endereço Número é obrigatório";
		document.form1.endereco_numero.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.endereco_bairro.value.length<1) {
		str+="\n- O campo Endereço Bairro é obrigatório";
		document.form1.endereco_bairro.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.endereco_cep.value.length<9) {
		str+="\n- O campo Endereço CEP é obrigatório";
		document.form1.endereco_cep.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.endereco_estado.value=="") {
		str+="\n- O campo Endereço Estado é obrigatório";
		document.form1.endereco_estado.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.endereco_cidade.value=="") {
		str+="\n- O campo Endereço Cidade é obrigatório";
		document.form1.endereco_cidade.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.ci.value.length<3) {
		str+="\n- O campo RG é obrigatório";
		document.form1.ci.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.ci_orgao.value.length<2) {
		str+="\n- O campo RG Orgão Emissor é obrigatório";
		document.form1.ci_orgao.style.backgroundColor=cor;
		valido=false;
	}
	
	if(document.form1.ci_estado.value=="") {
		str+="\n- O campo RG Estado Emissor é obrigatório";
		document.form1.ci_estado.style.backgroundColor=cor;
		valido=false;
	}
	
	if (!(document.form1.habilitacao[0].checked || document.form1.habilitacao[1].checked)){
		str+="\n- O campo Habilitação é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;
	}else if(document.form1.habilitacao[0].checked){
		if(document.form1.habilitacao_estado.value=="") {
			str+="\n- O campo Habilitação Estado Emissor é obrigatório";
			document.form1.habilitacao_estado.style.backgroundColor=cor;
			valido=false;
		}
		
		if(document.form1.habilitacao_categoria.value.length<1) {
			str+="\n- O campo Habilitação Categoria é obrigatório";
			document.form1.habilitacao_categoria.style.backgroundColor=cor;
			valido=false;
		}
		
		var dia = (document.form1.habilitacao_data.value.substr(0,2));
		var mes = (document.form1.habilitacao_data.value.substr(3,2));
		var ano = (document.form1.habilitacao_data.value.substr(6,4));
		
		if(document.form1.habilitacao_data.value.length<10) {
			str+="\n- Preencha o campo Habilitação Data de Emissão corretamente, formato: dd/mm/aaaa";
			document.form1.habilitacao_data.style.backgroundColor=cor;
			valido=false;
			}else if(dia < 1 || dia >31){
				str+="\n- Preencha o campo Habilitação Data de Emissão corretamente. Formato: dd/mm/aaaa";
				document.form1.habilitacao_data.style.backgroundColor=cor;
				valido=false;
				}else if(mes < 1 || mes >12){
					str+="\n- Preencha o campo Habilitação Data de Emissão corretamente. Formato: dd/mm/aaaa";
					document.form1.habilitacao_data.style.backgroundColor=cor;
					valido=false;
					}else if(ano < 1900){
						str+="\n- Preencha o campo Habilitação Data de Emissão corretamente. Formato: dd/mm/aaaa";
						document.form1.habilitacao_data.style.backgroundColor=cor;
						valido=false;		
		}		
	}
	
	if (!(document.form1.portador_necessidade[0].checked || document.form1.portador_necessidade[1].checked)){
		str+="\n- O campo É portador de necessidades especiais? é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;								
	}
	
	if (!(document.form1.trab_sada[0].checked || document.form1.trab_sada[1].checked)){
		str+="\n- O campo Já trabalhou na Sada? é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;								
	}

	if (!(document.form1.trab_fiat[0].checked || document.form1.trab_fiat[1].checked)){
		str+="\n- O campo Já trabalhou na Fiat? é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;								
	}
	
	if (!(document.form1.trab_parente_sada[0].checked || document.form1.trab_parente_sada[1].checked)){
		str+="\n- O campo Tem parentes na SADA? é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;								
	}
	
	if (!(document.form1.trab_indicado[0].checked || document.form1.trab_indicado[1].checked)){
		str+="\n- O campo É indicação é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;								
		}else if (document.form1.trab_indicado[0].checked){
			if(document.form1.trab_nome_indicou.value.length<3) {
				str+="\n- O campo Nome de quem indicou é obrigatório";
				document.form1.trab_nome_indicou.style.backgroundColor=cor;
				valido=false;
			}									
			
	}
	
	if (!(document.form1.disposicao_viagem[0].checked || document.form1.disposicao_viagem[1].checked)){
		str+="\n- O campo Disponibilidade para viagens é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;								
	}
	
	if (!(document.form1.fumante[0].checked || document.form1.fumante[1].checked)){
		str+="\n- O campo Fumante é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;								
	}
	
	if(document.form1.escolaridade.value=="") {
		str+="\n- O campo Escolaridade é obrigatório";
		document.form1.escolaridade.style.backgroundColor=cor;
		valido=false;
		/*}else if(document.form1.graduacao.value.length>0){
			if(document.form1.graduacao_instituicao.length<1) {
				str+="\n- O campo Instituição é obrigatório";
				document.form1.graduacao_instituicao.style.backgroundColor=cor;
				valido=false;
			}
			}else if(document.form1.pos_graduacao.value.length>0){
				if(document.form1.pos_graduacao_instituicao.length<1) {
					str+="\n- O campo Instituição é obrigatório";
					document.form1.pos_graduacao_instituicao.style.backgroundColor=cor;
					valido=false;
				}*/
	}	
	
	if(document.form1.idiomas_outros.checked) {
		if(document.form1.idiomas_outros_descricao.value=="") {
			str+="\n- O campo Outros é obrigatório";
			document.form1.idiomas_outros_descricao.style.backgroundColor=cor;
			valido=false;
		}
	}
	
	
	if (!(document.form1.trabalha_atualmente[0].checked || document.form1.trabalha_atualmente[1].checked)){
		str+="\n- O campo Trabalha atualmente? é obrigatório";
		//document.form1.portador_necessidade.style.backgroundColor=cor;
		valido=false;								
	}								
	
	if(document.form1.pretencao_salarial.value=="") {
		str+="\n- O campo Pretenção salarial é obrigatório";
		document.form1.pretencao_salarial.style.backgroundColor=cor;
		valido=false;
	}
	
	/*if(document.form1.comentario.value=="") {
		str+="\n- O campo Comentário a cargo do RH é obrigatório";
		document.form1.comentario.style.backgroundColor=cor;
		valido=false;
	}

	var dia = parseInt(document.form1.data_ultima_atualizacao.value.substr(0,2));
	var mes = parseInt(document.form1.data_ultima_atualizacao.value.substr(3,2));
	var ano = parseInt(document.form1.data_ultima_atualizacao.value.substr(6,4));
	
	
	if(document.form1.data_ultima_atualizacao.value=="") {
		str+="\n- Preencha o campo Data da última atualização corretamente, formato: dd/mm/aaaa";
		document.form1.data_ultima_atualizacao.style.backgroundColor=cor;
		valido=false;
		}else if(dia < 1 || dia >31){
			str+="\n- Preencha o campo Data da última atualização corretamente. Formato: dd/mm/aaaa";
			document.form1.data_ultima_atualizacao.style.backgroundColor=cor;
			valido=false;
			}else if(mes < 1 || mes >12){
				str+="\n- Preencha o campo Data da última atualização corretamente. Formato: dd/mm/aaaa";
				document.form1.data_ultima_atualizacao.style.backgroundColor=cor;
				valido=false;
				}else if(ano < 1900){
					str+="\n- Preencha o campo Data da última atualização corretamente. Formato: dd/mm/aaaa";
					document.form1.data_ultima_atualizacao.style.backgroundColor=cor;
					valido=false;		
	}*/
	
	if (!ValidarCPF(document.form1.cpf.value)) {
	str+="\n- CPF inválido";
		document.form1.cpf.style.backgroundColor=cor;
		valido=false;
	}
	
	if(!valido){
			alert("Os seguintes erros foram encontrados:\n"+str);
			botao_submit.disabled = false;
			//return valido;
			}else{
				GeraTxt();
				botao_submit.disabled = false;
				//return valido;		
		}
	
}

function ValidarCPF(cpf){
	var nu_cpf = document.form1.cpf.value;
	if (nu_cpf == null) {
		return false;
	}
	if (nu_cpf.length != 11)
	{
		str+="\n- CPF deve conter 11 caracteres";
		document.form1.cpf.style.backgroundColor=cor;
		valido=false;
	}
		for (i=0;i<nu_cpf.length;i++) {
				if (!((nu_cpf.substring(i,i+1) >= '0') && (nu_cpf.substring(i,i+1) <= '9'))) {
						
				//window.alert("CPF inválido!");
				//document.form1.cpf.focus();
				//document.form1.cpf.select();
				return false;
				}
	}
	nu_cpf_dv=nu_cpf.substring(9,11);
	nu_cpf = nu_cpf.substring(0,9);
	for (k=1;k<3;k++) {
		soma = 0;
		multi = 1;
			for (i=nu_cpf.length-1;i>=0;i--) {
				multi++;
				soma += (parseInt(nu_cpf.substring(i,i+1),10) * multi);
			}
		resto = (soma % 11);
		dv =0;
	if (resto > 1) {
	dv= 11 - resto;
	}
	nu_cpf +=dv;
	}
	return (nu_cpf_dv == nu_cpf.substring(9,11));
}
function ValidarEmail(mail){
    var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
    if(typeof(mail) == "string"){
        if(er.test(mail)){ return true; }
    }else if(typeof(mail) == "object"){
        if(er.test(mail.value)){
                    return true;
                }
    }else{
        return false;
        }
}


function getAjax(){
	
	var Ajax = null;
	
	// Trata as exceções até conseguir cria o objeto ajax
	
	try{
		// Tenta criar objeto ajax para os browsers mais recentes como Firefox, e Opera
		ajax = new XMLHttpRequest(); // ajax p firefox opera e navegadores recentes
		}catch(ee){
		
		try{
			// Tenta criar ajax para algumas versões do Microsoft Internet Explorer
			ajax = new ActiveXObject("Msxml2.XMLHTTP"); // IE
		}catch(e){
		
			try{
				// Tenta criar ajax para algumas versões do Microsoft Internet Explorer
				ajax = new ActiveXObject("Microsoft.XMLHTTP"); // IE
		
			}catch(E){
				// Browser utilizado não aceita ajax, o objeto não é criado
				ajax = false;
			}
		}
			
	}
	
	return ajax;
}

function GeraTxt(){
	
	var sexo_tmp;
	var nacionalidade_tmp;
	var habilitacao_tmp;
	var portador_necessidade_tmp;
	
	var trab_sada_tmp;
	var trab_fiat_tmp;
	var trab_parente_sada_tmp;
	var trab_indicado_tmp;
	var disposicao_viagem_tmp;
	var fumante_tmp;
	
	var trabalha_atualmente_tmp;
	
	if(document.form1.sexo[0].checked){sexo_tmp = "M";}else{sexo_tmp = "F";}
	if(document.form1.nacionalidade[0].checked){nacionalidade_tmp = "BRASILEIRA";}else{nacionalidade_tmp = "ESTRANGEIRA";}
	if(document.form1.habilitacao[0].checked){habilitacao_tmp = "S";}else{habilitacao_tmp = "N";}
	if(document.form1.portador_necessidade[0].checked){portador_necessidade_tmp = "S";}else{portador_necessidade_tmp = "N";}
	
	if(document.form1.trab_sada[0].checked){trab_sada_tmp = "S";}else{trab_sada_tmp = "N";}
	if(document.form1.trab_fiat[0].checked){trab_fiat_tmp = "S";}else{trab_fiat_tmp = "N";}
	if(document.form1.trab_parente_sada[0].checked){trab_parente_sada_tmp = "S";}else{trab_parente_sada_tmp = "N";}
	if(document.form1.trab_indicado[0].checked){trab_indicado_tmp = "S";}else{trab_indicado_tmp = "N";}
	if(document.form1.disposicao_viagem[0].checked){disposicao_viagem_tmp = "S";}else{disposicao_viagem_tmp = "N";}
	if(document.form1.fumante[0].checked){fumante_tmp = "S";}else{fumante_tmp = "N";}
	
	if(document.form1.trabalha_atualmente[0].checked){trabalha_atualmente_tmp = "S";}else{trabalha_atualmente_tmp = "N";}
	
	
	campos = ""+
	"ci="+document.getElementById('ci').value+
	"&ci_orgao="+document.getElementById('ci_orgao').value+
	"&ci_estado="+document.getElementById('ci_estado').value+
	"&cpf="+document.getElementById('cpf').value+
	"&nome="+document.getElementById('nome').value+
	"&sexo="+sexo_tmp+
	"&data_nascimento="+document.getElementById('data_nascimento').value+
	"&altura="+document.getElementById('altura').value+
	"&peso="+document.getElementById('peso').value+
	"&estado_civil="+document.getElementById('estado_civil').value+
	"&nacionalidade="+nacionalidade_tmp+
	"&naturalidade="+document.getElementById('naturalidade').value+
	"&endereco_rua="+document.getElementById('endereco_rua').value+
	"&endereco_numero="+document.getElementById('endereco_numero').value+
	"&endereco_complemento="+document.getElementById('endereco_complemento').value+
	"&endereco_bairro="+document.getElementById('endereco_bairro').value+
	"&endereco_cep="+document.getElementById('endereco_cep').value+
	"&endereco_cidade="+document.getElementById('endereco_cidade').value+
	"&endereco_estado="+document.getElementById('endereco_estado').value+
	"&telefone_residencial="+document.getElementById('telefone_residencial').value+
	"&telefone_comercial="+document.getElementById('telefone_comercial').value+
	"&telefone_celular="+document.getElementById('telefone_celular').value+
	"&telefone_recado="+document.getElementById('telefone_recado').value+
	"&email="+document.getElementById('email').value+
	"&habilitacao="+habilitacao_tmp+
	"&habilitacao_estado="+document.getElementById('habilitacao_estado').value+
	"&habilitacao_categoria="+document.getElementById('habilitacao_categoria').value+
	"&habilitacao_data="+document.getElementById('habilitacao_data').value+
	"&portador_necessidade="+portador_necessidade_tmp+
	"&trab_sada="+trab_sada_tmp+
	"&trab_fiat="+trab_fiat_tmp+
	"&trab_parente_sada="+trab_parente_sada_tmp+
	"&trab_indicado="+trab_indicado_tmp+
	"&trab_nome_indicou="+document.getElementById('trab_nome_indicou').value+
	"&disposicao_viagem="+disposicao_viagem_tmp+
	"&fumante="+fumante_tmp+
	"&escolaridade="+document.getElementById('escolaridade').value+
	"&idiomas_ingles="+document.getElementById('idiomas_ingles').checked+
	"&idiomas_espanhol="+document.getElementById('idiomas_espanhol').checked+
	"&idiomas_frances="+document.getElementById('idiomas_frances').checked+
	"&idiomas_outros="+document.getElementById('idiomas_outros').checked+
	"&idiomas_outros_descricao="+document.getElementById('idiomas_outros_descricao').value+
	"&informatica_word="+document.getElementById('informatica_word').checked+
	"&informatica_excel="+document.getElementById('informatica_excel').checked+
	"&informatica_access="+document.getElementById('informatica_access').checked+
	"&informatica_powerpoint="+document.getElementById('informatica_powerpoint').checked+
	"&informatica_coreldraw="+document.getElementById('informatica_coreldraw').checked+
	"&informatica_cad="+document.getElementById('informatica_cad').checked+
	"&informatica_visualbasic="+document.getElementById('informatica_visualbasic').checked+
	"&informatica_rede="+document.getElementById('informatica_rede').checked+
	"&informatica_linux="+document.getElementById('informatica_linux').checked+
	"&curso_1="+document.getElementById('curso_1').value+
	"&curso_1_escola="+document.getElementById('curso_1_escola').value+
	"&curso_1_periodo_i="+document.getElementById('curso_1_periodo_i').value+
	"&curso_1_periodo_f="+document.getElementById('curso_1_periodo_f').value+
	"&curso_2="+document.getElementById('curso_2').value+
	"&curso_2_escola="+document.getElementById('curso_2_escola').value+
	"&curso_2_periodo_i="+document.getElementById('curso_2_periodo_i').value+
	"&curso_2_periodo_f="+document.getElementById('curso_2_periodo_f').value+
	"&curso_3="+document.getElementById('curso_3').value+
	"&curso_3_escola="+document.getElementById('curso_3_escola').value+
	"&curso_3_periodo_i="+document.getElementById('curso_3_periodo_i').value+
	"&curso_3_periodo_f="+document.getElementById('curso_3_periodo_f').value+
	"&area_atuacao="+document.getElementById('area_atuacao').value+
	"&candidado_funcao="+document.getElementById('candidado_funcao').value+
	"&empresa_1="+document.getElementById('empresa_1').value+
	"&empresa_1_cargo="+document.getElementById('empresa_1_cargo').value+
	"&empresa_1_periodo_i="+document.getElementById('empresa_1_periodo_i').value+
	"&empresa_1_periodo_f="+document.getElementById('empresa_1_periodo_f').value+
	"&empresa_1_atividades="+document.getElementById('empresa_1_atividades').value+
	"&empresa_1_motivo_saida="+document.getElementById('empresa_1_motivo_saida').value+
	"&empresa_2="+document.getElementById('empresa_2').value+
	"&empresa_2_cargo="+document.getElementById('empresa_2_cargo').value+
	"&empresa_2_periodo_i="+document.getElementById('empresa_2_periodo_i').value+
	"&empresa_2_periodo_f="+document.getElementById('empresa_2_periodo_f').value+
	"&empresa_2_atividades="+document.getElementById('empresa_2_atividades').value+
	"&empresa_2_motivo_saida="+document.getElementById('empresa_2_motivo_saida').value+
	"&empresa_3="+document.getElementById('empresa_3').value+
	"&empresa_3_cargo="+document.getElementById('empresa_3_cargo').value+
	"&empresa_3_periodo_i="+document.getElementById('empresa_3_periodo_i').value+
	"&empresa_3_periodo_f="+document.getElementById('empresa_3_periodo_f').value+
	"&empresa_3_atividades="+document.getElementById('empresa_3_atividades').value+
	"&empresa_3_motivo_saida="+document.getElementById('empresa_3_motivo_saida').value+
	"&trabalha_atualmente="+trabalha_atualmente_tmp+
	"&pretencao_salarial="+document.getElementById('pretencao_salarial').value+
	"&graduacao="+document.getElementById('graduacao').value+
	"&graduacao_instituicao="+document.getElementById('graduacao_instituicao').value+
	"&graduacao_periodo_i="+document.getElementById('graduacao_periodo_i').value+
	"&graduacao_periodo_f="+document.getElementById('graduacao_periodo_f').value+
	"&pos_graduacao="+document.getElementById('pos_graduacao').value+
	"&pos_graduacao_instituicao="+document.getElementById('pos_graduacao_instituicao').value+
	"&pos_graduacao_periodo_i="+document.getElementById('pos_graduacao_periodo_i').value+
	"&pos_graduacao_periodo_f="+document.getElementById('pos_graduacao_periodo_f').value;
	
	
	AjaxCarreira = getAjax();
	if (AjaxCarreira != null) {
		AjaxCarreira.open("POST", "txt_carreira.php", true);
		AjaxCarreira.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		AjaxCarreira.setRequestHeader("Content-length", campos.length);
		AjaxCarreira.setRequestHeader("Connection", "close");			
		AjaxCarreira.send(campos);
		AjaxCarreira.onreadystatechange = function(){
			if (AjaxCarreira.readyState == 4 ){
				if (AjaxCarreira.responseText == 'ok'){
					alert('Currículo enviado com êxito');
					}else{
						alert('Não foi possível salvar o currículo, contacte o administrador.');
				}
			}
		}
	}
}

function BuscaCidadesXML(id){
	
	var carregando = document.getElementById('div_carregando');
	var cidade = document.getElementById('div_cidade');
	carregando.style.display='block';
	cidade.style.display='none';
	campos = ""+"estado="+document.getElementById('endereco_estado').value;
	
	
	
	AjaxCidades = getAjax();
	if (AjaxCidades != null) {
		AjaxCidades.open("GET", "xml/cidade.php?"+campos, true);
		
		
		
		/*AjaxCidades.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		AjaxCidades.setRequestHeader("Content-length", campos.length);
		AjaxCidades.setRequestHeader("Connection", "close");	*/		
		AjaxCidades.send(null);
		AjaxCidades.onreadystatechange = function(){
			if (AjaxCidades.readyState == 4 ){
				if (AjaxCidades.responseXML){
					processXMLCidade(AjaxCidades.responseXML);
					carregando.style.display='none';
					cidade.style.display='block';
					}else{
						alert('Não foi possível carregar as cidades, contacte o administrador.');
				}
			}
		}
	}
}

function processXMLCidade(obj){

  	ApagaOptions('endereco_cidade');
  	selectbox = document.getElementById('endereco_cidade');
  	var dataArray   = obj.getElementsByTagName("cidade");
  	if(dataArray.length > 0) {
     	//percorre o arquivo XML para extrair os dados
     	for(var i = 0 ; i < dataArray.length ; i++) {
        	var item = dataArray[i];
			//contéudo dos campos no arquivo XML
			var id 		=  item.getElementsByTagName("id")[0].firstChild.nodeValue;
			var cidade 	=  item.getElementsByTagName("nome")[0].firstChild.nodeValue;
			
			var novo = document.createElement("option");
	    	//atribui um ID a esse elemento
	    	novo.setAttribute("id", "cidades");
			//atribui um valor
	    	novo.value = id;
			//atribui um texto
	    	novo.text  = cidade;
			//finalmente adiciona o novo elemento
			selectbox.options.add(novo);
	 	}
  	}  	
 }

function ApagaOptions(select){
	var selectbox = document.getElementById(select);
	for(i=selectbox.options.length-1;i>=1;i--){
		//if(selectbox.options[i].selected)
		selectbox.remove(i);
	} 	
}

function mostra_div(show){
	var el1 = document.getElementById(show);
	if (el1.style.display == 'none'){
		el1.style.display = 'block';
		}else{
			el1.style.display = 'none';
	}
}

function mostra_div2(show){
	var el1 = document.getElementById(show);
	el1.style.display = 'block';
}

function esconde_div(show){
	var el1 = document.getElementById(show);
	el1.style.display = 'none';
}