window.onload = function() {
	if(document.getElementById('profissionais')) {
	document.getElementById('profissionais').style.fontWeight='bold';
	document.frmBusca.action='BuscarProfissional.asp';
	}
}
function und(tr) {

	var trs = document.getElementById(tr).getElementsByTagName('a')

          for(var i=0; i<trs.length; i++) {
		trs[i].style.textDecoration = 'underline';
	  }

}
function undnone(tr) {
	var trs = document.getElementById(tr).getElementsByTagName('a')

          for(var i=0; i<trs.length; i++) {
		trs[i].style.textDecoration = 'none';
	  }
}

function Banner(c,w,h)
{
document.write('<center><object type="application/x-shockwave-flash" data="'+c+'" width="'+w+'" height="'+h+'">')
document.write('<param name="movie" value="'+c+'" />')
document.write('<param name="allowScriptAcess" value="sameDomain" />')
document.write('<param name="quality" value="best" />')
document.write('<param name="menu" value="false" />')
document.write('</object></center>')
}

function abVag(cod){
window.open("VagasDetalhe.asp?popup=1&cod="+cod,"","resizable=0,scrollbars=1,top=50,left=50,width=600,height=400,toolbar=0,menubar=0,status=1");
}

function checaForm(form) {
   if (form.concordo.checked == false) {
      alert("Você deve marcar a caixa concordando com os termos das Normas e Condições.");
      return false;
   }
   return true; 
}

function verifica(form) {
if(form.Area.options[form.Area.selectedIndex].value == 0 || form.Area.options[form.Area.selectedIndex].value == '') {
alert("Você deve selecionar a área de atividade da sua empresa.");
return false;
}
return true;
}

function prox(prx){
	frmBusca.prx.value=prx;
	frmBusca.submit();
}

function FormataCNPJ(Campo, tecla) {
	var vr = new String(Campo.value);
	var temp = new String(Campo.value);
	vr = vr.replace(".", "");
	vr = vr.replace(".", "");
	vr = vr.replace("/", "");
	vr = vr.replace("-", "");
	vr = vr.replace(" ", "");
	vr = vr.replace(" ", "");
	vr = vr.replace(" ", "");
	tam = vr.length;
	for(i = 0; i < (15-tam); i++)
		vr = ' ' + vr;
	if (tecla.keyCode != 9 && tecla.keyCode != 8) {
		if (tam >  2 && tam <=  6)	temp = vr.substr(9, 4) + '-' + vr.substr(13, 2);
		else if (tam >  6 && tam <=  9)	temp = vr.substr(6, 3) + '/' + vr.substr(9, 4) + '-' + vr.substr(13, 2); 
		else if (tam >  9 && tam <= 12)	temp = vr.substr(3, 3) + '.' + vr.substr(6, 3) + '/' + vr.substr(9, 4) + '-' + vr.substr(13, 2);
		else if (tam > 12 && tam <= 15)	temp = vr.substr(0, 3) + '.' + vr.substr(3, 3) + '.' + vr.substr(6, 3) + '/' + vr.substr(9, 4) + '-' + vr.substr(13, 2);
		temp = temp.replace(" ", "");
		temp = temp.replace(" ", "");
		temp = temp.replace(" ", "");
		Campo.value = temp;
	}
}

function FormataCPF(Campo, teclapres) {
	var tecla = teclapres.keyCode;
	var vr = new String(Campo.value);
	vr = vr.replace(".", "");
	vr = vr.replace(".", "");
	vr = vr.replace("-", "");
	tam = vr.length + 1;
	if (tecla != 9 && tecla != 8){
		if (tam > 3 && tam < 7) Campo.value = vr.substr(0, 3) + '.' + vr.substr(3, tam);
		if (tam >= 7 && tam <10) Campo.value = vr.substr(0,3) + '.' + vr.substr(3,3) + '.' + vr.substr(6,tam-6);
		if (tam >= 10 && tam < 12) Campo.value = vr.substr(0,3) + '.' + vr.substr(3,3) + '.' + vr.substr(6,3) + '-' + vr.substr(9,tam-9);
	}
}


function abCur(cod){
window.open("VisualizarCurriculo.asp?popup=1&cid="+cod,"","resizable=1,top=50,left=50,width=560,height=360,toolbar=1,menubar=1,scrollbars=1");
}


function desativaIE() {
	if(document.getElementById('IEisento').checked==true) {
		document.frmCadastro.IE.disabled=true;
		document.frmCadastro.IE.style.background='#CCCCCC';
	} else if(document.getElementById('IEisento').checked==false) {
		document.frmCadastro.IE.disabled=false;
		document.frmCadastro.IE.style.background='#FFFFFF';
	}
}

function openPop(pag,w,h){
	var win = window.open(pag,'_blank','fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h+',top=' + ((window.screen.height - h) / 2) + ',left=' + ((window.screen.width - w) / 2));
}

function AbreForm(){
window.open("RecrutarNucleo.asp","","resizable=0,scrollbars=1,top=50,left=50,width=500,height=400,toolbar=0,menubar=0,status=1");
}
function changeAction(l) {
	if(l=='vag') {
		document.getElementById('vagas').style.fontWeight='bold';
		document.getElementById('profissionais').style.fontWeight='normal';
		document.frmBusca.action='BuscarVagas.asp';
	} else if(l=='cur') {
		document.getElementById('profissionais').style.fontWeight='bold';
		document.getElementById('vagas').style.fontWeight='normal';
		document.frmBusca.action='BuscarProfissional.asp';
	}
}

//+ Jonas Raoni Soares Silva
//@ http://jsfromhell.com/forms/masked-input [v1.0]

MaskInput = function(f, m){
    function mask(e){
        var patterns = {"1": /[A-Z]/i, "2": /[0-9]/, "4": /[\xC0-\xFF]/i, "8": /./ },
            rules = { "a": 3, "A": 7, "9": 2, "C":5, "c": 1, "*": 8};
        function accept(c, rule){
            for(var i = 1, r = rules[rule] || 0; i <= r; i<<=1)
                if(r & i && patterns[i].test(c))
                    break;
                return i <= r || c == rule;
        }
        var k, mC, r, c = String.fromCharCode(k = e.key), l = f.value.length;
        (!k || k == 8 ? 1 : (r = /^(.)\^(.*)$/.exec(m)) && (r[0] = r[2].indexOf(c) + 1) + 1 ?
            r[1] == "O" ? r[0] : r[1] == "E" ? !r[0] : accept(c, r[1]) || r[0]
            : (l = (f.value += m.substr(l, (r = /[A|9|C|\*]/i.exec(m.substr(l))) ?
            r.index : l)).length) < m.length && accept(c, m.charAt(l))) || e.preventDefault();
    }
    for(var i in !/^(.)\^(.*)$/.test(m) && (f.maxLength = m.length), {keypress: 0, keyup: 1})
        addEvent(f, i, mask);
};