function VotaEnquete() {
	
	var array = new Array();
		
	with( document.forms[0] ) {
		
		for( i=0; i < elements.length; i++ ) {
			
			thiselem = elements[i];
			if( thiselem.type == "radio" && thiselem.name == "resposta" && thiselem.checked ) {
				
				array.push(1);
			}
		}
		
		if( array.length > 0 ) {
			
			method = "POST";
			action = "enquete_vota.php";
			submit();
			
		}else{
			
			window.alert("Marque uma opção.");
		}		
	}
	
}



function VotaEnquete2() {
	
	var array = new Array();
		
	with( document.forms[0] ) {
		
		for( i=0; i < elements.length; i++ ) {
			
			thiselem = elements[i];
			if( thiselem.type == "radio" && thiselem.name.substr(0,5) == "vota[" && thiselem.checked ) {
				
				array.push(1);
			}
		}
		
		if( array.length > 0 ) {
			
			method = "POST";
			action = "enquete_vota2.php";
			submit();
			
		}else{
			
			window.alert("Marque uma opção.");
		}		
	}
	
}


function EnviarFoto() {
	
	with( document.forms[0] ) {


		if( liberar.value != "1" ) {
			
			window.alert("Não é possível enviar esta foto no momento.");
			return false;
		}


		if( nome_remetente.value == "" ) {
			
			window.alert("Digite o nome do remetente.");
			nome_remetente.focus();
			return false;
		}


		if( email_remetente.value == "" ) {
			
			window.alert("Digite o e-mail do remetente.");
			email_remetente.focus();
			return false;
		}


		if( email_remetente.value.indexOf("@") == "-1" || email_remetente.value.indexOf(".") == "-1" ) {
			
			window.alert("Digite um e-mail válido.");
			email_remetente.focus();
			return false;
		}


		if( nome_destinatario.value == "" ) {
			
			window.alert("Digite o nome do destinatário.");
			nome_destinatario.focus();
			return false;
		}


		if( email_destinatario.value == "" ) {
			
			window.alert("Digite o e-mail do destinatário.");
			email_destinatario.focus();
			return false;
		}

		if( email_destinatario.value.indexOf("@") == "-1" || email_destinatario.value.indexOf(".") == "-1" ) {
			
			window.alert("Digite um e-mail válido.");
			email_destinatario.focus();
			return false;
		}
		
		
		method = "POST";
		action = "galeria_fotos_enviar.php";
		submit();


	}
}


function popup(url, frame, param) {
	
	window.open(url, frame, param);
}


function cadastro() {
	
	with( document.forms[0] ) {
		
		if( nome.value == "" ){
			window.alert("Digite seu nome.");
			nome.focus();
			return false;
		}

		if( dia.value == "" || mes.value == "" || ano.value == "" ){
			window.alert("Digite sua data de nascimento.");
			dia.focus();
			return false;
		}

		if( senha.value == "" ){
			window.alert("Digite sua senha.");
			senha.focus();
			return false;
		}

		if( email.value == "" ){
			window.alert("Digite seu e-mail.");
			email.focus();
			return false;
		}

		if( email.value.indexOf("@") == "-1" || email.value.indexOf(".") == "-1" ){
			window.alert("Digite um e-mail válido.");
			email.focus();
			return false;
		}

		if( endereco.value == "" ){
			window.alert("Digite seu endereço completo.");
			nome.focus();
			return false;
		}

		if( endereco.value == "" ){
			window.alert("Digite seu endereço completo.");
			endereco.focus();
			return false;
		}

	
		if( cidade.value == "" ){
			window.alert("Digite o nome de sua cidade.");
			cidade.focus();
			return false;
		}

		if( estado.value == "" ){
			window.alert("Selecione seu estado.");
			estado.focus();
			return false;
		}

		if( ddd.value == "" ){
			window.alert("Digite o DDD do telefone.");
			ddd.focus();
			return false;
		}

		if( fone.value == "" ){
			window.alert("Digite o telefone.");
			fone.focus();
			return false;
		}
		
		
		method = "POST";
		action = "cadastro_verificar.php";
		submit();


	}
}

function Contato() {
	
	with( document.forms[0] ) {


		if( area.value == "" ) {
			
			window.alert("Selecione a àrea de interesse.");
			area.focus();
			return false;
		}

		if( nome.value == "" ) {
			
			window.alert("Digite seu nome.");
			nome.focus();
			return false;
		}

		if( email.value.indexOf("@") == "-1" || email.value.indexOf(".") == "-1" ) {
			
			window.alert("Digite seu e-mail.");
			email.focus();
			return false;
		}

		if( mensagem.value == "" ) {
			
			window.alert("Digite a mensagem.");
			mensagem.focus();
			return false;
		}
		
		method = "POST";
		action = "contato_verifica.php";
		submit();


	}
}


function Eventos() {
	
	with( document.forms[0] ) {
		

		if( dia.value == "" || mes.value == "" || ano.value == "" ) {
			
			window.alert("Selecione a data do evento.");
			dia.focus();
			return false;
		}

		if( nome.value == "" ) {
			
			window.alert("Digite seu nome");
			nome.focus();
			return false;
		}

		if( email.value.indexOf("@") == "-1" && email.value.indexOf(".") == "-1" ) {
			
			window.alert("Digite seu e-mail");
			email.focus();
			return false;
		}

		if( ddd.value == "" ) {
			
			window.alert("Digite o código DDD do telefone.");
			ddd.focus();
			return false;
		}

		if( fone.value == "" ) {
			
			window.alert("Digite seu telefone.");
			fone.focus();
			return false;
		}

		if( informacoes.value == "" ) {
			
			window.alert("Digite as informações.");
			informacoes.focus();
			return false;
		}


		method = "POST";
		action = "eventos_verifica.php";
		submit();
	}
	
}



function MonteTime() {
	
	with( document.forms[0] ) {
		
		if( esporte.value == "" ) {
			
			window.alert("Selecione o esporte.");
			esporte.focus();
			return false;
		}

		if( dia.value == "" || mes.value == "" || ano.value == "" ) {
			
			window.alert("Selecione a data.");
			dia.focus();
			return false;
		}

		if( nome.value == "" ) {
			
			window.alert("Digite seu nome");
			nome.focus();
			return false;
		}

		if( email.value == "" ) {
			
			window.alert("Digite seu e-mail");
			email.focus();
			return false;
		}

		if( email.value.indexOf("@") == "-1" || email.value.indexOf(".") == "-1" ) {
			
			window.alert("Digite um e-mail válido");
			email.focus();
			return false;
		}

		if( ddd.value == "" ) {
			
			window.alert("Digite o código DDD do telefone.");
			ddd.focus();
			return false;
		}

		if( fone.value == "" ) {
			
			window.alert("Digite seu telefone.");
			fone.focus();
			return false;
		}

		if( mensagem.value == "" ) {
			
			window.alert("Digite a mensagem.");
			mensagem.focus();
			return false;
		}
		
		method = "POST";
		action = "monte_time_enviar.php";
		submit();
	}
	
}


function EnqueteRestrita() {
	
	with( document.forms[0] ) {
	
		if( enq_user.value == "" ) {
			
			window.alert("Digite o usuário.");
			enq_user.focus();
		
		}else{
		
		if( enq_senha.value == "" ) {
			
			window.alert("Digite a senha.");
			enq_senha.focus();
		
		}else{
		
		method = "POST";
		action = "enquete_restrita_login.php";
		submit();
			
		}
					
		}
		
	}
}





function Propaganda() {
	
	with( document.forms[0] ) {


		if( nome.value == "" ) {
			
			window.alert("Digite seu nome.");
			nome.focus();
			return false;
		}

		if( email.value.indexOf("@") == "-1" || email.value.indexOf(".") == "-1" ) {
			
			window.alert("Digite seu e-mail.");
			email.focus();
			return false;
		}

		if( ddd.value == "" ) {
			
			window.alert("Digite o código DDD.");
			ddd.focus();
			return false;
		}

		if( fone.value == "" ) {
			
			window.alert("Digite o número do telefone.");
			fone.focus();
			return false;
		}

		if( mensagem.value == "" ) {
			
			window.alert("Digite a mensagem.");
			mensagem.focus();
			return false;
		}
		
		method = "POST";
		action = "propaganda_verifica.php";
		submit();


	}
}
