var janelaCur;
var openVar = 0;
function url_decode(str) {
	 var n, strCode, strDecode = "";

	 for (n = 0; n < str.length; n++) {
		  if (str.charAt(n) == "%") {
			   strCode = str.charAt(n + 1) + str.charAt(n + 2);
			   strDecode += String.fromCharCode(parseInt(strCode, 16));
			   n += 2;
		  } else if (str.charAt(n) == "+") {
			   strCode = str.charAt(n);
			   strDecode += " ";
		  } else {
			   strDecode += str.charAt(n);
		  }
	 }
	 return strDecode;
}

function url_encode(str) {
	 var hex_chars = "0123456789ABCDEF";
	 var noEncode = /^([a-zA-Z0-9\_\-\.])$/;
	 var n, strCode, hex1, hex2, strEncode = "";

	 for(n = 0; n < str.length; n++){
		  if (noEncode.test(str.charAt(n))){
			   strEncode += str.charAt(n);
		  }
		  else{
			   strCode = str.charCodeAt(n);
			   hex1 = hex_chars.charAt(Math.floor(strCode / 16));
			   hex2 = hex_chars.charAt(strCode % 16);
			   strEncode += "%" + (hex1 + hex2);
		  }
	 }
	 return strEncode;
}

function ajax(){
	 try{
		  xmlhttp = new XMLHttpRequest();
	 }
	 catch(ee){
		  try{
			   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		  }
		  catch(e){
			   try{
				    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			   }
			   catch(E){
				    xmlhttp = false;
			   }
		  }
	 }
	 return xmlhttp;
}


function showModal(urlArg, widthArg, heightArg, titleArg, scrollBarArg, showCloseArg) {
	this.scroll(1,-1000);
	var dmp = document.getElementById('divModalPanel');
	var divModalBorder = document.getElementById('divModalBorder');

	var dm = document.getElementById('divBackground');

	// default is true
	if (scrollBarArg == null || scrollBarArg == undefined) {
		scrollBarArg = true;
	}
	if (scrollBarArg) {
		document.getElementById('divModalPanelFrame').setAttribute('scrolling','auto');
		document.getElementById('divModalPanelFrame').scrolling='auto';
	} else {
		document.getElementById('divModalPanelFrame').setAttribute('scrolling','no');
		document.getElementById('divModalPanelFrame').scrolling='no';
	}

	document.getElementById('divModalTitle').innerHTML = titleArg;

	document.getElementById('divModalPanelFrame').src = urlArg;
	document.getElementById('divModalPanelFrame').width = widthArg;
	document.getElementById('divModalPanelFrame').height = heightArg;
	divModalBorder.width = widthArg;
	divModalBorder.height = heightArg;
	
	if (showCloseArg == null && showCloseArg == undefined) {
		showCloseArg = true;
	}

	if (showCloseArg) {
		document.getElementById('closeModalEvent').style.display = '';
	} else {
		document.getElementById('closeModalEvent').style.display = 'none';
	}

	dm.style.display='';
	dmp.style.display='';

	var altTela = Math.floor(document.body.offsetHeight);
	var largTela =  Math.floor(document.body.offsetWidth);
	var largDiv = Math.floor(divModalBorder.offsetWidth);
	var altDiv = Math.floor(divModalBorder.offsetHeight);

	dm.style.width=largTela+'px';
	dm.style.height=altTela+'px';

	
	dmp.style.left=((largTela/2)-(largDiv/2))+'px';
	dmp.style.top='90px';

}

function closeModal(timeArg) {
	if (timeArg != undefined && timeArg != null && timeArg > 0) {
		window.setTimeout(function() {
			closeModal();
		}, timeArg*1000);
	} else {
		document.getElementById('divModalPanel').style.display='none';
		document.getElementById('divBackground').style.display='none';
		document.getElementById('divModalTitle').innerHTML = '';
		document.getElementById('divModalPanelFrame').src = '';
	}
}

function openPopup(url, widthArg, heightArg) {
	janelaCur = window.open(url, 'myPopup', 'width='+widthArg+',height='+heightArg+',scrollbars=yes,top=50,left=180');
}

function showHelp() {
	window.open('/help/', 'myPopup', 'width=765,height=480,scrollbars=1,top=50,left=0,status=1,resizable=1');
}

function showMessageBox() {
	if(usr_msg_pop = window.open('/gen/messages/', 'usr_msg_pop', 'width=765,height=480,scrollbars=0,top=50,left=0,status=1,resizable=1'))
		usr_msg_pop.focus();
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}

function rTrim(str){
	var espaco = String.fromCharCode(32);
	var tamanho = str.length;
	var temp = "";
	if(tamanho < 0) {
		return "";
	}

	var temp2 = tamanho - 1;
	while(temp2 > -1){
		if(str.charAt(temp2) == espaco){
			// não faz nada
		}else{
			temp = str.substring(0, temp2 + 1);
			break;
		}
		temp2--;
	}
	return temp;
}

function lTrim(str){
	var espaco = String.fromCharCode(32);
	var tamanho = str.length;
	var temp = "";
	if(tamanho < 0) {
		return "";
	}

	var temp2 = 0;

	while(temp2 < tamanho){
		if(str.charAt(temp2) == espaco){
			// não faz nada
		}else{
			temp = str.substring(temp2, tamanho);
			break;
		}
		temp2++;
	}
	return temp;
}

function trim(str) {
	if(str.length < 1) {
		return "";
	}
	str = rTrim(str);
	str = lTrim(str);    

	if(str == "") {
		return "";
	} else {
		return str;
	}
}

function submitComentario(msgEnviandoArg, msgEnviarArg, msgDigiteAlgoArg, escrevaAquiArg) {
	var msgTmp = trim(document.getElementById('comentario').value);
	if (msgTmp.length > 0 && msgTmp != escrevaAquiArg) {
		document.getElementById('comentario').disabled = true;
		document.getElementById('pesquisaSubmitLabel').innerHTML = msgEnviandoArg;
		var xmlhttp = ajax();
		xmlhttp.open("GET", "/recrutador/ajaxEnviaSugestao.php?comment="+url_encode(msgTmp));
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState == 4) {
				document.getElementById('pesquisa').style.display = "none";
				document.getElementById('pesquisaObrigado').style.display = "";
				document.getElementById('comentario').disabled = false;
				document.getElementById('comentario').value = escrevaAquiArg;
				document.getElementById('comentario').setAttribute('onEdit', 'false');
				document.getElementById('pesquisaSubmitLabel').innerHTML = msgEnviarArg;
			}
		}
		xmlhttp.send(null);
	} else {
		alert(msgDigiteAlgoArg);
	}
	return(false);
}

function pesqComentarioClick(objArg) {
	if (objArg.getAttribute('onEdit') != 'true') {
		objArg.value = '';
		objArg.setAttribute('onEdit', 'true');
	}
}

function enviarMaisComentarios() {
	document.getElementById('pesquisaObrigado').style.display = "none";
	document.getElementById('pesquisa').style.display = "";
}

//seta os checkbox como selecionados ou não.
function checkAll(filter,stat){
        var arrayFields = document.getElementsByTagName('input');
        for( var i=0; i<arrayFields.length; i++ ){
                if( arrayFields[i].type == 'checkbox' && arrayFields[i].id == filter ){
                        arrayFields[i].checked = stat;
                }
        }
}

//muda classes primeiro parametro é o id do objeto, o segundo é a classes (estilo css) a ser aplicado
function setObjClass(obj,classe)
{
        var objeto = document.getElementById(obj);
        var classeAtual = objeto.getAttribute('class');
        if(!classeAtual == "")
        {
                objeto.removeAttribute('class');
        }
        objeto.setAttribute('class',classe);
        objeto.className = classe;
}

function convidaProcessoSeletivo() {

}
function convidaProcessoSeletivo(textArg) { 
        var vag_id = document.getElementById('vagSelect').value;
	showModal('/recrutador/convidar_processo.php?vag_id='+vag_id, 550, 250, textArg);
}
function slepHide(menu,flag,action,time){
	setTimeout(function(){MM_showHideLayers(menu,flag,action);},time);
}

function validaConvite(){
	if( document.getElementById('campoNome').value.length < 3 ){
		document.getElementById('nomeAlert').style.display = "";
		document.getElementById('campoNome').focus();
		return false;
	}
	var strmail = document.getElementById('campoEmail').value;
	var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
	if (!strmail.match(re)) {
		document.getElementById('emailAlert').style.display = "";
		document.getElementById('campoEmail').focus();
		return false;
	}
}

function clearAlert(field){
	if( field == 'nome' ){
		document.getElementById('nomeAlert').style.display = "none";
	}
	if( field == "email" ){
		document.getElementById('emailAlert').style.display = "none";
	}
}

function showBusca(vag_id){
	document.getElementById("menuCV").style.display="none";
	document.getElementById("cvHeader").style.display="none";
	document.getElementById('starPage').style.display = 'none';
	document.getElementById('carregando').style.display='none';
        document.getElementById('result_null').style.display='none';
        document.getElementById('pagina').style.display='none';
        document.getElementById('busca').style.display='none';
	document.getElementById('pageVantagens').style.display = 'none';
	document.getElementById('product_layer').style.display = 'none';
	document.getElementById("textTriagem").style.display='none';

	if( typeGlobal == 'vag' ){
		clickOpenMenu('meusAnunciosVagas');
	}
	else if( typeGlobal == 'cur' ){
		clickOpenMenu('gerenciadorCandidatos');
	}
	else if( typeGlobal == 'ass' ){
		clickOpenMenu('minhaAssinatura');
	}

	var tableName=document.getElementById("listing");
	var rows = tableName.getElementsByTagName("tr");
	var len = rows.length;
	for(var k=0; k<len; k++){
		if( rows[0] ){
			tableName.deleteRow(0);
		}
	}
	frameBusca.location.href = '/cur/busca/formulario.php?FROM=banco_cvs&vag_id='+vag_id;
	document.getElementById('pageBusca').style.display = '';
	frameBusca.location.href = '/cur/busca/formulario.php?FROM=banco_cvs&vag_id='+vag_id;
	this.scroll(1,-1000);
}

function showVantagens(){
	document.getElementById("menuCV").style.display="none";
        document.getElementById("cvHeader").style.display="none";
        document.getElementById('starPage').style.display = 'none';
        document.getElementById('carregando').style.display='none';
        document.getElementById('result_null').style.display='none';
        document.getElementById('pagina').style.display='none';
        document.getElementById('busca').style.display='none';
	document.getElementById('pageBusca').style.display = 'none';
	document.getElementById("textTriagem").style.display='none';

        var tableName=document.getElementById("listing");
        var rows = tableName.getElementsByTagName("tr");
        var len = rows.length;
        for(var k=0; k<len; k++){
                if( rows[0] ){
                        tableName.deleteRow(0);
                }
        }
        this.scroll(1,-1000);
        document.getElementById('pageVantagens').style.display = '';
        frameVantagens.location.href = '/cur/busca/templates/vantagem.php?FROM=banco_cvs';
}

function pagina(http_host) {
//	document.form1.style.behavior='url(#default#homepage)';
	document.setHomePage('http://www.'+http_host);
}

function abre(http_host) 	{
	window.open('http://livehelp.catho.com.br/livehelp.php?department=3','janela','width=370,height=440,resizable=no,toolbar=0,location=0,directories=0,status=no,menubar=0');
}

function showHelp2() {
	window.open('helpRecrutador.php?pagina=principal', 'help', 'width=900,height=480,scrollbars=1,top=50,left=50,status=1,resizable=1');
}

function reclama() {
	window.open("http://www3.catho.com.br/help/geral/outros_r.phtml" , "Dúvidas" , "toolbar=no,scrollbars=yes,width=750,height=520,top=10,left=10");
	if( document.getElementById('sugest') ){
		document.getElementById('sugest').style.display = 'none';
	}
}

function mailVerify(email){
	if( document.getElementById('divemail') && document.getElementById('emails') ){
		var divDead = document.getElementById('emails');
		var divSuggestDead = document.getElementById('divemail');
		divDead.removeChild(divSuggestDead);
	}
	var xmlhttp = ajax();
	if( email.indexOf('@') > 0 && email.length > 4 ){
		var emailParts = email.split("@");
		var domain = url_encode(emailParts[1]);
		xmlhttp.open("POST", "/gen/funcoesTop.php");
		xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=ISO-8859-1");
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4){
				var rightDomain = url_decode(xmlhttp.responseText);
				if( rightDomain.length > 1 ){
					var div = document.getElementById('emails');
					var divNew = document.createElement('div');
					divNew.setAttribute('id','divemail');
					div.appendChild(divNew);
					var content = "<b><a href='javascript:;' class='araz' onClick=\"addMailSugestion('"+emailParts[0]+"@"+rightDomain+"');\">"+emailParts[0]+"@"+rightDomain+"</b></a>";
					var finalContent = "<span class=araz>E-mail inválido</span><br><span class=araz>Clique na sugestão a seguir para alterá-lo:</span><br>"+content;
					document.getElementById('divemail').innerHTML=finalContent;
				}
			}
		}
		xmlhttp.send("action=email&domain="+domain);
	}
}

function saveData(){
	var nome    = document.getElementById('nomeSugest').value;
	var email   = document.getElementById('usremail').value;
	var tel     = document.getElementById('telSugest').value;
	var id      = document.getElementById('idSugest').value;
	var message = document.getElementById('messageSugest').value;
	var url     = 'http://www3.catho.com.br/recrutador/index.php';
	var xmlhttp = ajax();

	if( nome.length < 2 ){
		alert("Preencha corretamente o nome.");
		return false;
	}

	var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
	if (!email.match(re)) {
		alert("O campo de email não foi preenchido corretamente.");
		return false;
	}

	if( message.length < 10 ){
		alert("Preencha corretamente a mensagem");
		return false;
	}

	xmlhttp.open("POST", "/gen/funcoesTop.php",true);
	xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=ISO-8859-1");
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4){
			retorno = url_decode(xmlhttp.responseText);
			document.getElementById('sugestform').style.display='none';
			document.getElementById('sugestconfirm').style.display='';
		
			setTimeout(function(){document.getElementById('sugest').style.display='none';},5000);
		}
	}
	xmlhttp.send('nome='+url_encode(nome)+'&email='+url_encode(email)+'&tel='+url_encode(tel)+'&id='+url_encode(id)+'&message='+url_encode(message)+'&action=sugest&url='+url_encode(url));
}

function showSugest(){
	if( openVar == 0 ){
		document.getElementById('sugest').style.display='';
		document.getElementById('sugestform').style.display='';
		document.getElementById('sugestconfirm').style.display='none';
		openVar = 1;
	}
	else{
		document.getElementById('sugest').style.display='none';
		openVar = 0;
	}
}

function pageScroll() {
	window.scrollBy(0,3000);
}

function showAlertBoleto(){
	showModal('pop_boleto.php', 424, 253, 'Alerta de boleto', false, true);
}

function setPaid(id_boleto){
	var xmlhttp = ajax();
	xmlhttp.open("get","funcoesLocais.php?action=setPaid&id_boleto="+id_boleto,false);
	xmlhttp.send(null);
	closeModal(0);
}

function validaFormLogin(url){
        if( document.getElementById('login').value == '' ){
                alert("Preencha o campo de login.");
                return false;
        }
        if( document.getElementById('senha').value == '' ){
                alert("Preencha o campo de senha.");
                return false;
        }

        window.location="http://www3.catho.com.br/usr/login.php?login="+document.getElementById('login').value+"&senha="+document.getElementById('senha').value;
}

function validaBusca(){
        if( document.getElementById('boxbusca').value.length < 3 || document.getElementById('boxbusca').value == "Digite algo como &quot;vendedor externo&quot;" || document.getElementById('boxbusca').value == 'Digite algo como "vendedor externo"' ){
                alert("Para fazer a busca, digite o cargo desejado.");
                return false;
        }
}

function mudaBusca(tipo){
	var link;

	switch(tipo){
		case "vag":
			link = "http://www3.catho.com.br/vag/busca/search.php";
		break;
		case "cur":
			link = "http://www3.catho.com.br/cur/busca/resultado.php";
		break;
	}
	document.getElementById("formBusca").action = link;
}

function valida_form(){
        var post=true;

	var msg = "Preencha o(s) campo(s):";

	var planoPromocional = document.formulario1.planoProm.options[document.formulario1.planoProm.selectedIndex].value;
	var plano = document.formulario1.elements["usr[plano_id]"];
	var perfil = document.formulario1.elements["cur[perfil_id]"];

	if(document.formulario1.nome.value.length < 2){
		msg+="\n  NOME";
		post=false;
	}
	if(document.formulario1.cidade_id.value == 0) {
		msg+="\n Selecione uma cidade";
                post=false;
        }
        if(document.formulario1.ddd.value.length < 2){
                msg+="\n DDD";
                post=false;
        }

        if(document.formulario1.ddd.value.length == 2){
                if (isNaN(document.formulario1.ddd.value)) {
                        msg+="\n DDD 1ª opção inválido ou não é numérico.";
                        post=false;
                }
        }

        if(document.formulario1.fone.value.length < 7){
		msg+="\n TELEFONE";
                post=false;
        }

        if(document.formulario1.fone.value.length > 1){
                if (isNaN(document.formulario1.fone.value)) {
			msg+="\n Telefone 1ª opção inválido. Utilize apenas números.";
                        post=false;
                }
        }

        if(document.formulario1.fone.value.length > 1){
                if (isNaN(document.formulario1.fone.value)) {
			msg+="\n Telefone 1ª opção inválido. Utilize apenas números.";
                        post=false;
                }
        }

        //valida o campo de email
        if(document.formulario1.email.value == "")
        {
                msg+="\n E-MAIL";
                post=false;
        } else {
                prim = document.formulario1.email.value.indexOf("@");
                if(parseInt(prim) < 1) {
                        msg+="\n  (E-mail incompleto)";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf("@",prim + 1) != -1) {
                        msg+="\n  (E-mail inválido)";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf(".") < 1) {
                        msg+="\n  (E-mail indefinido '.')";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf(" ") != -1) {
			msg+="\n  (E-mail em branco)";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf("zipmeil.com") > 0) {
			msg+="\n  (Verifique o endereço de e-mail)";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf("hotmeil.com") > 0) {
			msg+="\n  (Verifique o endereço de e-mail)";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf(".@") > 0) {
			msg+="\n  (Uso indevido de '.@')";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf("@.") > 0) {
			msg+="\n  (Uso indevido de '.@')";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf(".com.br.") > 0) {
			msg+="\n  (Uso indevido de '.')";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf("/") > 0) {
			msg+="\n  (Uso indevido de '/')";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf("[") > 0) {
			msg+="\n  (Uso indevido de '[')";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf("]") > 0) {
			msg+="\n  (Uso indevido de ']')";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf("(") > 0) {
			msg+="\n  (Uso indevido de '(')";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf(")") > 0) {
			msg+="\n  (Uso indevido de ')')";
                        post=false;
                }
                if(document.formulario1.email.value.indexOf("..") > 0) {
			msg+="\n  (Uso indevido de '..')";
                        post=false;
                }
        } // fim do email
        if(planoPromocional == "Pro"){
                        plano.value = 1;
                        perfil.value = 1;
        }
        if(planoPromocional == "Rec"){
                        plano.value = 2;
                        perfil.value = 2;
        }
        if(planoPromocional == "Est"){
                        plano.value = 2;
                        perfil.value = 3;
        }
        if(planoPromocional == "Ppd"){
                        plano.value = 1;
                        perfil.value = 9;
                        document.formulario.ppd.value = 1;
        }

        if(!post){
                alert(msg);
        }

        if (post == true) {
		document.formulario1.action = "http://www.catho.com.br/parceiros/inclui_cv.php";
                document.formulario1.submit();
        }
        else
                return post;
}

function saveEnqueteResp(){
	var enqueteId = document.getElementById('enqueteId').value;
	var inputResp = document.getElementsByName("respEnquete");
	for( var i=0; i < inputResp.length; i++ ){
		if( inputResp[i].checked == true ){
			var valueResp = inputResp[i].value;
		}
	}
	
	if( Number( valueResp ) > 0 && Number( enqueteId ) > 0 ){
		var xmlhttp = ajax();
		xmlhttp.open("GET","funcoesLocais.php?action=respEnq&enqueteId="+enqueteId+"&respId="+valueResp);
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4){
				showResp();
			}
		}
		xmlhttp.send(null);
	}
}

function showResp(){
	var enqueteId = document.getElementById('enqueteId').value;
	var htmlModel = "<table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td width='#percent#%' bgcolor='#e19145'>&nbsp;</td><td>&nbsp;</td></tr></table>";
	if( Number( enqueteId ) > 0 ){
		var xmlhttp = ajax();
		xmlhttp.open("GET","funcoesLocais.php?action=getRespEnq&enqueteId="+enqueteId);
		xmlhttp.onreadystatechange=function(){
			if( xmlhttp.readyState == 4 ){
				document.getElementById('respEnqDiv').style.display='none';
				document.getElementById('botoesEnq').style.display='none';
				document.getElementById('statEnqDiv').style.display='';
				var content = xmlhttp.responseText;
				if( content.indexOf("||") > 0 ){
					var rows = content.split("||");
					for( var i=0; i < rows.length; i++ ){
						var cols = rows[i].split("::");
						var htmlModelTemp = htmlModel.replace("#percent#",cols[1]);
						var respGraph = eval("document.getElementById('statResp_"+cols[0]+"')");
						respGraph.innerHTML = htmlModelTemp;
						var respValue = eval("document.getElementById('statRespValor_"+cols[0]+"')");
						respValue.innerHTML = '<b>'+cols[1]+'%</b>';
					}
				}
				else if( content.indexOf("::") > 0 ){
					var cols = content.split("::");
					htmlModel = htmlModel.replace("#percent#",cols[1]);
					var respGraph = eval("document.getElementById('statResp_"+cols[0]+"')");
					respGraph.innerHTML = htmlModel;
					var respValue = eval("document.getElementById('statRespValor_"+cols[0]+"')");
					respValue.innerHTML = '<b>'+respValue+'%</b>';
				}
			}
		}
		xmlhttp.send(null);
	}
}

function PassoCV_BR()		{
	window.open('http://www3.catho.com.br/passoapasso/inclusao_cv_port.html', 'Window', 'width=640,height=470,scrollbars=no,top=0,left=0');
}

function goBusca(origem,afiliadoId){
	if( document.getElementById('boxbusca').value.length < 3 || document.getElementById('boxbusca').value == "Digite algo como &quot;vendedor externo sao paulo&quot;" || document.getElementById('boxbusca').value == 'Digite algo como "vendedor externo sao paulo"' ){
                alert("Para fazer a busca, digite o cargo desejado.");
                return false;
        }
	var word = document.getElementById('boxbusca').value;
	var type = document.getElementById('typeBusca').value;
	if( type == 'vag' ){
		var link = "http://www3.catho.com.br/vag/busca/search.php?q="+word;
	}
	else{
		var link = "http://www3.catho.com.br/cur/busca/resultado.php?q="+word;
	}

	window.location = "http://afiliados.catho.com.br/go.php?id="+afiliadoId+"&a=8&url="+url_encode(link);
}
