// JavaScript Document
<!--


		function MM_reloadPage(init) {  //reloads the window if Nav4 resized
		  if (init==true) with (navigator) {
			if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			  document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }
			}
			else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
		  }
		MM_reloadPage(true);
		
		<!-- Inicio função encontra objeto -->
		function MM_findObj(n, d) { //v4.01
		  var p,i,x;  
		  if(!d) 
			d=document; 
			if((p=n.indexOf("?"))>0&&parent.frames.length) {
			  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
			}
		  if(!(x=d[n])&&d.all) 
			x=d.all[n]; 
		  for (i=0;!x&&i<d.forms.length;i++) 
			x=d.forms[i][n];
		  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
			x=MM_findObj(n,d.layers[i].document);
		  if(!x && d.getElementById) 
			x=d.getElementById(n); return x;
		}
		<!-- fim função encontra objeto -->
		
		<!-- Função Mostra conteudo da opção do menu -->
		function MM_showHideLayers() { //v6.0
		  var i,p,v,obj,args=MM_showHideLayers.arguments;
		  for (i=0; i<(args.length-2); i+=3) 
			if ((obj=MM_findObj(args[i]))!=null) { 
			  v=args[i+2];
			  if (obj.style) { 
				obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
			  }
			  obj.visibility=v; 
			}
		}
		<!-- Fim Função Conteudo Menu -->

        <!-- Funções de Máscaras -->

        		
		function Nascimento(data){
		  if(data.value.length == 2)
		    data.value = data.value + '/';
			
		  if(data.value.length == 5)
		    data.value = data.value + '/';
		}
		
				function Telefone(objeto){
		  if(objeto.value.length == 0)
		    objeto.value = '(' + objeto.value;
		  
		  if(objeto.value.length == 3)
		    objeto.value = objeto.value + ')';
			
		  if(objeto.value.length == 8)
		    objeto.value = objeto.value + '-';
		
		}
		
		function Celular(cel){
		  if(cel.value.length == 0)
		    cel.value = '(' + cel.value;
			
		  if(cel.value.length == 3)
		    cel.value = cel.value + ')';
		  
		  if(cel.value.length == 8)
		    cel.value = cel.value + '-';
		}
		
		function CEP(cep){
		  if(cep.value.length == 5)
		    cep.value = cep.value + '-';
		}
		
		function CPF(cpf){
		  if(cpf.value.length == 3)
		    cpf.value = cpf.value + '.';
			
		  if(cpf.value.length == 7)
		    cpf.value = cpf.value + '.';
		  
		  if(cpf.value.length == 11)
		    cpf.value = cpf.value + '-';
		}
		
		
		function Limpa(campo){
		  campo.value = "";
		}

		<!-- Fim Funções Máscara -->


        <!-- Verifica os campos obrigatorios que não foram preechidos -->	
	    
	    
	    function ValidaForm(){
                               
           //validar data de nascimento
		   // A data de nascimento não pode ser maior que a data de hoje
           erro=0;
           hoje = new Date();
           anoAtual = hoje.getFullYear();
           var dtNasc, dtNascFocus;
           dtNasc = document.form_inscricao.dtNasc.value;
           dtNascFocus = document.form_inscricao.dtNasc;
		   
		   //alert(dtNasc);
		   
           if (dtNasc == ""){
           	 alert("O campo DATA NASCIMENTO deve ser preenchido");
           	 dtNascFocus.focus();
           	 return false;
           }
             
           barras = dtNasc.split("/");

           if (barras.length == 3)
		   {
             dia = barras[0];
             mes = barras[1];
             ano = barras[2];
             resultado = (!isNaN(dia) && (dia > 0) && (dia < 32)) && (!isNaN(mes) && (mes > 0) && (mes < 13)) && (!isNaN(ano) && (ano.length == 4) && (ano <= anoAtual && ano >= 1900));
                   if (!resultado) 
				   {
                     alert("Formato de DATA NASCIMENTO invalido!");
                     dtNascFocus.focus();
                     return false;
                   }
            }
			else
			{
              alert("Formato de DATA NASCIMENTO invalido!");
              dtNascFocus.focus();
              return false;
            }
			
			
			//validar telefone
		  var fone, foneFocus, fone_barras, tam;
		  fone = document.form_inscricao.fone.value;
		  foneFocus = document.form_inscricao.fone;
          if (fone == ""){
            alert ("O campo TELEFONE deve ser preenchido!");
            foneFocus.focus();
            return false;
          }
		  
		  fone_barras = fone.substring(1,3);
		  fone_barras = fone_barras + fone.substring(4,8);
		  fone_barras = fone_barras + fone.substring(9,13);
		  tam = fone_barras.length;
		  
		   if(tam < 10)
		   {
			   alert("o campo TELEFONE nao foi preenchido corretamente");
			   foneFocus.focus();
			   return false;
		   }
		  
           if (isNaN(fone_barras)){
              alert("o campo TELEFONE deve conter numeros!");
              foneFocus.focus();
              return false;
            }

	            
			
			// validar Celular
		   
		   
		    //validar email
        
		 
		 //Validar o Estado
         var estado, estFocus;
		 estado = document.form_inscricao.estado.value;
		 estFocus = document.form_inscricao.estado;
		 
		 if(estado == 0)
		 {
			 alert("Selecione algum ESTADO");
			 estFocus.focus();
			 return false;
		 }
		 
		 //Validar a Cidade
         var cidade, cidFocus;
		 cidade = document.form_inscricao.cidade.value;
		 cidFocus = document.form_inscricao.cidade;
		 
		 if(cidade == 0)
		 {
			 alert("Selecione alguma CIDADE");
			 cidFocus.focus();
			 return false;
		 }
		 
		 
		 // Validar o CEP
         var cep, cepFocus, tamCep;
         cep = document.form_inscricao.cep.value;
         cepFocus = document.form_inscricao.cep;
                  
         if (cep == ""){
         	alert("O campo CEP deve ser preenchido!");
         	cepFocus.focus();
            return false;
         }
		 cep_barras = cep.substring(0,5);
		 cep_barras = cep_barras + cep.substring(6,9);
		 tamCep = cep_barras.length;
		 
		 
		 if(tamCep < 8)
		   {
			   alert("o campo CEP nao foi preenchido corretamente");
			   cepFocus.focus();
			   return false;
		   }
		  
           if (isNaN(cep_barras)){
              alert("o campo CEP deve conter numeros!");
              cepFocus.focus();
              return false;
            }
		}
         
		 // Validar o CPF
		 
		 // Valida RG
		 
         
	    <!-- Fim Função Campo Obrigatorio -->
		
		//-->
