<!--
//#############################################################
function valida_promocao(){
	msg = "Os campos marcados com * são de preenchimento obrigatório";
	with(document.form1){
		if (conNome.value == 0){
			alert(msg);
			conNome.focus();
			return false;
		}
		if (conCpf.value.length == 0){
			alert(msg);
			conCpf.focus();
			return false;
		}else{
			cpfNum = conCpf.value;
			if(!validaCPF(cpfNum)){
				alert("O CPF digitado não é válido.");
				conCpf.focus();
				return false;
			}
		}
		if (conEmail.value.length == 0){
			alert(msg);
			conEmail.focus();
			return false;
		}else{
			prim = conEmail.value.indexOf("@");
			if((conEmail.value.indexOf("@",prim + 1) != -1) || (conEmail.value.indexOf(".") < 1)){
				alert("O e-mail digitado não é válido.");
				conEmail.focus();
				return false;
			}
		}
		if (conTelefone.value.length == 0){
			alert(msg);
			conTelefone.focus();
			return false;
		}
		if (conCidade.value.length == 0){
			alert(msg);
			conCidade.focus();
			return false;
		}
		if (conEstado.value == 0){
			alert(msg);
			conEstado.focus();
			return false;
		}
		checado = false;
		for (i=0; i<elements.length; i++){
			if (elements[i].type == 'radio' && elements[i].name.substring(0,15) == 'conEscolaridade'){
				if (elements[i].checked){
					checado = true;
				}
			}
		}
		if (!checado){
			alert("Selecione um Nível de escolaridade.");
			return false;
		}
		checado = false;
		for (i=0; i<elements.length; i++){
			if (elements[i].type == 'radio' && elements[i].name.substring(0,18) == 'conIdiomaInteresse'){
				if (elements[i].checked){
					checado = true;
				}
			}
		}
		if (!checado){
			alert("Selecione um Idioma de seu interesse.");
			return false;
		}
		checado = false;
		for (i=0; i<elements.length; i++){
			if (elements[i].type == 'radio' && elements[i].name.substring(0,14) == 'conIdiomaNivel'){
				if (elements[i].checked){
					checado = true;
				}
			}
		}
		if (!checado){
			alert("Selecione o Nível no idioma citado.");
			return false;
		}
	}
	return true;
}
//#############################################################
function valida_2via(){
	msg = "Os campos marcados com * são de preenchimento obrigatório";
	with(document.form1){
		if (matId.value == 0){
			alert(msg);
			matId.focus();
			return false;
		}else{
			if(isNaN(matId.value)){
				alert("Digite apenas números.");
				matId.focus();
				return false;
			}
		}
		if (matCpf.value.length == 0){
			alert(msg);
			matCpf.focus();
			return false;
		}else{
			cpfNum = matCpf.value;
			if(!validaCPF(cpfNum)){
				alert("O CPF digitado não é válido.");
				matCpf.focus();
				return false;
			}
		}
	}
	return true;
}
//#############################################################
function valida_contrato(){
	with(document.form1){
		if (!contrato_lido.checked){
			alert("É preciso ler o contrato e aceitar suas condições para prosseguir.");
			return false;
		}
	}
	return true;
}
//#############################################################
function valida_matricula(){
	msg = "Os campos marcados com * são de preenchimento obrigatório";
	with(document.form1){
		if (matNome.value == 0){
			alert(msg);
			matNome.focus();
			return false;
		}
		if (matCpf.value.length == 0){
			alert(msg);
			matCpf.focus();
			return false;
		}else{
			cpfNum = matCpf.value;
			if(!validaCPF(cpfNum)){
				alert("O CPF digitado não é válido.");
				matCpf.focus();
				return false;
			}
		}
		if (!elements[2].checked && !elements[3].checked){
			alert(msg);
			matCpf.focus();
			return false;
		}
		if (matEmail.value.length == 0){
			alert(msg);
			matEmail.focus();
			return false;
		}else{
			prim = matEmail.value.indexOf("@");
			if((matEmail.value.indexOf("@",prim + 1) != -1) || (matEmail.value.indexOf(".") < 1)){
				alert("O e-mail digitado não é válido.");
				matEmail.focus();
				return false;
			}
		}
		if (matTelRes.value.length == 0){
			alert(msg);
			matTelRes.focus();
			return false;
		}
		if (matLogradouro.value.length == 0){
			alert(msg);
			matLogradouro.focus();
			return false;
		}
		if (matNumero.value.length == 0){
			alert(msg);
			matNumero.focus();
			return false;
		}else{
			if(isNaN(matNumero.value)){
				alert("Digite apenas números.");
				matNumero.focus();
				return false;
			}
		}
		if (matBairro.value.length == 0){
			alert(msg);
			matBairro.focus();
			return false;
		}
		if (matCidade.value.length == 0){
			alert(msg);
			matCidade.focus();
			return false;
		}
		if (matEstado.value == 0){
			alert(msg);
			matEstado.focus();
			return false;
		}
		if (matCep.value.length == 0){
			alert(msg);
			matCep.focus();
			return false;
		}
		if (elements[15].checked && matRa.value.length == 0){
			alert("Preencha o campo Registro Acadêmico.");
			matRa.focus();
			return false;
		}
		checado = false;
		for (i=17; i<elements.length; i++){
			if (elements[i].type == 'radio' && elements[i].name.substring(0,3) == 'idi'){
				if (elements[i].checked){
					checado = true;
					nivel = elements[i].value.substring(4,7);
				}
			}
		}
		if (!checado){
			alert("Selecione um Idioma / Nível / Horário.");
			return false;
		}
		checado = false;
		for (i=17; i<elements.length; i++){
			if (elements[i].type == 'radio' && elements[i].name.substring(0,4) == 'pgto'){
				if (elements[i].checked){
					checado = true;
					pgto = elements[i].value.substring(4,7);
				}
			}
		}
		if (!checado){
			alert("Selecione uma forma de pagamento.");
			return false;
		}
		if (nivel != pgto){
			alert("A opção de pagamento selecionada não corresponde ao nível selecionado.");
			return false;
		}
	}
	return true;
}
//#############################################################
function valida_nucleo(){
	msg = "Os campos marcados com * são de preenchimento obrigatório";
	with(document.form1){
		if (Professor.value == 0){
			alert(msg);
			Professor.focus();
			return false;
		}
		if (Nome.value.length == 0){
			alert(msg);
			Nome.focus();
			return false;
		}
		if (Email.value.length == 0){
			alert(msg);
			Email.focus();
			return false;
		}
		if (Nivel.value.length == 0){
			alert(msg);
			Nivel.focus();
			return false;
		}
		if (Horario.value.length == 0){
			alert(msg);
			Horario.focus();
			return false;
		}
		if (Mensagem.value.length == 0){
			alert(msg);
			Mensagem.focus();
			return false;
		}
	}
	return true;
}
//#############################################################
function valida_sugestoes(){
	msg = "Os campos marcados com * são de preenchimento obrigatório";
	with(document.form1){
		if (Nome.value.length == 0){
			alert(msg);
			Nome.focus();
			return false;
		}
		if (Email.value.length == 0){
			alert(msg);
			Email.focus();
			return false;
		}
		if (Estuda_FUMEC[0].checked == false && Estuda_FUMEC[1].checked == false){
			alert(msg);
			return false;
		}
		if (Idioma_Alemao.checked == false && Idioma_Espanhol.checked == false && Idioma_Frances.checked == false && Idioma_Ingles.checked == false && Idioma_Italiano.checked == false){
			alert(msg);
			return false;
		}
		if (Horario[0].checked == false && Horario[1].checked == false && Horario[2].checked == false && Horario[3].checked == false && Horario[4].checked == false && Horario[5].checked == false && Horario[6].checked == false && Horario[7].checked == false){
			alert(msg);
			return false;
		}
	}
	return true;
}
//#############################################################
function valida_contato(){
	msg = "Os campos marcados com * são de preenchimento obrigatório";
	with(document.form1){
		if (Nome.value.length == 0){
			alert(msg);
			Nome.focus();
			return false;
		}
		if (Email.value.length == 0){
			alert(msg);
			Email.focus();
			return false;
		}
		if (Mensagem.value.length == 0){
			alert(msg);
			Mensagem.focus();
			return false;
		}
	}
	return true;
}
//#############################################################
function valida_prova(queStart,queMax){
	with(document.form1){
		j=0;
		queMax = queMax + queStart - 1;
		for(i=queStart;i<=queMax;i++){
			j++;
			if((eval("q_" + i + "[0].checked") == false) && (eval("q_" + i + "[1].checked") == false) && (eval("q_" + i + "[2].checked") == false) && (eval("q_" + i + "[3].checked") == false)){
				alert("Por favor, preencha a questão " + j);
				return false;
			}
		}
	}
	return true;
}
//#############################################################
function exibeDiv(div){
	if (document.getElementById(div).style.display == 'none'){
		document.getElementById(div).style.display = 'block';
	} else {
		document.getElementById(div).style.display = 'none';
	}
}
//#############################################################
function printBoletos() {
	window.open('boletos_step1.asp','boletos','menubar=yes,status=yes,scrollbars=yes,width=720,height=450');
}
//#############################################################
function loadSwf(swfWidht,swfHeight,swfPath){
	document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + swfWidht + '" height="' + swfHeight + '">');
	document.writeln('  <param name="movie" value="/swf/' + swfPath + '">');
	document.writeln('  <param name="quality" value="high">');
	document.writeln('  <embed src="/swf/' + swfPath + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + swfWidht + '" height="' + swfHeight + '"></embed>');
	document.writeln('</object>');
}
//#############################################################
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}
//#############################################################
function validaCPF(cpfNum){
	cpfNum = ParseNumb(cpfNum);
	if(cpfNum == 0){
		return(false);
	}else{
		g = cpfNum.length - 2;
		if(TestDigit(cpfNum, g)){
			g = cpfNum.length - 1;
			if(TestDigit(cpfNum, g)){
				return(true);
			}else{
				return(false);
			}
		}else{
			return(false);
		}
	}
}
function TestDigit(cpfNum, g){
	var dig=0;
	var ind=2;
	for(f=g; f>0; f--){
		dig += parseInt(cpfNum.charAt(f-1)) * ind;
		ind++
	}
	dig %= 11;
	if(dig<2){
		dig=0;
	}else{
		dig=11-dig;
	}
	if(dig!=parseInt(cpfNum.charAt(g))){
		return(false);
	}else{
		return(true);
	}
}
function ParseNumb(c){
	c = ClearStr(c,'-');
	c = ClearStr(c,'/');
	c = ClearStr(c,',');
	c = ClearStr(c,'.');
	c = ClearStr(c,'(');
	c = ClearStr(c,')');
	c = ClearStr(c,' ');
	if((parseFloat(c) / c != 1)){
		if(parseFloat(c) * c == 0){
			return(c);
		}else{
			return(0);
		}
	}else{
		return(c);
	}
}
function ClearStr(str, char){
	while((cx=str.indexOf(char))!=-1){
		str = str.substring(0,cx)+str.substring(cx+1);
	}
	return(str);
}
//#############################################################
-->