	validaFormularioInscricao = function(tipo) {
		
		var erro	= false;
		var str_erro	= "Campo(s) obrigatório(s) não preenchido(s):\n";
		
		// validando unidade
		if ($F('unidade') == '-1' || $F('unidade') == '') {
			erro = true;
			str_erro = str_erro + "- Unidade\n";
		}
		
		// validando processo seletivo
		if ($F('processo') == '-1' || $F('processo') == '') {
			erro = true;
			str_erro = str_erro + "- Processo Seletivo\n";
		}
		
		// validando primeira opção de curso
		if ($F('primeiraopcaocurso') == '-1' || $F('primeiraopcaocurso') == '') {
			erro = true;
			str_erro = str_erro + "- 1ª Opção de Curso\n";
		}
		
		// validando segunda opção de curso
		if ($F('segundaopcaocurso') == '-1' || $F('segundaopcaocurso') == '') {
			erro = true;
			str_erro = str_erro + "- 2ª Opção de Curso\n";
		}
		
		// validando lingua estrangeira
		if ($F('linguaestrangeira') == '-1' || $F('linguaestrangeira') == '') {
			erro = true;
			str_erro = str_erro + "- Lingua Estrangeira\n";
		}
		
		// Se for uma inclusa completa
		if (tipo == 1) {
		
			// validando nome
			if ($F('nome') == '') {
				erro = true;
				str_erro = str_erro + "- Nome\n";
			}
			
			// validando data de nascimento
			if ($F('id_dados[nascimento]') == '') {
				erro = true;
				str_erro = str_erro + "- Data de Nascimento\n";
			}
			
			// validando data de nascimento
			if ($F('sexo') == '-1' || $F('sexo') == '') {
				erro = true;
				str_erro = str_erro + "- Sexo\n";
			}
			
			// validando nacionalidade
			if ($F('nacionalidade') == '-1' || $F('nacionalidade') == '') {
				erro = true;
				str_erro = str_erro + "- Nacionalidade\n";
			}
			
			// validando naturalidade
			if ($F('naturalidade') == '-1' || $F('naturalidade') == '') {
				erro = true;
				str_erro = str_erro + "- Naturalidade\n";
			}
			
			// validando identidade
			if ($F('identidade') == '') {
				erro = true;
				str_erro = str_erro + "- Identidade\n";
			}
			
			// validando Orgão Emissor
			if ($F('emissorRG') == '-1' || $F('emissorRG') == '') {
				erro = true;
				str_erro = str_erro + "- Orgão Emissor\n";
			}
			
			// validando CEP 
			if ($F('cep') != '') {
				if ($F('cep').length != 8) {
					erro = true;
					str_erro = str_erro + "- CEP\n";
				} else {
					if ($F('cepencontrado') != 1) {
						erro = true;
						str_erro = str_erro + "- CEP\n";
					} else {
						if ($F('numero') == '') {
							erro = true;
							str_erro = str_erro + "- Número\n";
						}
					}
				}
			} else {
				erro = true;
				str_erro = str_erro + "- CEP\n";
			}
			
			// validando Telefone principal
			if ($F('telefone1') == '') {
				erro = true;
				str_erro = str_erro + "- Telefone Principal\n";
			}
			
			// validando Email principal
			if ($F('email1') == '') {
				erro = true;
				str_erro = str_erro + "- Email Principal\n";
			}
			
			if (erro) {
				alert(str_erro);
				$('td_botoes').show();
				return false;
			} else {
				str_erro = 'Campo(s) com preenchimento incorreto:\n';
				// verificando preenchimento incorreto
				
				// validando Telefone principal
				if ($F('telefone1') != '') {
					
					if ($F('telefone1').length != 14) {
						erro = true;
						str_erro = str_erro + "- Telefone Principal\n";
					}
				}
				
				// validando Telefone principal
				if ($F('telefone2') != '') {
					
					if ($F('telefone2').length != 14) {
						erro = true;
						str_erro = str_erro + "- Telefone Alternativo\n";
					}
				}
				
				// validando Email principal
				if ($F('email1') != '') {
					if (!validaEmail($F('email1'))) {
						erro = true;
						str_erro = str_erro + "- Email Principal\n";
					}
				}
				
				// validando Email principal
				if ($F('email2') != '') {
					if (!validaEmail($F('email2'))) {
						erro = true;
						str_erro = str_erro + "- Email Alternativo\n";
					}
				}
			}
		}
			
		if (erro) {
			alert(str_erro);
			$('td_botoes').show();
			return false;
		} else {
			var div 		= 'divAux';
			var parametros	= 'optTela=confirmaInscricao&'+$('form').serialize();
			Utilidades.makeAjax(arquivo, div, parametros, true);
		}
	};

	carregaTelaFormularioCPF = function() {
		
		var div = 'tela';
		var parametros = 'optTela=montaFormularioCPF&'+$('form').serialize();
		Utilidades.makeAjax(arquivo, div, parametros, true);
	};
			
	validaFormularioCPF = function() {
		var strTexto = '';
	
		if ($('cpf').value == '') {
			alert('Digite um CPF para validação!');
			$('cpf').focus();
			return false;
		}
		
		if ($('enemSim').checked) {
			if ($('provaObjetiva').value == '') {
				strTexto = 'Digite a nota da Prova Objetiva';
				$('provaObjetiva').focus();
			}
			
			if ($('provaRedacao').value == '') {
				if (strTexto == '') {
					strTexto = 'Digite a nota da Prova de Redação';
					$('provaRedacao').focus();
				} else {
					strTexto += ' e a nota da Prova de Redação';
				}
			}
	
			if (strTexto != '') {
				strTexto += '!';
				alert(strTexto);
				return false;
			}
		}
		
		var div = 'divAux';
		var parametros = 'optTela=validaFormularioCPF&'+$('form').serialize();
		Utilidades.makeAjax(arquivo, div, parametros, true);
	};

	somaNotas = function() {
		var objetiva	= $('provaObjetiva').value;
		var redacao		= $('provaRedacao').value;

		if (objetiva == '' && redacao == '') {
			$('pontuacao').value = '';
		} else if (objetiva == '') {
			$('pontuacao').value = redacao;
		} else if (redacao == '') {
			$('pontuacao').value = objetiva;
		} else {
			$('pontuacao').value = eval((objetiva*1) +'+'+ (redacao*1));
		}
	};

	montaFormularioInscricao = function() {
		var div = 'tela';
		var parametros = 'optTela=montaFormularioInscricao&'+$('form').serialize();
		Utilidades.makeAjax(arquivo, div, parametros, true);
	};
	
	carregaProcessos = function() {
		var parametros = 'optTela=carregaProcessos&'+$('form').serialize();
		Utilidades.makeAjax(arquivo, 'td_processo', parametros, true);
	};
	
	carregaLinguaEstrangeira = function() {
		var parametros = 'optTela=carregaLinguaEstrangeira&'+$('form').serialize();
		Utilidades.makeAjax(arquivo, 'td_linguaestrangeira', parametros, true);
	};

	carregaCursos = function(div, opcao, valor) {
		var parametros = 'optTela=carregaCursos&opcao='+opcao+'&'+$('form').serialize()+'&valor='+valor;
		Utilidades.makeAjax(arquivo, div, parametros, true);
	};
	
	carregaNaturalidade = function(div) {
		var parametros = 'optTela=carregaNaturalidade&'+$('form').serialize();
		Utilidades.makeAjax(arquivo, div, parametros, true);
	};
	
	buscaEndereco = function() {
		$('divEndereco').show();
		var parametros = 'optTela=buscaEndereco&'+$('form').serialize();
		Utilidades.makeAjax(arquivo, 'divEndereco', parametros, true);
	};
	
	abrirComprovante = function(intCodigo) {
		window.open('comprovante.form.php?cod_inscricao='+intCodigo);
	};
	
	carregaMensagem = function(pessoa, tipo, cpf, enem, tiporetorno) {
		var parametros = 'optTela=carregaMensagem&pessoa='+pessoa+'&tipo='+tipo+'&cpf='+cpf+'&enem='+enem+'&tiporetorno='+tiporetorno;
		Utilidades.makeAjax(arquivo, 'tela', parametros, true);
	};
	
	avaliacao = function(questionario_respondente) {
		var janela = window.open("../avaliacao/avaliacao.php?questionario_respondente="+questionario_respondente, '', 'channelmode;toobar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=no,fullscreen=yes');
		if(janela) {
			janela.resizeTo(screen.width,screen.height);
			janela.moveTo(-50,-10);
		}
	};