
function ajaxInit(){
var xmlhttp ;

	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 CaixaBaixa(fsValor, foForm, foNome) { 
	if (window.event.keyCode >= 65 && window.event.keyCode <= 90){
		x = new String(document.forms[foForm].elements[foNome].value);
		document.forms[foForm].elements[foNome].value = x.toLowerCase();
	}
}
function validarCPF(CPF){ 
	if (CPF != ''){ 
		if (!verificarCPF(CPF)){ 
			alert('CPF Inválido!'); 
			document.form.txtCPF.value=''; 
			document.form.txtCPF.focus(); 
		} 
	} 
} 

function verificarCPF(c){ 
	c = c.replace('.','');	
	c = c.replace('.','');	
	c = c.replace('-','');	
	var i;  
	s = c; 
	var c = s.substr(0,9);  
	var dv = s.substr(9,2);  
	var d1 = 0;  
	var v = false; 
	for (i = 0; i < 9; i++)  
	{  
		d1 += c.charAt(i)*(10-i);  
	}  
	if (d1 == 0){  
	v = true;  
	return false;  
	}  
	d1 = 11 - (d1 % 11);  
		if (d1 > 9) d1 = 0;  
			if (dv.charAt(0) != d1)  
			{  
		v = true; 
		return false;  
	}  
	d1 *= 2;  
	for (i = 0; i < 9; i++) {  
		d1 += c.charAt(i)*(11-i);  
	}  
	d1 = 11 - (d1 % 11);  
	if (d1 > 9) d1 = 0;  
		if (dv.charAt(1) != d1)  
	{  
	v = true; 
	return false;  
	}  
	if (!v) { 
	return true; 
	} 
}

function formatarCPF (campo,teclapres) { 
	var tecla = teclapres.keyCode;  
	if ((tecla < 48) || (tecla > 57)) {
		return false;
	} 
	vr = campo.value;  
	vr = vr.replace( '-', '' );  
	vr = vr.replace( '.', '' );  
	vr = vr.replace( '.', '' );  
	tam = vr.length; 
	 
	if (tam < 11 && tecla != 8){ tam = vr.length + 1 ; }  
	if (tecla == 8 ){	tam = tam - 1 ; }  
	if ( tecla == 8 || tecla >= 48 && tecla <= 57 || tecla >= 96 && tecla <= 105 ){  
		if ( tam <= 2 ){  
	 		campo.value = vr ; }  
	 	if ( (tam > 2) && (tam <= 5) ){  
	 		campo.value = vr.substr( 0, tam - 2 ) + '-' + vr.substr( tam - 2, tam ) ; }  
	 	if ( (tam >= 6) && (tam <= 8) ){  
	 		campo.value = vr.substr( 0, tam - 5 ) + '.' + vr.substr( tam - 5, 3 ) + '-' + vr.substr( tam - 2, tam ) ; }  
	 	if ( (tam >= 9) && (tam <= 11) ){  
	 		campo.value = vr.substr( 0, tam - 8 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + '-' + vr.substr( tam - 2, tam ) ; }  
	}

} 
function CheckNums(campo,teclapres) {
	var tecla = 0;
	
	if(document.all){
        tecla = teclapres.keyCode;
    }
    else{
      tecla = teclapres.which;
      if(tecla==1){tecla=0}
    }
	
	if ((tecla < 48) || (tecla > 57)) {
		return false;
	}
}
function validaData(pValor,nome){
	if(document.form.elements[nome].value!='' && validarDataYYYY(pValor)=='F'){
		alert('Data incorreta!');
		document.form.elements[nome].value='';
		document.form.elements[nome].focus();
	}
}

function validaEmail(Email){
	var filter = /^(([a-zA-Z0-9_-])+(([\.\])+([a-zA-Z0-9_-]{0,1})))+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 
	var arrayEmail = Email.split(";"); //Separa os email 
	for (var i=0;i < arrayEmail.length; i++){ //varre a lista de emails 
		if ( !filter.test(arrayEmail[i]) ){ 
			return false; //se tiver erro sai com false 
		}
		else{ 
			return true; // se nao achou erro retorrna verdadeiro 
		}
	}
} 

function enviarEmail(){
	if(document.form.txtNome.value==''){
		alert('Informe um nome!');
		document.form.txtNome.focus();
	}
	else if(document.form.txtEmail.value==''){
		alert('Informe um e-mail!');
		document.form.txtEmail.focus();
	}
	else if(validaEmail(document.form.txtEmail.value)==false){
		alert('E-mail inválido');
		document.form.txtEmail.value = '';
	}
	else if(document.form.txtAssunto.value==''){
		alert('Informe um assunto!');
		document.form.txtAssunto.focus();
	}
	else if(document.form.txtMsg.value==''){
		alert('Digite uma mensagem!');
		document.form.txtMsg.focus();
	}
	else{
		document.form.action='?ac=contato';
		document.form.submit();
	}
}

function enviarFormulario(){
	if(document.form.txtNomeProf.value==''){
		alert('Informe nome `Profissional!');
		document.form.txtNomeProf.focus();
	}
	else if(document.form.txtNome.value==''){
		alert('Informe o nome Completo!');
		document.form.txtNome.focus();
	}
	else{
		document.form.action='?ac=formulario';
		document.form.submit();
	}
}

function validarDataYYYY(vValor){ 
    var checkStr = ''; 
	checkStr = vValor; 
	var err=0; 
    var psj=0; 
	var dia = 0; 
	var mes = 0; 
	var ano = 0; 
	var barra1 = ''; 
	var barra2 = ''; 
       	dia = checkStr.substring(0, 2); 
       	barra1 = checkStr.substring(2, 3); 
       	mes = checkStr.substring(3, 5); 
       	barra2 = checkStr.substring(5, 6); 
	    ano = checkStr.substring(6, 10); 
    	    //verifica??es b?sicas 
    	    if (checkStr.length != 10) 
				err = 1; 
    	    if (mes<1 || mes>12) 
				err = 1; 
    	    if (barra1 != '/') 
				err = 1; 
    	    if (dia<1 || dia>31) 
				err = 1; 
    	    if (barra2 != '/') 
				err = 1; 
    	    if (ano<1900 || ano>2900) 
				err = 1; 
    	    //verifica??es avan?adas 
    	    // m?s com 30 dias 
    	    if (mes==4 || mes==6 || mes==9 || mes==11){ 
    		   if (dia==31) 
			   		err=1; 
    	    } 
    	    // fevereiro e ano bissexto 
    	    if (mes==2){ 
    		    var g = parseInt(ano/4); 
    		    if (isNaN(g)) { 
    			    err=1; 
    		    } 
    		    if (dia>29) 
					err=1; 
    		    if (dia==29 && ((ano/4)!=parseInt(ano/4))) 
					err=1; 
    	    } 
    if (err==1) 
       return 'F'; 
	else 
	   return 'T'; 
}


function formatarDataYYYY(campo, teclapres) { 
	var tecla = teclapres.keyCode;  
	vr = campo.value;  
	vr = vr.replace( '/', '' );  
	vr = vr.replace( '/', '' );  
	tam = vr.length + 1;  
	if ( tecla != 9 && tecla != 8 ) {  
	   if ( tecla == 8 || tecla >= 48 && tecla <= 57 || tecla >= 96 && tecla <= 105 ) {  
		   if ( tam <= 2 ) campo.value = vr ;  
		   if ( tam > 2 && tam < 5 ) campo.value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, tam );  
		   if ( tam >= 5 && tam <= 10 ) campo.value = vr.substr( 0, 2 ) + '/' + vr.substr( 2, 2 ) + '/' + vr.substr( 4, tam );   
      }  
   }  
}  


function enviarCurriculo1(){
	var cpf = document.form.txtCPF.value;
	var nome = document.form.txtNome.value;
	var nasc = document.form.txtDataNascPessoa.value;
	var civil = document.form.cboEstadoCivil.value;
	var email = document.form.txtEmail.value;
	var ddd = document.form.txtDDD.value;
	var fone = document.form.txtTel.value;
	var ddd_c = document.form.txtDDDCel.value;
	var setor = document.form.cboSetores.value;
	if (cpf == ""){
		alert("Por favor, informe seu CPF!");
		document.form.txtCPF.focus();
	}
	else if (cpf.length < 14 || cpf == "111.111.111-11" || cpf == "222.222.222-22" || cpf == "333.333.333-33" || cpf == "444.444.444-44" || cpf == "555.555.555-55" || cpf == "666.666.666-66" || cpf == "777.777.777-77" || cpf == "888.888.888-88" || cpf == "999.999.999-99" || cpf == "000.000.000-00"){
		alert("CPF Inválido!");
		document.form.txtCPF.focus();
	}
	else if (nome == ""){
		alert("Por favor, informe seu nome!");
		document.form.txtNome.focus();	
	}
	else if (setor == 0){
		alert("Por favor, informe sua área de interesse!");
		document.form.cboSetores.focus();
	}
	else if (nasc == ""){
		alert("Por favor, informe sua data de nascimento!");
		document.form.txtDataNascPessoa.focus();
	}
	else if (civil == 0){
		alert("Por favor, informe seu estado civil!");
		document.form.cboEstadoCivil.focus();
	}
	else if (email == ""){
		alert("Por favor, informe seu email!");
		document.form.txtEmail.focus();
	}
	else if (email.indexOf("@") < 1){
		alert("Email inválido!");
		document.form.txtEmail.focus();
	}
	else if (email.lastIndexOf(".") <= email.indexOf("@")){
		alert("Email inválido!");
		document.form.txtEmail.focus();	
	}
	else if (email.indexOf("@") == email.length){
		alert("Email inválido!");
		document.form.txtEmail.focus();
	}
	else if (ddd == ""){
		alert("Por favor, informe o DDD!");
		document.form.txtDDD.focus();	
	}
	else if (isNaN(ddd) || ddd.length < 2){
		alert("DDD inválido!");
		document.form.txtDDD.focus();
	}
	else if (fone == ""){
		alert("Por favor, informe o telefone!");
		document.form.txtTel.focus();
	}
	else if (fone.length < 8){
		alert("Telefone inválido!");
		document.form.txtTel.focus();
	}

	else if (isNaN(ddd_c)){
		alert("DDD inválido!");
		document.form.txtDDDCel.focus();
	}
	else if(document.form.cboPais.value == 0){
		alert('Informe o Pais!');
		document.form.cboPais.focus();
	}
	else if(document.form.cboEstado.value == 0){
		alert('Informe o Estado!');
		document.form.cboEstado.focus();
	}
	else if(document.form.cboLocalidade.value == 0){
		alert('Informe a Localidade!');
		document.form.cboLocalidade.focus();
	}
	else if(document.form.cboBairro.value == 0){
		alert('Informe o Bairro!');
		document.form.cboBairro.focus();
	}
	else if(document.form.cboLogradouro.value == 0){
		alert('Informe o Logradouro');
		document.form.cboLogradouro.focus();
	}
	else if(document.form.txtEndereco.value == ''){
		alert('Informe o Complemento!');
		document.form.txtEndereco.focus();
	}
	else{
		document.form.action='?ac=cadastro_curriculo';
		document.form.submit();
	}
}


function editarCurriculo(id){

	var cpf = document.form.txtCPF.value;
	var nome = document.form.txtNome.value;
	var nasc = document.form.txtDataNascPessoa.value;
	var civil = document.form.cboEstadoCivil.value;
	var email = document.form.txtEmail.value;
	var ddd = document.form.txtDDD.value;
	var fone = document.form.txtTel.value;
	var ddd_c = document.form.txtDDDCel.value;
	var setor = document.form.cboSetores.value;
	if (cpf == ""){
		alert("Por favor, informe seu CPF!");
		document.form.txtCPF.focus();
	}
	else if (cpf.length < 14 || cpf == "111.111.111-11" || cpf == "222.222.222-22" || cpf == "333.333.333-33" || cpf == "444.444.444-44" || cpf == "555.555.555-55" || cpf == "666.666.666-66" || cpf == "777.777.777-77" || cpf == "888.888.888-88" || cpf == "999.999.999-99" || cpf == "000.000.000-00"){
		alert("CPF Inválido!");
		document.form.txtCPF.focus();
	}
	else if (nome == ""){
		alert("Por favor, informe seu nome!");
		document.form.txtNome.focus();	
	}
	else if (setor == 0){
		alert("Por favor, informe sua área de interesse!");
		document.form.cboSetores.focus();
	}
	else if (nasc == ""){
		alert("Por favor, informe sua data de nascimento!");
		document.form.txtDataNascPessoa.focus();
	}
	else if (civil == 0){
		alert("Por favor, informe seu estado civil!");
		document.form.cboEstadoCivil.focus();
	}
	else if (email == ""){
		alert("Por favor, informe seu email!");
		document.form.txtEmail.focus();
	}
	else if (email.indexOf("@") < 1){
		alert("Email inválido!");
		document.form.txtEmail.focus();
	}
	else if (email.lastIndexOf(".") <= email.indexOf("@")){
		alert("Email inválido!");
		document.form.txtEmail.focus();	
	}
	else if (email.indexOf("@") == email.length){
		alert("Email inválido!");
		document.form.txtEmail.focus();
	}
	else if (ddd == ""){
		alert("Por favor, informe o DDD!");
		document.form.txtDDD.focus();	
	}
	else if (isNaN(ddd) || ddd.length < 2){
		alert("DDD inválido!");
		document.form.txtDDD.focus();
	}
	else if (fone == ""){
		alert("Por favor, informe o telefone!");
		document.form.txtTel.focus();
	}
	else if (fone.length < 8){
		alert("Telefone inválido!");
		document.form.txtTel.focus();
	}

	else if (isNaN(ddd_c)){
		alert("DDD inválido!");
		document.form.txtDDDCel.focus();
	}
	else if(document.form.cboPais.value == 0){
		alert('Informe o Pais!');
		document.form.cboPais.focus();
	}
	else if(document.form.cboEstado.value == 0){
		alert('Informe o Estado!');
		document.form.cboEstado.focus();
	}
	else if(document.form.cboLocalidade.value == 0){
		alert('Informe a Localidade!');
		document.form.cboLocalidade.focus();
	}
	else if(document.form.cboBairro.value == 0){
		alert('Informe o Bairro!');
		document.form.cboBairro.focus();
	}
	else if(document.form.cboLogradouro.value == 0){
		alert('Informe o Logradouro');
		document.form.cboLogradouro.focus();
	}
	else if(document.form.txtEndereco.value == ''){
		alert('Informe o Complemento!');
		document.form.txtEndereco.focus();
	}
	else{
		document.form.action='?ac=editar_curriculo&idcurriculo='+id;
		document.form.submit();
	}
}

function enviarCurriculo2(id,aba){
	var formacao = document.form.cboEscolaridades.value;
	
		document.form.infoArray.value='';
		for(i=0;i<document.form.cboConhecimentos.length;i++){
			if(document.form.cboConhecimentos[i].selected){
				document.form.infoArray.value=document.form.infoArray.value+document.form.cboConhecimentos[i].value+';';				
			}
		}
		document.form.action='?ac=cadastro_curriculo2&id='+id+'&aba='+aba;
		document.form.submit();
}
function enviarCurriculo3(id,aba){
	document.form.action='?ac=cadastro_curriculo3&id='+id+'&aba='+aba;
	document.form.submit();
}
function atualizarestado(valor){
	ajax=ajaxInit();
	document.getElementById("div_estado").innerHTML="Carregando...";
	if(ajax){
		ajax.open('GET','?ac=carregar_estado&idpais='+valor,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					document.getElementById("div_estado").innerHTML=ajax.responseText;
				}
			}
		}
	}
	ajax.send(null);
}

function atualizarlocalidade(valor){
	ajax=ajaxInit();
	document.getElementById("div_localidade").innerHTML="Carregando...";
	if(ajax){
		ajax.open('GET','?ac=carregar_localidade&idestado='+valor,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					document.getElementById("div_localidade").innerHTML=ajax.responseText;
				}
			}
		}
	}
	ajax.send(null);
}


function atualizarbairro(valor){
	
	ajax=ajaxInit();
	document.getElementById("div_bairro").innerHTML="Carregando...";
	if(ajax){
		ajax.open('GET','?ac=carregar_bairro&idlocalidade='+valor,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					document.getElementById("div_bairro").innerHTML=ajax.responseText;
				}
			}
		}
	}
	ajax.send(null);
		
}
function atualizarlogradouro(valor){
	
	ajax=ajaxInit();
	document.getElementById("div_logradouro").innerHTML="Carregando...";
	if(ajax){
		ajax.open('GET','?ac=carregar_logradouro&idbairro='+valor,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					document.getElementById("div_logradouro").innerHTML=ajax.responseText;
				}
			}
		}
	}
	ajax.send(null);
	
}
function atualizarCombosCEP(){
	
	ajax=ajaxInit();
	document.getElementById("div_estado").innerHTML="Carregando...";
	document.getElementById("div_localidade").innerHTML="Carregando...";
	document.getElementById("div_bairro").innerHTML="Carregando...";
	document.getElementById("div_logradouro").innerHTML="Carregando...";
	if(ajax){
		ajax.open('GET','?ac=carregar_Combos_CEP&CEP='+document.form.txtCEP.value,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					var vRetorno = ajax.responseText.split("|");
					document.getElementById("div_pais").innerHTML=vRetorno[0];
					document.getElementById("div_estado").innerHTML=vRetorno[1];	
					document.getElementById("div_localidade").innerHTML=vRetorno[2];	
					document.getElementById("div_bairro").innerHTML=vRetorno[3];	
					document.getElementById("div_logradouro").innerHTML=vRetorno[4];	
				}
			}
		}
	}
	ajax.send(null);
	
	
}
function atualizarCEP(valor){
	ajax=ajaxInit();
	//document.getElementById("txtCEP").innerHTML="Carregando...";
	if(ajax){
		ajax.open('GET','?ac=carregar_CEP&idlogradouro='+valor,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					document.getElementById("txtCEP").value=ajax.responseText;
				}
			}
		}
	}
	ajax.send(null);
	
}

 
 function carregarFoto(id){
	ajax=ajaxInit();
	//document.getElementById("divImg").innerHTML="<img src=\"imagens/carregando.gif\" \>";
	if(ajax){
		ajax.open('GET','?ac=carregar_foto&id='+id,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					window.parent.document.getElementById("divImg").innerHTML=ajax.responseText;
					fadeInit();
				}
			}
		}
	}
	ajax.send(null);
}
var	fadeTarget;
var preInitTimer;

/* functions */

function preInit() {
	/* an inspired kludge that - in most cases - manages to initially hide the image
	   before even onload is triggered (at which point it's normally too late, and a nasty flash
	   occurs with non-cached images) */
	if ((document.getElementById)&&(fadeTarget=document.getElementById('imgFade'))) {
		fadeTarget.style.visibility = "hidden";
		if (typeof preInitTimer != 'undefined') clearTimeout(preInitTimer); /* thanks to Steve Clay http://mrclay.org/ for this small Opera fix */
	} else {
		preInitTimer = setTimeout("preInit()",2);
	}
}

function fadeInit() {
	if (document.getElementById) {
		/* get a handle on the fadeable object, to make code later more manageable */
		preInit(); /* shouldn't be necessary, but IE can sometimes get ahead of itself and trigger fadeInit first */
		/* set the initial opacity in a (hopefully) cross browser way
		   notice that because of the way the image is in front, and not obfuscated
		   by another object we need to "fade out", i don't need a fallback mechanism
		   to show/hide the covering object...the image is just there, full stop */
		if (fadeTarget.style.MozOpacity!=null) {  
			/* Mozilla's pre-CSS3 proprietary rule */
			fadeTarget.style.MozOpacity = 0;
		} else if (fadeTarget.style.opacity!=null) {
			/* CSS3 compatible */
			fadeTarget.style.opacity = 0;
		} else if (fadeTarget.style.filter!=null) {
			/* IE's proprietary filter */
			fadeTarget.style.filter = "alpha(opacity=0)";
		}
		/* make the object visible again */
		fadeTarget.style.visibility = 'visible';
		window.setTimeout("fadeIn(0)", 500);
	}
}

function fadeIn(opacity) {
	if (fadeTarget) {
		if (opacity <= 100) {
			if (fadeTarget.style.MozOpacity!=null) {
				/* Mozilla's pre-CSS3 proprietary rule */
				fadeTarget.style.MozOpacity = (opacity/100)-.001;
				/* the .001 fixes a glitch in the opacity calculation which normally results in a flash when reaching 1 */
			} else if (fadeTarget.style.opacity!=null) {
				/* CSS3 compatible */
				fadeTarget.style.opacity = (opacity/100)-.001;
			} else if (fadeTarget.style.filter!=null) {
				/* IE's proprietary filter */
				fadeTarget.style.filter = "alpha(opacity="+opacity+")";
				/* worth noting: IE's opacity needs values in a range of 0-100, not 0.0 - 1.0 */ 
			}
			opacity += 10;
			window.setTimeout("fadeIn("+opacity+")", 30);
		}
	}
}
/* 3rd party helper functions */

/* addEvent handler for IE and other browsers */
function addEvent(elm, evType, fn, useCapture) 
// addEvent and removeEvent
// cross-browser event handling for IE5+,  NS6 and Mozilla
// By Scott Andrew
{
 if (elm.addEventListener){
   elm.addEventListener(evType, fn, useCapture);
   return true;
 } else if (elm.attachEvent){
   var r = elm.attachEvent("on"+evType, fn);
   return r;
 }
}



function mostra(fadeValue,valor){
	wait=100;
	if(fadeValue==0){
		window.parent.document.getElementById("div_comentario").innerHTML=valor;	
		if(document.all){
			document.getElementById("div_comentario").style.top = "-69px";
			document.getElementById("div_desc_galeria").style.top = "-65px";
			document.getElementById("div_comentario").style.width = (document.getElementById("imgFade").width)-10+"px";		
		}
		else{
			document.getElementById("div_comentario").style.top = "-76px";
			document.getElementById("div_desc_galeria").style.top = "-70px";
			document.getElementById("div_comentario").style.right = "-5px";
			document.getElementById("div_comentario").style.width = (document.getElementById("imgFade").width)-10+"px";	
		}			
		window.parent.document.getElementById('div_comentario').style.visibility="visible";
	}
	if(fadeValue<60){
		//document.getElementById("divImg").filters.alpha.opacity=fadeValue; 
		document.getElementById("div_comentario").filters.alpha.opacity=fadeValue; 
		fadeValue += 10;
	}
 	wait=50;
	setTimeout('mostra('+fadeValue+')',wait);
}

function oculta(){
	window.parent.document.getElementById('div_comentario').style.visibility="hidden";
}

		function startit(){
		crossobj=ie4? eval("document.all."+curcanvas) : dom? document.getElementById(curcanvas) : document.tickernsmain.document.tickernssub
		if (ie4||dom){
		crossobj.innerHTML=getslidehtml(slideshowcontent[curindex])
		rotateslide()
		}
		else{
		document.tickernsmain.visibility='show'
		curindex++
		setInterval("rotateslide()",pause)
		}
		}
		
				function rotateslide(){
		if (ie4||dom){
		resetit(curcanvas)
		crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
		crossobj.style.zIndex++
		if (crossobj.filters)
		document.all.canvas0.filters.alpha.opacity=document.all.canvas1.filters.alpha.opacity=20
		else if (crossobj.style.MozOpacity)
		document.getElementById("canvas0").style.MozOpacity=document.getElementById("canvas1").style.MozOpacity=0.2
		var temp='setInterval("moveslide()",50)'
		dropslide=eval(temp)
		curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
		}
		else if (document.layers){
		crossobj.document.write(getslidehtml(slideshowcontent[curindex]))
		crossobj.document.close()
		}
		curindex=(curindex<slideshowcontent.length-1)? curindex+1 : 0
		}

		function jumptoslide(which){
		curindex=which
		rotateslide()
		}

		function resetit(what){
		curpos=parseInt(trans_width)*(-1)
		var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
		crossobj.style.left=curpos+"px"
		}
		
				function getslidehtml(theslide){
		var slidehtml=""
		if (theslide[1]!="")
		slidehtml='<a href="'+theslide[1]+'" target="'+theslide[2]+'">'
		slidehtml+='<img src="'+theslide[0]+'" border="0">'
		if (theslide[1]!="")
		slidehtml+='</a>'
		return slidehtml
		}

		function moveslide(){
		if (curpos<0){
		curpos=Math.min(curpos+degree,0)
		tempobj.style.left=curpos+"px"
		}
		else{
		clearInterval(dropslide)
		if (crossobj.filters)
		crossobj.filters.alpha.opacity=100
		else if (crossobj.style.MozOpacity)
		crossobj.style.MozOpacity=1
		nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
		tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
		tempobj.innerHTML=getslidehtml(slideshowcontent[curindex])
		nextindex=(nextindex<slideshowcontent.length-1)? nextindex+1 : 0
		setTimeout("rotateslide()",pause)
		}
		}
		
function formatarMask(e,src,mask) {
    if(window.event) { _TXT = e.keyCode; } 
    else if(e.which) { _TXT = e.which; }
    if(_TXT > 47 && _TXT < 58) { 
 		var i = src.value.length; var saida = mask.substring(0,1); var texto = mask.substring(i)
 	if (texto.substring(0,1) != saida) { src.value += texto.substring(0,1); } 
    	return true; } else { if (_TXT != 8) { return false; } 
 	else { return true; }
    }
}
function salvarEmail(){
	if(document.form.txtEmailNewsLetter.value == ''){
		alert('Informe o email');
		document.form.txtEmailNewsLetter.focus();
	}
	else if(validaEmail(document.form.txtEmailNewsLetter.value)==false){
		alert('E-mail inválido');
		document.form.txtEmailNewsLetter.value = '';
	}
	else{
		document.form.action='exata?ac=cadastrar_email';
		document.form.submit();
	}
}
function excluirFormacaoEscolar(id,idFormacao){
	ajax=ajaxInit();
	document.getElementById("msg").innerHTML="Excluindo registro de formação escolar...";
	    document.getElementById('msg').style.visibility='visible';
	if(ajax){
		ajax.open('GET','?ac=inserir_formacao_escolar&id='+id+'&idFormacao='+idFormacao,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					document.getElementById("msg").innerHTML="Registro de formação escolar excluido com sucesso...";
					window.parent.document.getElementById("div_formacao_escolar").innerHTML=ajax.responseText;
				}
			}
		}
	}
	setTimeout ('ocultarDiv()',3000);
	ajax.send(null);
}

function inserirFormacaoEscolar(id){
	var escolaridade = document.form.cboEscolaridades.value;
	var instituicao = document.form.txtInstituicao.value;
	var ano = document.form.txtAno.value;
	var curso = document.form.cboCursos.value;
	if(curso == 0){
		alert('Informe o curso');
		document.form.cboCursos.focus();
	}
	else if(escolaridade == 0){
		alert('Informe a formação');
		document.form.cboEscolaridades.focus();
	}
	else if(instituicao == ''){
		alert('Informe a instituição');
		document.form.txtInstituicao.focus();
	}
	else if(ano == ''){
		alert('Informe a data de conclusão');
		document.form.txtAno.focus();
	}
	else{
		ajax=ajaxInit();
		document.getElementById("msg").innerHTML="Inserindo registro de formação escolar...";
	    document.getElementById('msg').style.visibility='visible';
		if(ajax){
			ajax.open('GET','?ac=inserir_formacao_escolar&id='+id+'&cboEscolaridades='+escolaridade+'&txtInstituicao='+instituicao+'&txtAno='+ano+'&cboCursos='+curso,true);
			ajax.onreadystatechange=function(){
				if(ajax.readyState==4){
					if(ajax.status==200){
						document.getElementById("msg").innerHTML="Registro de formação escolar inserido com sucesso...";
						window.parent.document.getElementById("div_formacao_escolar").innerHTML=ajax.responseText;
					}
				}
			}
		}
		setTimeout ('ocultarDiv()',3000);
		ajax.send(null);
	}
}
function excluirIdioma(id,idIdioma){
	ajax=ajaxInit();
	    document.getElementById("msg").innerHTML="Excluindo registro de idioma...";
	    document.getElementById('msg').style.visibility='visible';
	if(ajax){
		ajax.open('GET','?ac=inserir_idioma&id='+id+'&idIdioma='+idIdioma,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					document.getElementById("msg").innerHTML="Registro de idioma excluido com sucesso...";
					window.parent.document.getElementById("div_idiomas").innerHTML=ajax.responseText;
				}
			}
		}
	}
	setTimeout ('ocultarDiv()',3000);
	ajax.send(null);
}

function inserirIdioma(id){
	var idioma = document.form.cboIdiomas.value;
	var nivel = document.form.cboNiveis.value;
	if(idioma == 0){
		alert('Informe o idioma');
		document.form.cboIdiomas.focus();
	}
	else if(nivel == 0){
		alert('Informe o nível');
		document.form.cboNiveis.focus();
	}
	else{
		ajax=ajaxInit();
		document.getElementById("msg").innerHTML="Inserindo registro de idioma...";
	    document.getElementById('msg').style.visibility='visible';
		if(ajax){
			ajax.open('GET','?ac=inserir_idioma&id='+id+'&cboIdiomas='+idioma+'&cboNiveis='+nivel,true);
			ajax.onreadystatechange=function(){
				if(ajax.readyState==4){
					if(ajax.status==200){
						document.getElementById("msg").innerHTML="Registro de idioma inserido com sucesso...";
						window.parent.document.getElementById("div_idiomas").innerHTML=ajax.responseText;
					}
				}
			}
		}
		setTimeout ('ocultarDiv()',3000);
		ajax.send(null);
	}
}
function excluirCurso(id,idCurso){
	ajax=ajaxInit();
	document.getElementById("msg").innerHTML="Excluindo registro de curso suplementar...";
	document.getElementById('msg').style.visibility='visible';
	if(ajax){
		ajax.open('GET','?ac=inserir_curso&id='+id+'&idCurso='+idCurso,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					document.getElementById("msg").innerHTML="Registro de curso suplementar excluido com sucesso...";
					window.parent.document.getElementById("div_cursos").innerHTML=ajax.responseText;
				}
			}
		}
	}
	setTimeout ('ocultarDiv()',3000);
	ajax.send(null);
}

function inserirCurso(id){
	var curso = document.form.txtCursoSuplementar.value;
	var instituicao = document.form.txtInstituicaoSuplementar.value;
	var descricao = document.form.txtDescricao.value;
	var carga = document.form.txtCH.value;
	var data = document.form.txtDataConclusao.value;
	var compl = document.form.dadosCompl.value;
	if(curso == ''){
		alert('Informe o curso');
		document.form.txtCursoSuplementar.focus();
	}
	else if(instituicao == ''){
		alert('Informe a instituição');
		document.form.txtInstituicaoSuplementar.focus();
	}
	else if(descricao == ''){
		alert('Informe a descrição');
		document.form.txtDescricao.focus();
	}
	else if(carga == ''){
		alert('Informe a carga horária');
		document.form.txtCH.focus();
	}
	else if(data == ''){
		alert('Informe a data de conclusão');
		document.form.txtDataConclusao.focus();
	}
	else{
		ajax=ajaxInit();
		document.getElementById("msg").innerHTML="Inserindo registro de curso suplementar...";
		document.getElementById('msg').style.visibility='visible';
		if(ajax){
			ajax.open('GET','?ac=inserir_curso&id='+id+'&txtCursoSuplementar='+curso+'&txtInstituicaoSuplementar='+instituicao+'&txtDescricao='+descricao+'&txtCH='+carga+'&txtDataConclusao='+data+'&dadosCompl='+compl,true);
			ajax.onreadystatechange=function(){
				if(ajax.readyState==4){
					if(ajax.status==200){
						document.getElementById("msg").innerHTML="Registro de curso suplementar inserido com sucesso...";
						window.parent.document.getElementById("div_cursos").innerHTML=ajax.responseText;
					}
				}
			}
		}
		setTimeout ('ocultarDiv()',3000);
		ajax.send(null);
	}
}

function excluirInformatica(id,idDado){
	ajax=ajaxInit();
	document.getElementById("msg").innerHTML="Excluindo registro de conhecimento em informática...";
		document.getElementById('msg').style.visibility='visible';
		document.form.infoArray.value ='';
	if(ajax){
		ajax.open('GET','?ac=excluir_informatica&id='+id+'&idDado='+idDado,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					document.getElementById("msg").innerHTML="Registro de conhecimento em informática excluido com sucesso...";
					document.getElementById("div_informatica").innerHTML=ajax.responseText;
				}
			}
		}
	}
	setTimeout ('ocultarDiv()',3000);
	ajax.send(null);
}


function inserirInformatica(id){
	
	
	document.form.infoArray.value='';
		for(i=0;i<document.form.cboConhecimentos.length;i++){
			if(document.form.cboConhecimentos[i].selected){
				document.form.infoArray.value=document.form.infoArray.value+document.form.cboConhecimentos[i].value+';';				
			}
		}
	var valor = document.form.infoArray.value;
	if(document.form.infoArray.value == ''){
		alert('Informe o conhecimento que você tem');
	}
	
	else{
		document.getElementById("msg").innerHTML="Inserindo registro de conhecimento em informática...";
		document.getElementById('msg').style.visibility='visible';
		ajax=ajaxInit();
		//document.getElementById("div_informatica").innerHTML="<img  alingn=\"center\" src=\"imagens/carregando.gif\" \>";
		if(ajax){
			ajax.open('GET','?ac=inserir_informatica&id='+id+'&infoArray='+valor,true);
			ajax.onreadystatechange=function(){
				if(ajax.readyState==4){
					if(ajax.status==200){
						document.getElementById("msg").innerHTML="Registro(s) de conhecimento(s) em informática inserido(s) com sucesso...";
						document.getElementById("div_informatica").innerHTML='';
						document.getElementById("div_informatica").innerHTML=ajax.responseText;
					}
				}
			}
		}
		setTimeout ('ocultarDiv()',3000);
		ajax.send(null);
	}
}

function excluirDado(id,idDado){
	ajax=ajaxInit();
	document.getElementById("msg").innerHTML="Excluindo registro de dado profissional...";
	document.getElementById('msg').style.visibility='visible';
	if(ajax){
		ajax.open('GET','?ac=inserir_dado&id='+id+'&idDado='+idDado,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					document.getElementById("msg").innerHTML="Registro excluido com sucesso!!!";
					window.parent.document.getElementById("div_dados_profissionais").innerHTML=ajax.responseText;
				}
			}
		}
	}
	setTimeout ('ocultarDiv()',3000);
	ajax.send(null);
}

function inserirDado(id){
	var empresa = document.form.txtEmpresa.value;
	var funcao = document.form.txtFuncao.value;
	var ramo = document.form.txtRamo.value;
	var atividades = document.form.atividades.value;
	var dataAdm = document.form.txtDataAdm.value;
	var dataSaida = document.form.txtDataSaida.value;
	var salario = document.form.txtSalario.value;
		
	if(empresa == ''){
		alert('Informe a empresa');
		document.form.txtEmpresa.focus();
	}
	else if(funcao == ''){
		alert('Informe a função');
		document.form.txtFuncao.focus();
	}
	else if(ramo == ''){
		alert('Informe o ramo de atividade');
		document.form.txtRamo.focus();
	}
	else if(atividades == ''){
		alert('Informe as atividades desempenhadas');
		document.form.atividades.focus();
	}
	else if(salario == ''){
		alert('Informe o salário');
		document.form.txtSalario.focus();
	}
	else{
		document.getElementById("msg").innerHTML="Inserindo registro de dado profissional...";
		document.getElementById('msg').style.visibility='visible';
		ajax=ajaxInit();
		//document.getElementById("div_dados_profissionais").innerHTML="<img src=\"imagens/carregando.gif\" \>";
		if(ajax){
			ajax.open('GET','?ac=inserir_dado&id='+id+'&txtEmpresa='+empresa+'&txtFuncao='+funcao+'&txtRamo='+ramo+'&atividades='+atividades+'&txtDataAdm='+dataAdm+'&txtDataSaida='+dataSaida+'&txtSalario='+salario,true);
			ajax.onreadystatechange=function(){
				if(ajax.readyState==4){
					if(ajax.status==200){
						document.getElementById("msg").innerHTML="Registro inserido com sucesso!!!";
						window.parent.document.getElementById("div_dados_profissionais").innerHTML=ajax.responseText;
					}
				}
			}
		}
		setTimeout ('ocultarDiv()',3000);
		ajax.send(null);
	}
}

function salvarCadastro(id){
	if(document.form.txtNome.value == ''){
		alert('Informe o nome');
		document.form.txtNome.focus();
	}
	else if(document.form.txtCPF.value == ''){
		alert('Informe seu CPF!');
		document.form.txtCPF.focus();
	}
	else if(document.form.txtRG.value == ''){
		alert('Informe seu RG!');
		document.form.txtRG.focus();
	}
	else if(document.form.txtRG.value == ''){
		alert('Informe seu RG!');
		document.form.txtRG.focus();
	}
	else if(document.form.txtOrgaoExpRG.value == ''){
		alert('Informe o orgão expedidor do seu RG!');
		document.form.txtOrgaoExpRG.focus();
	}
	
	else if(document.form.txtEmail.value == ''){
		alert('Informe seu email!');
		document.form.txtEmail.focus();
	}
	else if(validaEmail(document.form.txtEmail.value)==false || validarEmail2(document.form.txtEmail.value)=='true'){
			alert('E-mail inválido');
			document.form.txtEmail.value = '';
	}
	else if(document.form.txtDDD1.value == '' || document.form.txtDDD1.value == 'DDD'){
		alert('Informe o DDD do seu telefone particular!');
		document.form.txtDDD1.focus();
	}
	else if(document.form.txtTel1.value == ''){
		alert('Informe seu telefone particular!');
		document.form.txtTel1.focus();
	}
	else if(document.form.txtDDD2.value == '' || document.form.txtDDD2.value == 'DDD'){
		alert('Informe o DDD do seu telefone comercial!');
		document.form.txtDDD2.focus();
	}
	else if(document.form.txtTel2.value == ''){
		alert('Informe seu telefone comercial!');
		document.form.txtTel2.focus();
	}
	else if(document.form.cboPais.value == 0){
		alert('Informe o Pais!');
		document.form.cboPais.focus();
	}
	else if(document.form.cboEstado.value == 0){
		alert('Informe o Estado!');
		document.form.cboEstado.focus();
	}
	else if(document.form.cboLocalidade.value == 0){
		alert('Informe a Localidade!');
		document.form.cboLocalidade.focus();
	}
	else if(document.form.cboBairro.value == 0){
		alert('Informe o Bairro!');
		document.form.cboBairro.focus();
	}
	else if(document.form.cboLogradouro.value == 0){
		alert('Informe o Logradouro');
		document.form.cboLogradouro.focus();
	}
	else if(document.form.txtEndereco.value == ''){
		alert('Informe o Completento!');
		document.form.txtEndereco.focus();
	}
	else{
		document.form.action='?ac=cadastrar_pessoa&idcurso='+id;
		document.form.submit();
	}
}

function validarEmail2(email){
	ajax=ajaxInit();
	var retorno = '';
	if(ajax){
		ajax.open('GET','?ac=verificar_email&email='+email,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					retorno=ajax.responseText;
					//return retorno;
				}
			}
			
		}
	} 
	ajax.send(null);
	//alert(retorno);
 return retorno;
}
function CaixaAlta(fsValor, foForm, foNome) { 
	if (window.event.keyCode >= 65 && window.event.keyCode <= 90){
		x = new String(document.forms[foForm].elements[foNome].value);
		document.forms[foForm].elements[foNome].value = x.toUpperCase();
	}
} 
function confirmarParticipacao(id){
		 if(validaEmail(document.form.txtCod.value)==false || document.form.txtCod.value=='' ){
			alert('E-mail inválido');
			document.form.txtCod.value = '';
		}
		else{
			document.form.action='?ac=participar&idcurso='+id;
			document.form.submit();
		}
}
function currencyFormat(fld, milSep, decSep, e) {
	var sep = 0;
	var key = '';
	var i = j = 0;
var len = len2 = 0;
var strCheck = '0123456789';
var aux = aux2 = '';
var whichCode = (window.Event) ? e.which : e.keyCode;
if (whichCode == 13) return true;  // Enter
key = String.fromCharCode(whichCode);  // Get key value from key code
if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
len = fld.value.length;
for(i = 0; i < len; i++)
if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
aux = '';
for(; i < len; i++)
if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
aux += key;
len = aux.length;
if (len == 0) fld.value = '';
if (len == 1) fld.value = '0'+ decSep + '0' + aux;
if (len == 2) fld.value = '0'+ decSep + aux;
if (len > 2) {
aux2 = '';
for (j = 0, i = len - 3; i >= 0; i--) {
if (j == 3) {
aux2 += milSep;
j = 0;
}
aux2 += aux.charAt(i);
j++;
}
fld.value = '';
len2 = aux2.length;
for (i = len2 - 1; i >= 0; i--)
fld.value += aux2.charAt(i);
fld.value += decSep + aux.substr(len - 2, len);
}
return false;
}

function movimentarDiv(){
	document.getElementById("banner_texto").style.top = "220px";
}

function imprimir(idpessoa,idcurso){
	ajax=ajaxInit();
	if(ajax){
		ajax.open('GET','exata?ac=set_log_pagamento&idusuario='+idpessoa+'&idcurso='+idcurso,true);
		ajax.onreadystatechange=function(){
			if(ajax.readyState==4){
				if(ajax.status==200){
					retorno=ajax.responseText;
					//return retorno;
				}
			}
			
		}
	} 
	ajax.send(null);
	document.pagamento.action='https://www16.bancodobrasil.com.br/site/mpag/';
	document.pagamento.submit();
}
function ocultarDiv(){
	document.getElementById('msg').style.visibility='hidden';
}
function cursos(ano){
	if(document.getElementById("DivConteudoCursos"+ano).style.display=="block"){
		document.getElementById("DivConteudoCursos"+ano).style.display="none";
		document.getElementById("DivIcone"+ano).innerHTML="<img src=imagens/folder_next.png>";
	}else{
		document.getElementById("DivConteudoCursos"+ano).style.display="block";
		document.getElementById("DivIcone"+ano).innerHTML="<img src=imagens/folder_down.png>";
	}
}
function fechar(){
	document.getElementById('ddestaqueinicial').style.display='none';
	document.getElementById('fade').style.display='none'
	document.getElementById('ddestaqueinicial').innerHTML="";
}