<!--
	function abrir(pagina)
 	{
	   window.open(pagina, 'Mapa', "status=no, width=450, height=400")
	}
	function abrirInteresse(pagina)
 	{
	   window.open(pagina, 'Mapa', "scrollbars=1, status=no, width=550, height=600")
	}
	function abrirFotos(pagina)
 	{
	   window.open(pagina, 'Fotos', "status=yes, width=600, height=620")
	}
	function abrirVagas(pagina)
 	{
	   window.open(pagina, 'Vagas', "scrollbars=1, status=yes, width=1024, height=768")
	}
	function abrirRegulamento(pagina)
 	{
	   window.open(pagina, 'Regulamento', "status=yes, width=800, height=620")
	}

	function MM_displayStatusMsg(msgStr) { //v1.0
	  status=msgStr;
	  document.MM_returnValue = true;
	}

		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);
		
		
function MM_findObj(n, d) { //v4.0
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 && document.getElementById) x=document.getElementById(n); return x;
}
function MM_showHideLayers() { //v3.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; }
}


function FormataCpf(campo, teclapres)
			{
				var tecla = teclapres.keyCode;
				var vr = new String(campo.value);
				vr = vr.replace(".", "");
				vr = vr.replace("/", "");
				vr = vr.replace("-", "");
				tam = vr.length + 1;
				if (tecla != 14)
				{
					if (tam == 4)
						campo.value = vr.substr(0, 3) + '.';
					if (tam == 7)
						campo.value = vr.substr(0, 3) + '.' + vr.substr(3, 6) + '.';
					if (tam == 11)
						campo.value = vr.substr(0, 3) + '.' + vr.substr(3, 3) + '.' + vr.substr(7, 3) + '-' + vr.substr(11, 2);
				}
			}
	
	function remove(str, sub) {
	   i = str.indexOf(sub);
	   r = "";
	   if (i == -1) return str;
	   r += str.substring(0,i) + remove(str.substring(i + sub.length), sub);
	   return r;
	 }
	
	function validaForm(){
		//validar cpf
		d = document.cadastro;
		if (d.cpf.value == ""){
			alert("O campo " + d.cpf.name + " deve ser preenchido!");
			d.cpf.focus();
			return false;
		}
		else {
				   var cpf = document.cadastro.cpf.value;
			   	   var filtro = /^\d{3}.\d{3}.\d{3}-\d{2}$/i;
				   if(!filtro.test(cpf)){
					 window.alert("CPF incorreto. Tente novamente.");
					 d.cpf.focus();
					 return false;
				   }
				   
				   cpf = remove(cpf, ".");
				   cpf = remove(cpf, "-");
					
				   if(cpf.length != 11 || cpf == "00000000000" || cpf == "11111111111" ||
					  cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" ||
					  cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" ||
					  cpf == "88888888888" || cpf == "99999999999"){
					  window.alert("CPF inv&aacute;lido. Tente novamente.");
					  return false;
				   }
				
				   soma = 0;
				   for(i = 0; i < 9; i++)
					 soma += parseInt(cpf.charAt(i)) * (10 - i);
				   resto = 11 - (soma % 11);
				   if(resto == 10 || resto == 11)
					 resto = 0;
				   if(resto != parseInt(cpf.charAt(9))){
					 window.alert("CPF inv&aacute;lido. Tente novamente.");
					 return false;
				   }
				   soma = 0;
				   for(i = 0; i < 10; i ++)
					 soma += parseInt(cpf.charAt(i)) * (11 - i);
				   resto = 11 - (soma % 11);
				   if(resto == 10 || resto == 11)
					 resto = 0;
				   if(resto != parseInt(cpf.charAt(10))){
					 window.alert("CPF inv&aacute;lido. Tente novamente.");
					 return false;
				   }
		}
		//validar unidadeInteresse
		if (d.unidadeInteresse.value == ""){
			alert("O campo Unidade deve ser preenchido!");
			d.unidadeInteresse.focus();
			return false;
		}
		//validar proveniente
		if (!d.proveniente[0].checked && !d.proveniente[1].checked && !d.proveniente[2].checked) {
                  alert("Indique se e aluno!")
                  return false;
        }
		//validar nome
		if (d.nome.value == ""){
			alert("O campo " + d.nome.name + " deve ser preenchido!");
			d.nome.focus();
			return false;
		}
		//validar sexo
		if (!d.sexo[0].checked && !d.sexo[1].checked) {
                  alert("Escolha o sexo!")
                  return false;
        }
		//validar ddd
		if (d.ddd.value == ""){
			alert("O campo " + d.ddd.name + " deve ser preenchido!");
			d.ddd.focus();
			return false;
		}
		//validar telefone
		if (d.telefone.value == ""){
			alert("O campo " + d.telefone.name + " deve ser preenchido!");
			d.telefone.focus();
			return false;
		}
		//validar endereco
		if (d.endereco.value == ""){
			alert("O campo " + d.endereco.name + " deve ser preenchido!");
			d.endereco.focus();
			return false;
		}
		//validar bairro
		if (d.bairro.value == ""){
			alert("O campo " + d.bairro.name + " deve ser preenchido!");
			d.bairro.focus();
			return false;
		}
		//validar cidade
		if (d.cidade.value == ""){
			alert("O campo " + d.cidade.name + " deve ser preenchido!");
			d.cidade.focus();
			return false;
		}
		//validar email
		if (d.email.value == ""){
			alert("O campo " + d.email.name + " deve ser preenchido!");
			d.email.focus();
			return false;
		}
		//validar email(verificao de endereco eletrônico)
         parte1 = d.email.value.indexOf("@");
         parte2 = d.email.value.indexOf(".");
         parte3 = d.email.value.length;
         if (!(parte1 >= 3 && parte2 >= 0 && parte3 >= 9))  {
                   alert ("O campo " + d.email.name + " deve ser conter um endereco eletronico!");
                   d.email.focus();
                   return false;
         }
		//validar emailconfirma
		if (d.emailconfirma.value == ""){
			alert("O campo " + d.emailconfirma.name + " deve ser preenchido!");
			d.emailconfirma.focus();
			return false;
		}
		//validar assunto
		if (d.assunto.value == ""){
			alert("O campo " + d.assunto.name + " deve ser preenchido!");
			d.assunto.focus();
			return false;
		}
		//validar mensagem
		if (d.mensagem.value == ""){
			alert("O campo " + d.mensagem.name + " deve ser preenchido!");
			d.mensagem.focus();
			return false;
		}
		//validar imagem

		
		
		if (d.imagem.value == ""){
			alert("Por favor, valide a imagem!");
			d.imagem.focus();
			return false;
		}
		return true;
	}
	
 function Atualizar(){
	document.cadastro.action = "conteudo.asp?link=12";
	document.cadastro.submit();
   }
// -->