function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ajaxRequest( pagina, destino ) {
	ajaxRequest2( pagina, destino, 150 );
}
function ajaxRequest2( pagina, destino, timeout ) {
	ChamaPagina(1,"/abap/techEngine?sid=abap&command=mainSite&action=ajaxRequest&pagina=" + pagina, "document.getElementById('" + destino + "')", timeout );
}

function patrocinadores() {
	ajaxRequest('congresso_patrocinadores&menu=true', 'miolo'); 
}

function memoria() {
	ajaxRequest('congresso_memoria_publicidade&menu=true', 'miolo'); 
	pingMemoria();
}
function pingMemoria() {
	try {
		formX.pingerCongresso.value = "1";
		recolhe('submenu_memoria');
	} catch(e) {
		setTimeout("pingMemoria()", 500);
	}
}

function recolhe(mostra,mostra1,banner) {
	for(i=1;i<=15;i++){
		try {
			var t = document.getElementById('submenu_menu_paineis'+i);
			t.style.height='1px';
		}catch(e) {
		}
	}	

	try {
		document.getElementById('submenu_congresso').style.height='1px';
		document.getElementById('submenu_palestras').style.height='1px';
		document.getElementById('submenu_paineis').style.height='1px';
		document.getElementById('submenu_memoria').style.height='1px';
		document.getElementById('submenu_entidades').style.height='1px';
		document.getElementById('submenu_patrocinadores').style.height='1px';
		document.getElementById('submenu_regimento').style.height='1px';
		document.getElementById('meio').style.visibility='hidden';
	} catch (e) {
	}
	
	try {
		document.getElementById(mostra).style.height='auto';
		document.getElementById(mostra1).style.height='auto';
		document.getElementById(banner).style.visibility='visible';
	} catch (e) {
	}
}
function descricaoLogos(pagina,div){
	document.getElementById(div).style.visibility="visible";
}

function alterarDados() {
	formX.command.value = "mainSite";
	formX.action.value = "cadastroAlterar";
	formX.submit();
}
function alterarInscricao(id) {
	formX.command.value = "mainSite";
	formX.action.value = "paineisAlterar";
	formX.id.value = id;
	formX.submit();
}

function boletoNovo(id) {
	formX.command.value = "mainSite";
	formX.action.value = "novoBoleto";
	formX.id.value = id;
	formX.submit();
}

function cadastro() {
	formX.command.value = "mainSite";
	formX.action.value = "cadastro";
	
	if( validarCadastro() ) {
		formX.submit();
	}
}

function validarInscricao1() {
	try {
		if( !formX.tipoInscricao2[0].checked && 
			!formX.tipoInscricao2[1].checked && 
			!formX.tipoInscricao2[2].checked ) {
	
			alert("Selecione o tipo de inscrição");
			return false;
		}
	} catch(e) {
	}
	
	if( formX.nome.value == "" ) {
		alert("Preencha o nome");
		return false;
	}
	if( formX.sobrenome.value == "" ) {
		alert("Preencha o sobrenome");
		return false;
	}
	if( formX.nomeCracha.value == "" ) {
		alert("Preencha o nome de cracha");
		return false;
	}
	if( formX.email.value == "" ) {
		alert("Preencha o e-mail");
		return false;
	}

	try {
		if( !formX.sexo[0].checked && 
			!formX.sexo[1].checked ) {
	
			alert("Selecione o sexo");
			return false;
		}
	} catch(e) {
	}

	if( formX.dataNascimento.value == "" ) {
		alert("Preencha a data de nascimento");
		return false;
	}
	if( formX.uf.value == "" ) {
		alert("Preencha a UF");
		return false;
	}
	if( formX.cidade.value == "" ) {
		alert("Preencha a cidade");
		return false;
	}
	if( formX.ddd.value == "" ) {
		alert("Preencha o DDD");
		return false;
	}
	if( formX.telefone.value == "" ) {
		alert("Preencha o telefone");
		return false;
	}
	if( formX.pais.value == "" ) {
		alert("Selecione o país");
		return false;
	}
	if( formX.cep.value == "" ) {
		alert("Preencha o CEP");
		return false;
	}
	if( formX.endereco.value == "" ) {
		alert("Preencha o endereço");
		return false;
	}
	if( formX.pais.value == "Brasil" ) {
		if( formX.cpf.value == "" ) {
			alert("Preencha o CPF");
			return false;
		}
	}
	if( formX.profissao.value == "" ) {
		alert("Preencha a profissão");
		return false;
	}
	if( formX.filiado.value == "" ) {
		alert("Preencha a filiação à entidade");
		return false;
	}
	if( formX.senha.value.length < 6 ) {
		alert("Preencha a senha com pelo menos 6 dígitos");
		return false;
	}
	if( formX.senha.value == "" ) {
		alert("Preencha a senha");
		return false;
	}
	if( formX.senha.value != formX.senha2.value ) {
		alert("Confirme a senhas corretamente");
		return false;
	}
	if(!verifica_email(formX.email)){
		alert("Preencha o e-mail corretamente");
		return false;
	}
	if(!verifica_data(formX.dataNascimento)){
		return false;
	}

	/*	
	if( !verificaCPF(formX.cpf) ) {
		alert("Preencha o CPF corretamente");
		return false;
	}
	*/
	
	return true;
}

/*
function verificaCPF(value){
    erro  = false;
   
    value = value.replaceAll('-','');
    value = value.replaceAll('.','');
 
     var tamanho = value.length;
     for (i = 0; i < (11-tamanho); i++) {
       value = "0" + value;
     }
     soma = 0;
     num  = new Array(11);
     for (i = 0; i < 11; i++) {
       num[i] = parseInt(value.substring(i,i+1));
     }
     soma = 10*num[0] + 9*num[1] + 8*num[2] + 7*num[3] + 6*num[4] +  5*num[5] + 4*num[6] + 3*num[7] + 2*num[8];

     resto = soma % 11;

     if ((resto == 0) || (resto == 1)) {
       dv1 = 0;
     } else {
       dv1 = 11 - resto;
     }

     if (dv1 == num[9]) {
       soma = 11*num[0] + 10*num[1] + 9*num[2] + 8*num[3] + 7*num[4] + 6*num[5]  + 5*num[6]  + 4*num[7] + 3*num[8] + 2*num[9];

       resto = soma % 11;

       if ((resto == 0) || (resto == 1)) {
         dv2 = 0;
       } 
			 else {
         dv2 = 11 - resto;
       }
       if (dv2 != num[10]) {
         erro = true;
       }
     } else {
       erro = true;
     }
     
	return erro;      
}
*/

function validarInscricao2() {
	if( formX.tipoInscricao2.value == 1 ) { // profissional 
		if( formX.autonomo.checked ) {
			return true;
		}
		
		if( formX.nomeEmpresa.value == "" ) {
			alert("Preencha o nome da empresa");
			return false;
		}
		if( formX.segmento1.value == "" ) {
			alert("Preencha o segmento");
			return false;
		}
		if( formX.ufEmpresa.value == "" ) {
			alert("Preencha a UF");
			return false;
		}
		if( formX.cidadeEmpresa.value == "" ) {
			alert("Preencha a cidade");
			return false;
		}
		if( formX.dddEmpresa.value == "" ) {
			alert("Preencha o DDD");
			return false;
		}
		if( formX.telefoneEmpresa.value == "" ) {
			alert("Preencha o telefone");
			return false;
		}
		if( formX.paisEmpresa.value == "" ) {
			alert("Selecione o país");
			return false;
		}
		if( formX.cepEmpresa.value == "" ) {
			alert("Preencha o CEP");
			return false;
		}
		if( formX.paisEmpresa.value == "Brasil" ) {
			if( formX.cnpj.value == "" ) {
				alert("Preencha o CNPJ");
				return false;
			}
		}
		if( formX.enderecoEmpresa.value == "" ) {
			alert("Preencha o endereço");
			return false;
		}
		
	} else { // estudante ou professor
		if( formX.nomeInstituicao.value == "" ) {
			alert("Preencha o nome da instituição");
			return false;
		}
		if( formX.ufInstituicao.value == "" ) {
			alert("Preencha a UF");
			return false;
		}
		if( formX.cidadeInstituicao.value == "" ) {
			alert("Preencha a cidade");
			return false;
		}
		if( formX.cepInstituicao.value == "" ) {
			alert("Preencha o CEP");
			return false;
		}
		if( formX.enderecoInstituicao.value == "" ) {
			alert("Preencha o endereço");
			return false;
		}
		
		if( formX.tipoInscricao2.value == 2 ) { // professor 
			if( formX.disciplina.value == "" ) {
				alert("Preencha a disciplina");
				return false;
			}

		} else if( formX.tipoInscricao2.value == 3 ) { // estudante
			if( formX.nomeCurso.value == "" ) {
				alert("Preencha o nome do curso");
				return false;
			}
			if( formX.anoInicioCurso.value == "" ) {
				alert("Preencha o ano de início");
				return false;
			}
			if( formX.anoTerminoCurso.value == "" ) {
				alert("Preencha o ano de término");
				return false;
			}
			if( formX.numeroMatricula.value == "" ) {
				alert("Preencha o número de matrícula");
				return false;
			}

		} 
	
	}

	try {
		if( !formX.tipoInscricao[0].checked && 
			!formX.tipoInscricao[1].checked ) {
	
			alert("Selecione o tipo de inscrição");
			return false;
		}
	} catch(e) {
	}

	return true;
}

function validarInscricao3() {
	if( formX.painel1.value == "0" && formX.painel2.value == "0" && formX.painel3.value == "0" ) {
		alert("Selecione pelo menos um painel");
		return false;
	}

	return true;
}

function validarCadastro() {
	if( formX.nome.value == "" ) {
		alert("Preencha o nome");
		return false;
	}
	if( formX.sobrenome.value == "" ) {
		alert("Preencha o sobrenome");
		return false;
	}
	if( formX.email.value == "" ) {
		alert("Preencha o e-mail");
		return false;
	}
	if( formX.sexo.value == "" ) {
		alert("Preencha o sexo");
		return false;
	}
	if( formX.dataNascimento.value == "" ) {
		alert("Preencha a data de nascimento");
		return false;
	}
	if( formX.uf.value == "" ) {
		alert("Preencha a UF");
		return false;
	}
	if( formX.cidade.value == "" ) {
		alert("Preencha a cidade");
		return false;
	}
	if( formX.ddd.value == "" ) {
		alert("Preencha o DDD");
		return false;
	}
	if( formX.telefone.value == "" ) {
		alert("Preencha o telefone");
		return false;
	}
	if( formX.empresa.value == "" ) {
		alert("Preencha a empresa");
		return false;
	}
	if( formX.senha.value.length < 6 ) {
		alert("Preencha a senha com pelo menos 6 dígitos");
		return false;
	}
	if( formX.senha.value == "" ) {
		alert("Preencha a senha");
		return false;
	}
	if( formX.senha.value != formX.senha2.value ) {
		alert("Confirme a senhas corretamente");
		return false;
	}
	if(!verifica_email(formX.email)){
		alert("Preencha o e-mail corretamente");
		return false;
	}
	if(!verifica_data(formX.dataNascimento)){
		return false;
	}
	
	return true;
}

function exibirMenu(value) {
	//document.getElementById('menu_tit').innerHTML = value + "&#160;";
}

function verNoticia(idNoticia, div){
	var url = "/abap/techEngine?sid=abap&command=noticia&action=view&idNoticia="+idNoticia;
	if(div == "miolo") url += "&menu=true";
	ChamaPagina(0, url, "document.getElementById('"+div+"')", 150);
}

function verNoticiaComissao(idNoticia){
	var url = "/abap/techEngine?sid=abap&command=noticiaComissao&action=view&idNoticiaComissao="+idNoticia;
	ChamaPagina(0, url, "document.getElementById('congresso_miolo')", 150);
}

function faleConosco() {
	formX.command.value = "mainSite";
	formX.action.value = "faleConosco";
	
	if( formX.nome.value == "" ) {
		alert("Preencha o nome");
		return;
	}
	if( formX.email.value == "" ) {
		alert("Preencha o e-mail");
		return;
	}
	
	if( formX.ddd.value == "" ) {
		alert("Preencha o DDD");
		return;
	}
	if( formX.telefone.value == "" ) {
		alert("Preencha o telefone");
		return;
	}
	if( formX.empresa.value == "" ) {
		alert("Preencha a empresa");
		return;
	}
	if(!verifica_email(formX.email)){
		alert("Preencha o e-mail corretamente");
		return;
	
	}
	formX.submit();
}

/* *************************************************************
 * *						Validações  					   *
 * ************************************************************* */
function noNumber(e){
	var keynum;
	var keychar;
	var numcheck;
	
	if(window.event){ // IE
		keynum = e.keyCode;
	}else if(e.which){ // Netscape/Firefox/Opera
		keynum = e.which;
	}
	keychar = String.fromCharCode(keynum);
	numcheck = /\d/;
	return !numcheck.test(keychar);
}

function noChar(e){
	var keynum;
	var keychar;
	var numcheck;
	
	if(window.event){ // IE
		keynum = e.keyCode;
	}else if(e.which){ // Netscape/Firefox/Opera
		keynum = e.which;
	}
	
	if(keynum == 8 || keynum == 46 || keynum == null){
		return true;
	}else{
		keychar = String.fromCharCode(keynum);
		numcheck = /\D/;
		return !numcheck.test(keychar);
	}
}

function formata(campo,estilo,sonum,e) {
	if(estilo == 'cnpj')
		estilo = '##.###.###/####-##';
		
	if(estilo == 'cep')
		estilo = '#####-###';
		
	if(estilo == 'tel')
		estilo = '####-####';
		
	if(estilo == 'rg')
		estilo = '##.###.###-#';
		
	if(estilo == 'cpf')
		estilo = '###.###.###-##';
		
	if(estilo == 'data')
		estilo = '##/##/####';
		
	if(estilo == 'ie' && document.cadastro.estado.value == ""){
		document.cadastro.estado.focus();
		estilo = '#';
	}
	
	if(estilo == 'ie' && document.cadastro.estado.value == 'AC')
		estilo = '##.###.###/###-##';

	if(estilo == 'ie' && ( document.cadastro.estado.value == 'AL' || document.cadastro.estado.value == 'AP'
						|| document.cadastro.estado.value == 'CE' || document.cadastro.estado.value == 'ES'
						|| document.cadastro.estado.value == 'MA' || document.cadastro.estado.value == 'MS'
						|| document.cadastro.estado.value == 'PA' || document.cadastro.estado.value == 'PB'
						|| document.cadastro.estado.value == 'PI'))
		estilo = '##.######-#';
			
	if(estilo == 'ie' && document.cadastro.estado.value == 'AM')
		estilo = '##.###.###-#';
		
	if(estilo == 'ie' && document.cadastro.estado.value == 'BA')
		estilo = '###.###-##';
		
	if(estilo == 'ie' && document.cadastro.estado.value == 'DF')
		estilo = '##.######.###-##';

	if(estilo == 'ie' && (document.cadastro.estado.value == 'GO' || document.cadastro.estado.value == 'RN'))
		estilo = '##.###.###-#';
		
	if(estilo == 'ie' && document.cadastro.estado.value == 'MT')
		estilo = '####.######-#';
	
	if(estilo == 'ie' && document.cadastro.estado.value == 'MG')
		estilo = '###.###.###/####';
		
	if(estilo == 'ie' && (document.cadastro.estado.value == 'SP' || document.cadastro.estado.value == '0'))
		estilo = '###.###.###.###';
	
	if(estilo == 'ie' && document.cadastro.estado.value == 'PR')
		estilo = '###.#####-##';
		
	if(estilo == 'ie' && document.cadastro.estado.value == 'PE')
		estilo = '##.#.###.#######-#';
		
	if(estilo == 'ie' && document.cadastro.estado.value == 'RJ')
		estilo = '##.###.##-#';
		
	if(estilo == 'ie' && document.cadastro.estado.value == 'RS')
		estilo = '###/######-#';
		
	if(estilo == 'ie' && document.cadastro.estado.value == 'RO')
		estilo = '#############-#';
	
	if(estilo == 'ie' && (document.cadastro.estado.value == 'RR' || document.cadastro.estado.value == 'SE'))
		estilo = '########-#';
		
	if(estilo == 'ie' && document.cadastro.estado.value == 'SC')
		estilo = '###.###.###';

	if(estilo == 'ie' && document.cadastro.estado.value == 'TO')
		estilo = '##########-#';			


	var keycode;
	if(window.event)
		keycode = e.keyCode;
	else if(e.which)
		keycode = e.which;
	
	if(keycode == 8 || keycode == 46 || keycode == null){
		return true;
	}else{
		cnum = false;
		
		for(i=48;i<=57;i++){
			if(keycode == i)
				cnum = true;
		}
		
		for(i=96;i<=105;i++){
			if(keycode == i)
				cnum = false;
		}
	
		if(sonum && !cnum)
			return false;
	
		retorno = "";
	
		for(i=0;i<=campo.value.length;i++){
			if(i < estilo.length){
				if(estilo.charAt(i) == '#')
					retorno += campo.value.charAt(i);
				else
					retorno += estilo.charAt(i);
			}
			else{
				return false;
			}
		}
	
		campo.value = retorno;
	}
}

function verifica_data(txtData){
	var data = txtData.value;
	var date = new Date()
	var ano_atual = date.getFullYear();
	
	if (data.length == 0){
		return true;
	}				
	if (data.length != 10 && data.length != 0){
		alert("Preencha a DATA corretamente");
		return false;
	}
	dia = new Number(data.substring(0,2));
	mes = new Number(data.substring(3,5));
	ano = new Number(data.substring(6,10));
	situacao = "";
	
	if (data.substring(2,3) != "/" || data.substring(5,6) != "/"){
		situacao = "falsa";
	}
	// verifica o dia valido para cada mes
	if ((dia < 1)||(dia < 01 || dia > 30) && (  mes == 4 || mes == 6 || mes == 9 || mes == 11 ) || dia > 31) {
		situacao = "falsa";
	}
	// verifica se o mes e valido
	if (mes < 1 || mes > 12 ) {
		situacao = "falsa";
	}
	// verifica se e ano bissexto
	if (mes == 2 && ( dia < 1 || dia > 29 || ( dia > 28 && (parseInt(ano / 4) != ano / 4)))) {
		situacao = "falsa";
	}
	// verifica ano
	if(ano > ano_atual){
		situacao = "falsa";
	}
		
	if (situacao == "falsa") {
		alert("Preencha a data corretamente");
		return false;
	}
	
	// verifica idade
	if(ano < (ano_atual - 100)){
		alert("Data muito antiga, favor corrigir.");
		return false;
	}
	return true;
}

function verifica_email(txtEmail){
	var email = txtEmail.value;
	var regex = new RegExp("^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$");

	if(!regex.test(email))
		return false;
	
	return true;
}
/* *************************************************************
 * *						Validações  					   *
 * ************************************************************* */

function login() {
	formX.command.value = "mainSite";
	formX.action.value = "login";
	formX.submit();
}

function loginInscricao() {
	formX.command.value = "mainSite";
	formX.action.value = "loginInscricao";
	formX.submit();
}

function limparForm(form){
	for(var i = 0; i < form.length; i++){
		form[i].value = "";
	}
}

function inscricaoEdit(pagina) {
	formX.command.value = "mainSite";
	formX.action.value = "inscricaoEdit";
	formX.paginaEdit.value = pagina;
	// var query = "/abap/techEngine?" + createQueryString(formX);
	// ChamaPagina(1,query, "document.getElementById('inscricoes_miolo')", 0 );
	formX.submit();
}

function inscricao1() {
	if( validarInscricao1() ) {
		formX.command.value = "mainSite";
		formX.action.value = "inscricao1";
		// var query = "/abap/techEngine?" + createQueryString(formX);
		// ChamaPagina(1,query, "document.getElementById('inscricoes_miolo')", 0 );
		formX.submit();
	}
}

function inscricao2() {
	if( validarInscricao2() ) {
		formX.command.value = "mainSite";
		formX.action.value = "inscricao2";
		// var query = "/abap/techEngine?" + createQueryString(formX);
 		// ChamaPagina(1,query, "document.getElementById('inscricoes_miolo')", 0 );
 		formX.submit();
	}
}

function inscricao3() {
	if( validarInscricao3() ) {
		formX.command.value = "mainSite";
		formX.action.value = "inscricao3";
		formX.submit();
	}
}

function inscricaoAlterar() {
	if( validarInscricao3() ) {
		formX.command.value = "mainSite";
		formX.action.value = "inscricao3";
		// var query = "/abap/techEngine?" + createQueryString(formX);
		// ChamaPagina(1,query, "document.getElementById('congresso_miolo')", 0 );
		formX.submit();
	}
}

function reimprimirBoleto(idBoleto) {
	formX.command.value = "mainSite";
	formX.action.value = "reimprimirBoleto";
	formX.idBoleto.value = idBoleto;
	formX.submit();
}

function itau() {
	if( formItau.DC.value == "" ) {
		alert('Erro ao gerar o boleto. Favor entrar em contato com os organizadores do evento');	
	} else {
		formItau.submit();
	}
}

function itau2() {
	formItau2.submit();
}

function carregabrw() {
	window.open("\\","SHOPLINE","toolbar=yes,menubar=yes,resizable=yes,status=no,scrollbars=yes,width=675,height=485");
}

function inscricaoVarios(ultimo) {
	try {
		if( formX.nome.value == "" ) {
			alert("Preencha o nome");
			return;
		}
		if( formX.nomeCracha.value == "" ) {
			alert("Preencha o nome para o crachá");
			return;
		}
		if( formX.email.value == "" ) {
			alert("Preencha o e-mail");
			return;
		}
		if( formX.ddd.value == "" ) {
			alert("Preencha o DDD");
			return;
		}
		if( formX.telefone.value == "" ) {
			alert("Preencha o telefone");
			return;
		}
		if(!verifica_email(formX.email)){
			alert("Preencha o e-mail corretamente");
			return;
		}
	
		if( validarInscricao3() ) {
			if( ultimo ) {
				formX.command.value = "mainSite";
				formX.action.value = "inscricaoVarios";
				formX.submit();
			
			} else {
				formX.command.value = "mainSite";
				formX.action.value = "inscricaoVarios";
				// var query = "/abap/techEngine?" + createQueryString(formX);
				// ChamaPagina(1,query, "document.getElementById('inscricoes_miolo')", 0 );
				formX.submit();
			}
		}
	} catch(e) {
		formX.command.value = "mainSite";
		formX.action.value = "inscricaoVarios";
		formX.submit();
	}
	
}

function deleteInscricao(id) {
	formX.command.value = "mainSite";
	formX.action.value = "inscricaoDelete";
	var query = "/abap/techEngine?idInscricaoPainel=" + id + "&" + createQueryString(formX);
	ChamaPagina(1,query, "document.getElementById('inscricoes_miolo')", 0 );
}

function calcularValor() {
	if( formX.tipoInscricao2.value == 1 ) { // profissionais
		if( formX.ufEmpresa.value == "SP" || formX.ufEmpresa.value == "--" ) {
			formX.valorFinal.value = (formX.valorInscricaoPadrao.value * formX.quantidadeInscricoes.value) + ",00";
	
		} else { // NÃO É DE 'SP' e NÃO É DE 'FORA DO BRASIL'
			formX.valorFinal.value = (formX.valorInscricaoDesconto.value * formX.quantidadeInscricoes.value) + ",00";
		}
	
	} else { // estudantes e professores
		formX.valorFinal.value = (900 * formX.quantidadeInscricoes.value) + ",00";
	
	}
}

function checkAutonomo(total) {
	if( formX.autonomo.checked ) {
		document.getElementById("empresa").style.height = "1px";
		formX.ufEmpresa.value = formX.ufPessoal.value;
		calcularValor();
		
	} else {
		if( total ) {
			document.getElementById("empresa").style.height = "auto";
			formX.ufEmpresa.value = "";
			calcularValor();
		} else {
			document.getElementById("empresa").style.height = "auto";
			calcularValor();
		}
	}
}

function changeInscricao(tipo) {
	if( tipo == '2' || tipo == '3' ) {
		document.getElementById('associadoEntidade').style.height='1px';
		formX.filiado.value='NENHUMA';
		formX.profissao.value=' ';
	} else {
		document.getElementById('associadoEntidade').style.height='auto';
	}
}

function showMenuCongresso(submenu) {
	ajaxRequest2('menu_congresso','menu_lateral',500);
	pingMenuCongressoPaineis(submenu);
}

function pingMenuCongressoPaineis(submenu) {
	try {
		formX.pingerMenuCongresso.value = "1";
		recolhe('submenu_paineis','meio');
		exibirMenu(': comissões');
		recolhe('submenu_paineis','submenu_menu_paineis'+submenu);
	} catch(e) {
		setTimeout("pingMenuCongressoPaineis(" + submenu + ")", 500);
	}
}

function salvarDadosMalaDireta() {
	formX.command.value = "mainSite";
	formX.action.value = "salvarDadosMalaDireta";
	formX.submit();
}

function exibirFoto(value) {
	desabilitarTela();
	document.getElementById("fotoDiv").style.visibility="visible";
	
	var url = "/abap/techEngine?sid=abap&command=mainSite&action=ajaxViewFoto";
	url += "&idFoto=" + value;
	ChamaPagina(1, url, "document.getElementById('fotoDiv')", 0 );
}

function exibirFotoPing(value) {
	try {
		formX.pingerFoto.value = "1";
		exibirFoto(value);
	} catch(e) {
		setTimeout("exibirFotoPing(" + value + ")", 500);
	}
}


function fecharFoto(value){
	document.getElementById("fotoDiv").style.visibility="hidden";
	habilitarTela();
}

function navegacaoFoto(id, navegacao){
	var url = "/abap/techEngine?sid=abap&command=mainSite&action=ajaxViewFoto";
	url += "&idFoto=" + id;
	
	if(navegacao == "avancar"){
		url += "&idFotoAnterior=" + formX.idFotoAtual;	
	}else if(navegacao == "voltar"){
		url += "&idFotoProxima=" + formX.idFotoAtual;
	}
	ChamaPagina(1,url, "document.getElementById('fotoDiv')", 0 );
}

function alternarAba(aba){
	var fotos = document.getElementById("fotos");
	var videos = document.getElementById("videos");
	var cores = document.getElementById("cores");
	
	if(aba == "fotos"){
		videos.style.display = "none";
		videos.style.height = "0px";
		cores.style.backgroundColor = "#566487";
		fotos.style.display = "block";
		fotos.style.height = "313px";
	}else{
		fotos.style.display = "none";
		fotos.style.height = "0px";
		cores.style.backgroundColor = "#7D91C3";
		videos.style.display = "block";
		videos.style.height = "313px";
	}
}