//**FUNÇÃO JAVA

//*FUNÇÃO VALIDA CONTATO

function Fale(theForm){
	if(theForm.nome.value==""){
		alert("Informe seu Nome!");
		theForm.nome.focus();
		return false;	}
	if(theForm.email.value==""){
		alert("Informe seu E-mail!");
		theForm.email.focus();
		return false;	}
	if(theForm.telefone.value==""){
		alert("Informe seu Telefone!");
		theForm.telefone.focus();
		return false;	}
	if(theForm.assunto.value==""){
		alert("Informe o Assunto!");
		theForm.assunto.focus();
		return false;	}
	if(theForm.mensagem.value==""){
		alert("Deixe sua Mensagem!");
		theForm.mensagem.focus();
		return false;	}
	}

function RGL(){
		window.open("./regulamento.asp", "Regulamento", "resizable=yes,scrollbars=yes,status=0,resizable=0,width=750,height=570");	}
		
function calendario(){
		window.open("./calendario_impri.htm", "Regulamento", "resizable=yes,scrollbars=yes,status=0,resizable=0,width=750,height=570");	}

function SEXO(cod){
		document.Inscricao.sx.value = cod;	}

function register(theForm){
	//**DADOS PESSOAIS
	if(theForm.nome.value==""){
		alert("Informe seu Nome! \nEnter your name!");
		theForm.nome.focus();
		return false;	}
	if(theForm.day.value==""){
		alert("Informe o dia de seu nascimento! \nEnter the day of his birth!");
		theForm.day.focus();
		return false;	}
	if(theForm.month.value==""){
		alert("Informe o mês de seu nascimento! \nEnter the month of his birth!");
		theForm.month.focus();
		return false;	}
	if(theForm.year.value==""){
		alert("Informe o ano de seu nascimento! \nEnter the year of his birth!");
		theForm.year.focus();
		return false;	}
	erro=0;
	var nasc = theForm.day.value+"/"+theForm.month.value+"/"+theForm.year.value;
  	hoje = new Date();
 	anoAtual = hoje.getFullYear();
 	barras = nasc.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 invalido! \nInvalid date format!");
		theForm.day.value="";
		theForm.month.value="";
		theForm.year.value="";
		theForm.day.focus();
		return false;	}
	} else {
		alert("Formato de data invalido! \nInvalid date format!");
		theForm.day.value="";
		theForm.month.value="";
		theForm.year.value="";
		theForm.day.focus();
		return false;	}
	if(theForm.rg.value=="" && theForm.cpf.value==""){
		alert("Informe seu RG ou CPF!");
		theForm.rg.focus();
		return false;	}
	if(theForm.phone.value==""){
		alert("Insira o numero de seu telefone! \nEnter your phone number!");
		theForm.phone.focus();
		return false;	}
	if(theForm.sx.value==""){
		alert("Selecione o seu sexo! \nSelect your gender!");
		return false;	}
		
	//**ENDEREÇO ELETRONICO
	if(theForm.email.value==""){
		alert("Insira seu E-mail! \nEnter your Email!");
		theForm.email.focus();
		return false;	}
	if(theForm.cfemail.value==""){
		alert("Confirme seu E-mail! \nConfirm your Email!");
		theForm.cfemail.focus();
		return false;	}
	if(theForm.email.value!=theForm.cfemail.value){
		alert("Os E-mail digitado é diferente da confirmação! \nThe Email entered is different from the confirmation!");
		theForm.email.value="";
		theForm.cfemail.value="";
		theForm.email.focus();
		return false;	}
		
	//**SENHA
	if(theForm.senha.value==""){
		alert("Insira sua Senha! \nEnter your Password!");
		theForm.senha.focus();
		return false;	}
	if(theForm.cfsenha.value==""){
		alert("Confirme sua Senha! \nConfirm Password!");
		theForm.cfsenha.focus();
		return false;	}
	if(theForm.senha.value!=theForm.cfsenha.value){
		alert("A Senha inserida não confere! \nThe password entered does not match!");
		theForm.senha.value="";
		theForm.cfsenha.value="";
		theForm.senha.focus();
		return false;	}
	
	//**ENDEREÇO
	if(theForm.address.value==""){
		alert("Insira seu Endereço completo! \nEnter your full address!");
		theForm.address.focus();
		return false;	}
	if(theForm.city.value==""){
		alert("Insira o nome de sua Cidade! \nEnter the name of your City!");
		theForm.city.focus();
		return false;	}
	if(theForm.state.value==""){
		alert("Insira o nome de seu Estado! \nEnter the name of your state!");
		theForm.state.focus();
		return false;	}
	if(theForm.country.value==""){
		alert("Insira o nome do País! \nEnter the name of the country!");
		theForm.country.focus();
		return false;	}
	if(theForm.zip.value==""){
		alert("Insira o numero de seu CEP! \nEnter the number of your zip code!");
		theForm.zip.focus();
		return false;	}
		
	//**AMIGOS
	if(theForm.friendemail.value==""){
		alert("Insira o E-mail de seu 1 Amigo! \nEnter the e-mail of your friend 1");
		theForm.friendemail.focus();
		return false;	}
	if(theForm.friendemailtwo.value==""){
		alert("Insira o E-mail de seu 2 Amigo! \nEnter the e-mail of your friend 2");
		theForm.friendemailtwo.focus();
		return false;	}
	if(theForm.friendemailthree.value==""){
		alert("Insira o E-mail do seu 3 Amigo! \nEnter the e-mail of your friend 3");
		theForm.friendemailthree.focus();
		return false;	}
	if(theForm.friendemail.value==theForm.friendemailtwo.value){
		alert("Os E-mails 1 e 2 de seu amigos devem ser diferente! \nThe Emails 1 and 2 of your friends should be different!");
		theForm.friendemailtwo.value="";
		theForm.friendemailtwo.focus();
		return false;	}
	if(theForm.friendemail.value==theForm.friendemailthree.value){
		alert("Os E-mails 1 e 3 de seu amigos devem ser diferente! \nThe E-mails 1 and 3 of your friends should be different!");
		theForm.friendemailthree.value="";
		theForm.friendemailthree.focus();
		return false;	}
	if(theForm.friendemailthree.value==theForm.friendemailtwo.value){
		alert("Os E-mails 2 e 3 de seu amigos devem ser diferente! \nThe E-mails 2 and 3 of your friends should be different!");
		theForm.friendemailthree.value="";
		theForm.friendemailthree.focus();
		return false;	}
	if(theForm.registro.checked == false){
		alert("É necessário concordar com o regulamento! \nYou must agree to the rules!");
		return false;	}
}

//**POP CALENDARIO
function calendario(){
    window.open("./calendario_impri.htm", "Address", "resizable=yes,scrollbars=yes,status=0,resizable=0,width=680,height=370");
}

//**CROS OVER
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

//**COMENTARIOS
function TALK(theForm){
		if(theForm.nome.value==""){
			alert("Insira seu Nome completo!");
			theForm.nome.focus();
			return false;	}
		if(theForm.email.value==""){
			alert("Insira seu E-mail!");
			theForm.email.focus();
			return false;	}
		if(theForm.cidade.value==""){
			alert("Insira o nome de sua Cidade!");
			theForm.cidade.focus();
			return false;	}
		if(theForm.coment.value==""){
			alert("Deixe seu Coment&aacute;rio!");
			theForm.coment.focus();
			return false;	}	}
			
//* LOGIN

	function LOGIN(theForm){
		if(theForm.email.value==""){
			alert('Digite seu E-mail!\nO e-mail tem que ser o mesmo que foi utilizado no ato do cadastro.');
			theForm.email.focus();
			return false;	}
		if(theForm.senha.value==""){
			alert('Digite a Senha que você cadastro!\nCaso não se lembre que em Esqueci Minha Senha.');
			theForm.senha.focus();
			return false;	}	}
	function EQ(theForm){
		if(theForm.email.value==""){
			alert('Digite seu E-mail!\nO e-mail tem que ser o mesmo que foi utilizado no ato do cadastro.');
			theForm.email.focus();
			return false;	}
		if(theForm.dados.value==""){
			alert('Insira o numero do seu RG ou CPF!.');
			theForm.dados.focus();
			return false;	}	}

//* ESQUECI MINHA SENHA

	function ESQNS(theForm){
		if(theForm.senha.value==""){
		alert("Insira sua Senha!");
		theForm.senha.focus();
		return false;	}
	if(theForm.cfsenha.value==""){
		alert("Confirme sua Senha!");
		theForm.cfsenha.focus();
		return false;	}
	if(theForm.senha.value!=theForm.cfsenha.value){
		alert("A Senha inserida não confere!");
		theForm.senha.value="";
		theForm.cfsenha.value="";
		theForm.senha.focus();
		return false;	}	}
