function verificaCategoria(mcat) {

	if (mcat == '1') {
		if (document.getElementById('curso_ext').className == 'invisivel') 
			document.getElementById('curso_ext').className = 'visivel';
			else {
				document.getElementById('curso_ext').className = 'invisivel';
				document.getElementById('curso').selectedIndex = '0';
			}
	}
	else { 
		document.getElementById('curso_ext').className = 'invisivel';
		document.getElementById('curso').selectedIndex = '0';
	}
}

function confereDados() {
	
	var checkEmail = /^.+\@.+\..+$/;
	var meuErro = 1;
	
	if (document.fcadastro.nome.value == '') {
		alert("Por favor informe seu nome.");
		meuErro = 2;
		return -1;
	}

	if (document.fcadastro.email.value == '') {
		alert("Por favor informe seu e-mail.");
		meuErro = 2;
		return -1;
	}

	if (!checkEmail.test(document.fcadastro.email.value)) {
		alert("E-mail inválido!");
		meuErro = 2;
		return -1;
	}

	if (document.fcadastro.categoria.options[document.fcadastro.categoria.selectedIndex].value == '') {
		alert("Escolha sua categoria (Aluno Estácio, aluno de outra instituição ou profissional)");
		meuErro = 2;
		return -1;
	}
	
	if (document.fcadastro.categoria.selectedIndex == '1') {
		if (document.fcadastro.curso.options[document.fcadastro.curso.selectedIndex].value == '') {
			alert("Informe seu curso.");
			meuErro = 2;
			return -1;
		}
	}
	

	if (meuErro == 1) {
		document.fcadastro.enviar_inscricao.value = 1;
		document.fcadastro.action='inscricoes.processa.php';
		document.fcadastro.submit();	
	}

}
