﻿		function fncValidaCamposFormularioInscricaoBST() {
			
			d = document.frmInscricao;
			
/*			if (d.valorSemi1.value.length > 0) {				
				alert('Seminário OK ');				
				return (true);
				d.submit();
			
			}*/
			
			
			
			if (d.txtNome.value.length == 0) {
					alert("Preencha o campo Nome, antes de prosseguir.");
					d.txtNome.focus();
					return (false);					
				}

			if (d.txtCPF.value.length == 0) {
					alert("Preencha o campo CPF, antes de prosseguir.");
					d.txtCPF.focus();
					return (false);					
				}	
				
			if (!fncValidaCPF(d.txtCPF.value)) {
					alert("Preencha o campo CPF corretamente (CPF Válido), antes de prosseguir.");
					d.txtCPF.focus();
					return (false);								
			}

			if (d.txtEmail.value.length == 0) {
					alert("Preencha o campo E-mail, antes de prosseguir.");
					d.txtEmail.focus();
					return (false);					
				}		
				
			if (d.txtEmail.value.indexOf('@')==-1 || d.txtEmail.value.indexOf('.')==-1) {
					alert("Preencha o campo E-mail corretamente, antes de prosseguir.");
					d.txtEmail.focus();
					return (false);					
				}	
				
			if (!d.cicloPalestra.checked){
					alert("É necessário selecionar o Ciclo de  Palestras antes de prosseguir!");
					d.cicloPalestra.focus();
					return false;
			 }				
			 
			if (!d.chkAceiteTermos.checked){
					alert("É necessário ler e aceitar o Termo de Aceitação antes de prosseguir!");
					d.chkAceiteTermos.focus();
					return false;
			 }				 		 				 
			
			d.submit();
		}		


function controlaCamada() { 
		if (document.getElementById('popUpHome').style.visibility == "hidden" ) { 
			document.getElementById('popUpHome').style.visibility = "visible"; 
		} else { 
			document.getElementById('popUpHome').style.visibility = "hidden"; 
		} 
	} 

	function ocultaListaHoteis(idCampo){		
			document.getElementById(idCampo).className = "hideDiv";				
		}	

	function exibeListaHoteis(idCampo){		
			document.getElementById(idCampo).className = "showDiv";				
		}	


	function openWindowsOEvento() {
			window.open("http://www.fitnessbh.com.br/oEvento.php", '', '', '', '', '', '', '', '', '');
		}


	function openWindowsWED() {
			window.open("http://www.fitnessbh.com.br/wellnessEducationTour.php", '', '', '', '', '', '', '', '', '');
		}

	function fncInsereValorSeminario() {
			if (document.getElementById('wellnessEdTour').checked ) {
					document.getElementById('valorSemi1').value = 'R$ 80,00';
					document.getElementById('valorSemi1').className = 'inputControl';
					document.getElementById('valorSemi2').value = 'R$ 80,00';
					document.getElementById('valorSemi2').className = 'inputControl';
					document.getElementById('valorSemi3').value = 'R$ 45,00';
					document.getElementById('valorSemi3').className = 'inputControl';
					document.getElementById('valorSemi4').value = 'R$ 45,00';
					document.getElementById('valorSemi4').className = 'inputControl';
					document.getElementById('valorSemi5').value = 'R$ 90,00';
					document.getElementById('valorSemi5').className = 'inputControl';
					document.getElementById('valorSemi6').value = 'R$ 100,00';
					document.getElementById('valorSemi6').className = 'inputControl';
			} else 
			{
					document.getElementById('valorSemi1').className  = 'inputControlSeminario';
					document.getElementById('valorSemi1').value = '';
					document.getElementById('valorSemi2').className  = 'inputControlSeminario';
					document.getElementById('valorSemi2').value = '';
					document.getElementById('valorSemi3').className  = 'inputControlSeminario';
					document.getElementById('valorSemi3').value = '';
					document.getElementById('valorSemi4').className  = 'inputControlSeminario';
					document.getElementById('valorSemi4').value = '';
					document.getElementById('valorSemi5').className  = 'inputControlSeminario';
					document.getElementById('valorSemi5').value = '';
					document.getElementById('valorSemi6').className  = 'inputControlSeminario';
					document.getElementById('valorSemi6').value = '';
				
			}		
		}

	function openWindowsAtivoDotCom() {
			window.open("http://www.ativo.com", '', '', '', '', '', '', '', '', '');
		}

	function openWindowsIndtech() {
			window.open("http://www.indtech.com.br", '', '', '', '', '', '', '', '', '');
		}


	function fncAbreJanelaOrkut() {
			window.open("http://www.orkut.com.br/Main#Community.aspx?cmm=91708674", '', '', '', '', '', '', '', '', '');
		}
		
	function fncAbreJanelaFlickr() {
			window.open("http://www.flickr.com/photos/fitnessbh", '', '', '', '', '', '', '', '', '');
		}		

	function fncAbreJanelaTwitter() {
			window.open("http://twitter.com/fitnessbh", '', '', '', '', '', '', '', '', '');
		}		

	function fncAbreJanelaBlog() {
			window.open("http://fitnessbh.wordpress.com/", '', '', '', '', '', '', '', '', '');
		}		


	function fncAbreChatAoVivo() {
			window.open("chatFitness.php" , 'ffa', 'top=200,left=400,width=270,height=365','toolbar=no,scrollbars=no,resizable=no');
		}

	function PopupImage(img) {
		title="Edições Anteriores - FitnessBH - Fotos";
		w=open("",'imagen','top=200,left=400,width=290,height=410','toolbar=no,scrollbars=no,resizable=no,');
		w.document.write("<HTML><HEAD><TITLE>"+title+"</TITLE></HEAD>");
		w.document.write("<script language=javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+10,document.images[0].height+30); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>");
		w.document.write("<BODY onload='checksize()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
		w.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");
		w.document.write("<TD valign='middle' align='center'><IMG src='"+img+"' border=0 alt='FitnessBH 6ª Edição - Fotos'>");
		w.document.write("</TD></TR></TABLE>");
		w.document.write("</BODY></HTML>");
		w.document.close();
	}

	function fncAbreFlickr() {
			window.open('http://www.flickr.com/photos/fitnessbh/', '', '', '', '', '', '', '', '', '');
		}
		
		function fncAbreCvProfessor(idProf){
		
			if (idProf == 1) { window.open('professores.php#cvLuizDomingues', '', '', '', '', '', '', '', '', ''); }

			if (idProf == 2) { window.open('professores.php#cvAlexandreMachado', '', '', '', '', '', '', '', '', ''); }

			if (idProf == 3) { window.open('professores.php#cvThaisGomes', '', '', '', '', '', '', '', '', '');	}
			
			if (idProf == 4) { window.open('professores.php#cvLeonardoB', '', '', '', '', '', '', '', '', '');	}		
			 
			if (idProf == 5) { window.open('professores.php#cvArmandoA', '', '', '', '', '', '', '', '', ''); }	
			
			if (idProf == 6) { window.open('professores.php#cvFabricioMadureira', '', '', '', '', '', '', '', '', ''); }	
			
			if (idProf == 7) { window.open('professores.php#cvMariaAparecida', '', '', '', '', '', '', '', '', ''); }

			if (idProf == 8) { window.open('professores.php#cvKatiaAlbano', '', '', '', '', '', '', '', '', ''); }	
			
			if (idProf == 9) { window.open('professores.php#cvKenjiT', '', '', '', '', '', '', '', '', ''); }		
			
			if (idProf == 10) { window.open('professores.php#cvVeraLucia', '', '', '', '', '', '', '', '', ''); }				
			
			if (idProf == 11) { window.open('professores.php#cvLuizDidiu', '', '', '', '', '', '', '', '', ''); }				

			if (idProf == 12) { window.open('professores.php#cvWaldirSoares', '', '', '', '', '', '', '', '', ''); }				

			if (idProf == 13) { window.open('professores.php#cvJorgeGoncalves', '', '', '', '', '', '', '', '', ''); }				
			
			if (idProf == 14) { window.open('professores.php#cvBrucce', '', '', '', '', '', '', '', '', ''); }				

			if (idProf == 15) { window.open('professores.php#cvClaudiaBarsand', '', '', '', '', '', '', '', '', ''); }				

}	

	function fncAbreCongressoCientifico() {
			window.open('congressoCientifico.php', '', '', '', '', '', '', '', '', '');
		}

	function fncAbreComoChegar() {			
			window.open('comoChegar.php', '', '', '', '', '', '', '', '', '');
		}

		function fncAbreFaleConosco() {			
			window.open('faleConosco.php', '', '', '', '', '', '', '', '', '');
		}

		function fncAbreJanelaMaxSavassi() {			
			window.open('http://www.maxsavassi.com.br/?fonte=siteFitnessBH', '', '', '', '', '', '', '', '', '');
		}

		function fncAbreJanelaPrefeituraBH() {			
			window.open('http://www.pbh.gov.br/?fonte=siteFitnessBH', '', '', '', '', '', '', '', '', '');
		}
		
	function validaFormIndiqueUmAmigo()
		{
			if (document.getElementById('txtNomeIndicador').value.length == 0) {
					alert("Preencha o Seu Nome, antes de prosseguir.");
					document.frmIndicaAmigo.txtNomeIndicador.focus();
					return (false);					
				}
			
			if (document.getElementById('txtEmailIndicador').value.length == 0) {
					alert("Preencha o Seu E-mail, antes de prosseguir.");
					document.frmIndicaAmigo.txtEmailIndicador.focus();
					return (false);					
				}		
			
			
			if (document.getElementById('txtEmailIndicador').value=="" || document.getElementById('txtEmailIndicador').value.indexOf('@')==-1 || 
				document.getElementById('txtEmailIndicador').value.indexOf('.')==-1) {
					alert("Preencha o Seu E-mail corretamente, antes de prosseguir.");
					document.frmIndicaAmigo.txtEmailIndicador.focus();
					return (false);					
				}		
				
				
			if (document.getElementById('txtNomeAmigo').value.length == 0) {
					alert("Preencha o Nome do seu Amigo, antes de prosseguir.");
					document.frmIndicaAmigo.txtNomeAmigo.focus();
					return (false);					
				}

			if (document.getElementById('txtEmailAmigo').value.length == 0) {
					alert("Preencha o E-mail do seu Amigo, antes de prosseguir.");
					document.frmIndicaAmigo.txtEmailAmigo.focus();
					return (false);					
				}						

			if (document.getElementById('txtEmailAmigo').value=="" || document.getElementById('txtEmailAmigo').value.indexOf('@')==-1 || 
				document.getElementById('txtEmailAmigo').value.indexOf('.')==-1) {
					alert("Preencha o E-mail do seu Amigo corretamente, antes de prosseguir.");
					document.frmIndicaAmigo.txtEmailAmigo.focus();
					return (false);					
				}		

			if (document.getElementById('txtMensagem').value.length == 0) {
					alert("Insira algum comentário, antes de prosseguir.");
					document.frmIndicaAmigo.txtMensagem.focus();
					return (false);					
				}	
			document.frmIndicaAmigo.submit();			
		}

	function alteraFormatoTituloCurso(idElemento){
			document.getElementById(idElemento).className = "spanCursosTituloMouseOver";	
		}
		
		function retornaFormatoTituloOriginal(idElemento){		
			document.getElementById(idElemento).className = "fonteAzulNegrito";				
		}

		function exibeCurso(idElemento){		
			document.getElementById(idElemento).className = "showDiv conteudoCurso";				
		}	
		
		function ocultaCurso(idElemento){		
			document.getElementById(idElemento).className = "hideDiv conteudoCurso";				
		}	

		function exibeCurriculum(idElemento){		
			document.getElementById(idElemento).className = "showDiv divCurriculum";				
		}	
		
		function ocultaCurriculum(idElemento){		
			document.getElementById(idElemento).className = "hideDiv divCurriculum";				
		}						


	function fncValidaCPF (cpf) {
  
	// remove da string os caracteres "." e "-"	
	cpf = cpf.replace(/[\.-]/g, "");

	if (cpf.length < 11) return false;

	if (cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333"
		|| cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777"
		|| cpf == "88888888888" || cpf == "99999999999") 

	return false;
	
	var i;
	s = cpf;
	var c = s.substr(0,9);
	var dv = s.substr(9,2);
	var d1 = 0;
	
		for (i = 0; i < 9; i++) {
				d1 += c.charAt(i)*(10-i);
			}

		if (d1 == 0) {
			return false;
		}
	 
		d1 = 11 - (d1 % 11);
	 
		if (d1 > 9) d1 = 0;
	 
		if (dv.charAt(0) != d1) {
			return false;
		}
	return true;
	}
		
		
		function fncLimpaValores() {
					document.frmInscricao.valorInsc1.value = '';
					document.frmInscricao.valorInsc2.value = '';
					document.frmInscricao.valorInsc3.value = '';
					document.frmInscricao.valorInsc4.value = '';
					document.frmInscricao.valorInsc5.value = '';
					document.frmInscricao.valorInsc6.value = '';	
				}
		
		function fncCalculaValoresInscricao() {

					d = document.frmInscricao;
						
					txtValInsc1 = document.getElementById('valorInsc1');
					txtValInsc2 = document.getElementById('valorInsc2');
					txtValInsc3 = document.getElementById('valorInsc3');
					txtValInsc4 = document.getElementById('valorInsc4');
					txtValInsc5 = document.getElementById('valorInsc5');
					txtValInsc6 = document.getElementById('valorInsc6');
					
					if (!d.cursoNoite[0].checked &&!d.cursoManha[0].checked && !d.cursoManha[1].checked && !d.cursoManha[2].checked && !d.cursoManha[3].checked 
						&& !d.cursoManha[4].checked && !d.cursoTarde[0].checked && !d.cursoTarde[1].checked && !d.cursoTarde[2].checked && !d.cursoTarde[3].checked 
						&& !d.cursoTarde[4].checked){
							alert("Escolha ao menos um curso antes de realizar o cálculo do Valor da Inscrição!")
							return false;
					 }
					 
					//Somente curso da noite (OK)
					if (d.cursoNoite[0].checked &&!d.cursoManha[0].checked && !d.cursoManha[1].checked && !d.cursoManha[2].checked && !d.cursoManha[3].checked 
						&& !d.cursoManha[4].checked && !d.cursoTarde[0].checked && !d.cursoTarde[1].checked && !d.cursoTarde[2].checked && !d.cursoTarde[3].checked 
						&& !d.cursoTarde[4].checked){					
							fncLimpaValores();
							txtValInsc1.value = '60,00';
							txtValInsc2.value = '40,00';
							txtValInsc3.value = '40,00';
							txtValInsc4.value = '40,00';
							txtValInsc5.value = '80,00';
							txtValInsc6.value = '90,00';			
					}
			
			
					//Somente curso da manha - Hidroginastica (OK)
					if (d.cursoManha[0].checked && !d.cursoManha[1].checked && !d.cursoManha[2].checked && !d.cursoManha[3].checked 
						&& !d.cursoManha[4].checked && !d.cursoTarde[0].checked && !d.cursoTarde[1].checked && !d.cursoTarde[2].checked && !d.cursoTarde[3].checked 
						&& !d.cursoTarde[4].checked){
							fncLimpaValores();
							txtValInsc1.value = '110,00';
							txtValInsc2.value = '120,00';
							txtValInsc3.value = '70,00';
							txtValInsc4.value = '70,00';
							txtValInsc5.value = '140,00';
							txtValInsc6.value = '150,00';			
					}
					
					//Somente curso da manha - Treinamento de Força Aplicado (OU) Massagem e Sensibilidade (OU) Formação de Talentos
					if ((d.cursoManha[1].checked || d.cursoManha[2].checked || d.cursoManha[4].checked) && !d.cursoManha[0].checked && 
						!d.cursoManha[3].checked && !d.cursoTarde[0].checked && !d.cursoTarde[1].checked && !d.cursoTarde[2].checked && !d.cursoTarde[3].checked && 
						!d.cursoTarde[4].checked){					
							fncLimpaValores();
							txtValInsc1.value = '110,00';
							txtValInsc2.value = '120,00';
							txtValInsc3.value = '65,00';
							txtValInsc4.value = '65,00';
							txtValInsc5.value = '130,00';
							txtValInsc6.value = '140,00';			
					}	
					
					//Somente curso da manha - Prát. Corporais nas Empresas (OK)
					if (!d.cursoManha[0].checked && !d.cursoManha[1].checked && !d.cursoManha[2].checked && d.cursoManha[3].checked && !d.cursoManha[4].checked && 
						!d.cursoTarde[0].checked && !d.cursoTarde[1].checked && !d.cursoTarde[2].checked && !d.cursoTarde[3].checked && !d.cursoTarde[4].checked){					
							fncLimpaValores();
							txtValInsc1.value = '100,00';
							txtValInsc2.value = '110,00';
							txtValInsc3.value = '60,00';
							txtValInsc4.value = '60,00';
							txtValInsc5.value = '120,00';
							txtValInsc6.value = '130,00';					
					}		
					
					//Somente curso da tarde - Qualquer um (OK)
					if ((!d.cursoManha[0].checked && !d.cursoManha[1].checked && !d.cursoManha[2].checked && !d.cursoManha[3].checked && !d.cursoManha[4].checked) && 
						(d.cursoTarde[0].checked || d.cursoTarde[1].checked || d.cursoTarde[2].checked || d.cursoTarde[3].checked || d.cursoTarde[4].checked)) {					
							fncLimpaValores();
							txtValInsc1.value = '110,00';
							txtValInsc2.value = '120,00';
							txtValInsc3.value = '65,00';
							txtValInsc4.value = '65,00';
							txtValInsc5.value = '130,00';
							txtValInsc6.value = '140,00';	
					}				
															
					//Hidroginastica (manha) e curso da tarde - Qualquer um (OK)
					if ((d.cursoManha[0].checked && !d.cursoManha[1].checked && !d.cursoManha[2].checked && !d.cursoManha[3].checked && !d.cursoManha[4].checked) && 
						(d.cursoTarde[0].checked || d.cursoTarde[1].checked || d.cursoTarde[2].checked || d.cursoTarde[3].checked || d.cursoTarde[4].checked)) {					
							fncLimpaValores();
							txtValInsc1.value = '220,00'; // 110,00 (manha) + 110,00 (noite)
							txtValInsc2.value = '240,00'; // 120,00 (manha) + 120,00 (noite)
							txtValInsc3.value = '135,00'; // 70,00 (manha) + 65,00 (noite)
							txtValInsc4.value = '135,00'; // 70,00 (manha) + 65,00 (noite)
							txtValInsc5.value = '270,00'; // 140,00 (manha) + 130,00 (noite)
							txtValInsc6.value = '290,00';	// 150,00 (manha) + 140,00 (noite)
					}				
															
					//Treinamento de Força Aplicado (1) (OU) Massagem e Sensibilidade (2) (OU) Formação de Talentos (4) (manha) e curso da tarde - Qualquer um
					if ((d.cursoManha[1].checked || d.cursoManha[2].checked || d.cursoManha[4].checked) && !d.cursoManha[0].checked && 
						!d.cursoManha[3].checked && (d.cursoTarde[0].checked || d.cursoTarde[1].checked || d.cursoTarde[2].checked || d.cursoTarde[3].checked || 
						d.cursoTarde[4].checked)){			
							fncLimpaValores();
							txtValInsc1.value = '220,00'; // 110,00 (manha) + 110,00 (noite)
							txtValInsc2.value = '240,00'; // 120,00 (manha) + 120,00 (noite)
							txtValInsc3.value = '130,00'; // 65,00 (manha) + 65,00 (noite)
							txtValInsc4.value = '130,00'; // 65,00 (manha) + 65,00 (noite)
							txtValInsc5.value = '260,00'; // 130,00 (manha) + 130,00 (noite)
							txtValInsc6.value = '280,00';	// 140,00 (manha) + 140,00 (noite)			
					}	
					
					//Prát. Corporais nas Empresas (Manhã) e qualquer curso da tarde
					if ((!d.cursoManha[0].checked && !d.cursoManha[1].checked && !d.cursoManha[2].checked && !d.cursoManha[4].checked) && d.cursoManha[3].checked && 
						(d.cursoTarde[0].checked || d.cursoTarde[1].checked || d.cursoTarde[2].checked || d.cursoTarde[3].checked || d.cursoTarde[4].checked)){					
							fncLimpaValores();
							txtValInsc1.value = '210,00';  // 100,00 (manhã) +  110,00 (tarde)
							txtValInsc2.value = '230,00';	// 110,00 (manhã) +  120,00 (tarde)
							txtValInsc3.value = '125,00';	// 60,00 (manhã) +  65,00 (tarde)
							txtValInsc4.value = '125,00';	// 60,00 (manhã) +  65,00 (tarde)
							txtValInsc5.value = '250,00';	// 120,00 (manhã) +  130,00 (tarde)
							txtValInsc6.value = '270,00';	// 130,00 (manhã) +  140,00 (tarde)	
					}				
		}	
		

		function fncValidaCamposFormularioInscricao() {
			
			d = document.frmInscricao;
			
			if (d.txtNome.value.length == 0) {
					alert("Preencha o campo Nome, antes de prosseguir.");
					d.txtNome.focus();
					return (false);					
				}

			if (d.txtCPF.value.length == 0) {
					alert("Preencha o campo CPF, antes de prosseguir.");
					d.txtCPF.focus();
					return (false);					
				}	
				
			if (!fncValidaCPF(d.txtCPF.value)) {
					alert("Preencha o campo CPF corretamente (CPF Válido), antes de prosseguir.");
					d.txtCPF.focus();
					return (false);								
			}

			if (d.txtEmail.value.length == 0) {
					alert("Preencha o campo E-mail, antes de prosseguir.");
					d.txtEmail.focus();
					return (false);					
				}		
				
			if (d.txtEmail.value.indexOf('@')==-1 || d.txtEmail.value.indexOf('.')==-1) {
					alert("Preencha o campo E-mail corretamente, antes de prosseguir.");
					d.txtEmail.focus();
					return (false);					
				}					

			if ((!d.cursoNoite[0].checked &&!d.cursoManha[0].checked && !d.cursoManha[1].checked && !d.cursoManha[2].checked && !d.cursoManha[3].checked 
				&& !d.cursoManha[4].checked && !d.cursoTarde[0].checked && !d.cursoTarde[1].checked && !d.cursoTarde[2].checked && !d.cursoTarde[3].checked 
				&& !d.cursoTarde[4].checked) && !d.valorSemi1.value.length > 0){
					alert("Escolha ao menos um Curso antes de prosseguir.!");
					d.cursoManha[0].focus();
					return false;
			 }		
			 
			if (!d.formaPagamento[0].checked && !d.formaPagamento[1].checked){
					alert("Escolha uma Forma de Pagamento antes de prosseguir.!");
					d.formaPagamento[0].focus();
					return false;
			 }		
			 
			if (!d.meioPagamento[0].checked && !d.meioPagamento[1].checked){
					alert("Escolha um Meio de Pagamento antes de prosseguir.!");
					d.meioPagamento[0].focus();
					return false;
			 }	
			 
			if ((d.valorInsc1.value.length == 0 && d.valorInsc2.value.length == 0 && d.valorInsc3.value.length == 0 && d.valorInsc3.value.length == 0 &&
				d.valorInsc4.value.length == 0 && d.valorInsc5.value.length == 0 && d.valorInsc6.value.length == 0) && !d.valorSemi1.value.length > 0){
					alert("Calcule os valores da inscrição do(s) curso(s) antes de prosseguir!");
					d.btnCalcularValoresInscricao.focus();
					return false;
			 }		
			 
			if (!d.chkAceiteTermos.checked){
					alert("É necessário ler e aceitar o Termo de Aceitação antes de prosseguir!");
					d.chkAceiteTermos.focus();
					return false;
			 }				 		 
			 


			if ((d.valorInsc1.value.length == 0 && d.valorInsc2.value.length == 0 && d.valorInsc3.value.length == 0 && d.valorInsc3.value.length == 0 &&
				d.valorInsc4.value.length == 0 && d.valorInsc5.value.length == 0 && d.valorInsc6.value.length == 0) &&

				(d.cursoNoite[0].checked || d.cursoManha[0].checked || d.cursoManha[1].checked || d.cursoManha[2].checked || d.cursoManha[3].checked 
				|| d.cursoManha[4].checked || d.cursoTarde[0].checked || d.cursoTarde[1].checked || d.cursoTarde[2].checked || d.cursoTarde[3].checked 
				|| d.cursoTarde[4].checked))
				
				{
			
					alert("Calcule os valores da inscrição do(s) curso(s) antes de prosseguir!");
					d.btnCalcularValoresInscricao.focus();
					return false;
			 }				 
			 			 
			 
			
			d.submit();
		}		



	function exibeAjudaInscricao(idElemento){		
			document.getElementById(idElemento).className = "showDiv conteudoAjudaInscricao";				
		}	
		
		function ocultaAjudaInscricao(idElemento){		
			document.getElementById(idElemento).className = "hideDiv conteudoAjudaInscricao";				
		}

	function clearTextAreaContact()
		{
			document.getElementById('txtMensagem').value = "";
		}

	function counterUpdate(opt_countedTextBox, opt_countBody, opt_maxSize) 
		{ 
		var countedTextBox = opt_countedTextBox ? opt_countedTextBox : "counttxt"; 
		var countBody = opt_countBody ? opt_countBody : "countBody"; 
		var maxSize = opt_maxSize ? opt_maxSize : 2000; 
		
		var field = document.getElementById(countedTextBox); 
		
		if (field && field.value.length >= maxSize) { 
			field.value = field.value.substring(0, maxSize); 
		} 
		var txtField = document.getElementById(countBody); 
		if (txtField) { 
		txtField.innerHTML = field.value.length; 
		} 
	} 

	function fncAbrirJanelaCursos(){
		window.open('cursos.php', '', '', '', '', '', '', '', '', '');
	}	
	
	function clearTextAreaContact(){
			document.getElementById('txtMensagem').value = "";
	}

	function validaFormContact()
		{
			if (document.getElementById('txtNome').value.length == 0) {
					alert("Preencha o campo Nome, antes de prosseguir.");
					document.frmContato.txtNome.focus();
					return (false);					
				}
			if (document.getElementById('txtEmail').value.length == 0) {
					alert("Preencha o campo E-mail, antes de prosseguir.");
					document.frmContato.txtEmail.focus();
					return (false);					
				}		

			if (document.getElementById('txtEmail').value=="" || document.getElementById('txtEmail').value.indexOf('@')==-1 || 
				document.getElementById('txtEmail').value.indexOf('.')==-1) {
					alert("Preencha o campo E-mail corretamente, antes de prosseguir.");
					document.frmContato.txtEmail.focus();
					return (false);					
				}		

			if (document.getElementById('txtAssunto').selectedIndex == 0) {
					alert("Preencha o campo Assunto, antes de prosseguir.");
					document.getElementById('txtAssunto').focus();
					return (false);					
				}	
			if (document.getElementById('txtMensagem').value.length == 0) {
					alert("Preencha o campo Mensagem, antes de prosseguir.");
					document.getElementById('txtMensagem').focus();
					return (false);					
				}		
			document.frmContato.submit();				
		}
		
		
	function mascara(o,f){
		v_obj=o
		v_fun=f
		setTimeout("execmascara()",1)
	}
	 
	function execmascara(){
		v_obj.value=v_fun(v_obj.value)
	}
	 
	function leech(v){
		v=v.replace(/o/gi,"0")
		v=v.replace(/i/gi,"1")
		v=v.replace(/z/gi,"2")
		v=v.replace(/e/gi,"3")
		v=v.replace(/a/gi,"4")
		v=v.replace(/s/gi,"5")
		v=v.replace(/t/gi,"7")
		return v
	}
	 
	function soNumeros(v){
		return v.replace(/\D/g,"")
	}
	 
	function telefone(v){
		v=v.replace(/\D/g,"")                 //Remove tudo o que não é dígito
		v=v.replace(/^(\d\d)(\d)/g,"($1) $2") //Coloca parênteses em volta dos dois primeiros dígitos
		v=v.replace(/(\d{4})(\d)/,"$1-$2")    //Coloca hífen entre o quarto e o quinto dígitos
		return v
	}
	 
	function cpf(v){
		v=v.replace(/\D/g,"")                    //Remove tudo o que não é dígito
		v=v.replace(/(\d{3})(\d)/,"$1.$2")       //Coloca um ponto entre o terceiro e o quarto dígitos
		v=v.replace(/(\d{3})(\d)/,"$1.$2")       //Coloca um ponto entre o terceiro e o quarto dígitos
												 //de novo (para o segundo bloco de números)
		v=v.replace(/(\d{3})(\d{1,2})$/,"$1-$2") //Coloca um hífen entre o terceiro e o quarto dígitos
		return v
	}
	 
	function cep(v){
		v=v.replace(/D/g,"")                //Remove tudo o que não é dígito
		v=v.replace(/^(\d{5})(\d)/,"$1-$2") //Esse é tão fácil que não merece explicações
		return v
	}
	 
	function cnpj(v){
		v=v.replace(/\D/g,"")                           //Remove tudo o que não é dígito
		v=v.replace(/^(\d{2})(\d)/,"$1.$2")             //Coloca ponto entre o segundo e o terceiro dígitos
		v=v.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3") //Coloca ponto entre o quinto e o sexto dígitos
		v=v.replace(/\.(\d{3})(\d)/,".$1/$2")           //Coloca uma barra entre o oitavo e o nono dígitos
		v=v.replace(/(\d{4})(\d)/,"$1-$2")              //Coloca um hífen depois do bloco de quatro dígitos
		return v
	}
	 
	function romanos(v){
		v=v.toUpperCase()             //Maiúsculas
		v=v.replace(/[^IVXLCDM]/g,"") //Remove tudo o que não for I, V, X, L, C, D ou M
		//Essa é complicada! Copiei daqui: http://www.diveintopython.org/refactoring/refactoring.html
		while(v.replace(/^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/,"")!="")
			v=v.replace(/.$/,"")
		return v
	}
	 
	function site(v){
		//Esse sem comentarios para que você entenda sozinho ;-)
		v=v.replace(/^http:\/\/?/,"")
		dominio=v
		caminho=""
		if(v.indexOf("/")>-1)
			dominio=v.split("/")[0]
			caminho=v.replace(/[^\/]*/,"")
		dominio=dominio.replace(/[^\w\.\+-:@]/g,"")
		caminho=caminho.replace(/[^\w\d\+-@:\?&=%\(\)\.]/g,"")
		caminho=caminho.replace(/([\?&])=/,"$1")
		if(caminho!="")dominio=dominio.replace(/\.+$/,"")
		v="http://"+dominio+caminho
		return v
	}
 
