// JavaScript Document

function Envia()
	{
		if (document.formulario.nomecompleto.value == "")
		{
			window.alert("O nome não foi informado.");
			document.formulario.nomecompleto.focus();
			return false;
		}

		if (document.formulario.txtCPF.value == "")
		{
			window.alert("O cpf não foi informado.");
			document.formulario.txtCPF.focus();
			return false;
		}
		
		if (document.formulario.txtDtNasc.value == "")
		{
			window.alert("A data de nascimento não foi informada.");
			document.formulario.txtDtNasc.focus();
			return false;
		}
		
		if (document.formulario.email.value == "")
		{
			window.alert("O e-mail não foi informado.");
			document.formulario.email.focus();
			return false;
		}
		
		if (document.formulario.dddresd.value == "")
		{
			window.alert("O ddd do telefone residencial não foi informado.");
			document.formulario.dddresd.focus();
			return false;
		}
		
		if (document.formulario.telresd.value == "")
		{
			window.alert("O telefone residencial não foi informado.");
			document.formulario.telresd.focus();
			return false;
		}
		
		if (document.formulario.estadocivil.value == "")
		{
			window.alert("O estado civil não foi informado.");
			document.formulario.estadocivil.focus();
			return false;
		}

		if ((formulario.sexo[0].checked) || (formulario.sexo[1].checked)){
			}else{
			alert ("Por favor, informe o sexo.");
			return false;
		}

		if (document.formulario.cep.value == "")
		{
			window.alert("O cep não foi informado.");
			document.formulario.cep.focus();
			return false;
		}
		
		if (document.formulario.tipologradouro.value == "")
		{
			window.alert("O tipo de logradouro não foi informado.");
			document.formulario.tipologradouro.focus();
			return false;
		}
		
		if (document.formulario.logradouro.value == "")
		{
			window.alert("O logradouro não foi informado.");
			document.formulario.logradouro.focus();
			return false;
		}
		
		if (document.formulario.bairro.value == "")
		{
			window.alert("O bairro não foi informado.");
			document.formulario.bairro.focus();
			return false;
		}
		
		if (document.formulario.municipio.value == "")
		{
			window.alert("O municipio não foi informado.");
			document.formulario.municipio.focus();
			return false;
		}
		
		if (document.formulario.uf.value == "")
		{
			window.alert("A UF não foi informada.");
			document.formulario.uf.focus();
			return false;
		}
		
		if (document.formulario.formacao.value == "")
		{
			window.alert("A formacao acadêmica não foi informada.");
			document.formulario.formacao.focus();
			return false;
		}
		
		if (document.formulario.colegio.value == "")
		{
			window.alert("O colégio não foi informado.");
			document.formulario.colegio.focus();
			return false;
		}
		
		if (document.formulario.administracao.value == "")
		{
			window.alert("A administração não foi informada.");
			document.formulario.administracao.focus();
			return false;
		}
		
		if (document.formulario.faixasalarial.value == "")
		{
			window.alert("A faixa salarial não foi informada.");
			document.formulario.faixasalarial.focus();
			return false;
		}
		
		if (document.formulario.internet.value == "")
		{
			window.alert("O local onde acessa a internet não foi informado.");
			document.formulario.internet.focus();
			return false;
		}
		
		if ((formulario.trabalha[0].checked) || (formulario.trabalha[1].checked)){
			}else{
			alert ("Por favor, informe se você trabalha.");
			return false;
		}
		
		if ((formulario.estuda[0].checked) || (formulario.estuda[1].checked)){
			}else{
			alert ("Por favor, informe se você estuda.");
			return false;
		}
		
		if ((formulario.area[0].checked) || (formulario.area[1].checked)){
			}else{
			alert ("Por favor, informe se você trabalha na área do curso.");
			return false;
		}
		
		if ((formulario.pretende[0].checked) || (formulario.pretende[1].checked)){
			}else{
			alert ("Por favor, informe se você pretende trabalhar na área do curso.");
			return false;
		}
	}





function SomenteNumero(e){
    var tecla=(window.event)?event.keyCode:e.which;
    if((tecla > 47 && tecla < 58)) return true;
    else{
    if (tecla != 8) return false;
    else return true;
    }
}


function checa(nform) {
	if (document.formulario.email.value != "") {
		prim = document.formulario.email.value.indexOf("@")
		if(prim < 2) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf("@",prim + 1) != -1) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf(".") < 1) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf(" ") != -1) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf("gmeil.com") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf("hotmeil.com") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf(".@") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf("@.") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf(".com.br.") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf("/") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf("[") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf("]") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf("(") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf(")") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
		if(document.formulario.email.value.indexOf("..") > 0) {
			alert("O e-mail informado parece não estar correto.");
			return false;
		}
	}
		return true;
}


function OutrosEC()
	{
	indice = document.formulario.estadocivil.selectedIndex;
	if (indice == 5)
		{
		document.getElementById("outros_estadocivil_esp").style.display = "block"; 
		document.getElementById("outros_estadocivil").style.display = "block"; 
		document.formulario.outros_estadocivil.focus();
		}
	else
		{
		document.getElementById("outros_estadocivil_esp").style.display = "none"; 
		document.getElementById("outros_estadocivil").style.display = "none"; 
		}
	}
	
	
/*function OutrosADM()
	{
	indice = document.formulario.administracao.selectedIndex;
	if (indice == 5)
		{
		document.getElementById("outros_administracao_esp").style.display = "block"; 
		document.getElementById("outros_administracao").style.display = "block"; 
		document.formulario.outros_administracao.focus();
		}
	else
		{
		document.getElementById("outros_administracao_esp").style.display = "none"; 
		document.getElementById("outros_administracao").style.display = "none"; 
		}
	}*/


function OutrosINT()
	{
	indice = document.formulario.internet.selectedIndex;
	if (indice == 5)
		{
		document.getElementById("outros_internet_esp").style.display = "block"; 
		document.getElementById("outros_internet").style.display = "block"; 
		document.formulario.outros_internet.focus();
		}
	else
		{
		document.getElementById("outros_internet_esp").style.display = "none"; 
		document.getElementById("outros_internet").style.display = "none"; 
		}
	}
	

function OutrosCOL()
	{
	indice = document.formulario.colegio.selectedIndex;
	if (document.formulario.colegio.value == "OUTROS")
		{
		document.getElementById("outros_colegio_esp").style.display = "block"; 
		document.getElementById("outros_colegio").style.display = "block"; 
		document.formulario.outros_colegio.focus();
		}
	else
		{
		document.getElementById("outros_colegio_esp").style.display = "none"; 
		document.getElementById("outros_colegio").style.display = "none"; 
		}
	}


/*function AbreCOL()
	{
	indice = document.formulario.administracao.selectedIndex;
	if ((indice == 1) || (indice == 2) || (indice == 3) || (indice == 4))
		{
		document.getElementById("colegio_texto").style.display = "block"; 
		document.getElementById("colegio").style.display = "block";
		}
	else
		if  (indice == 5) {
			document.getElementById("colegio_texto").style.display = "block"; 
			document.getElementById("colegio").style.display = "block";
		}
	else
		{
		document.getElementById("colegio_texto").style.display = "none"; 
		document.getElementById("colegio").style.display = "none"; 
		}
	}*/