function verifica_extencao(campo) {
		var extensoesOk = ",.jpg,";
		var extensao = "," + document.form1.campo.value.substr( document.form.arq.value.length - 4 ).toLowerCase() + ",";

		if( extensoesOk.indexOf( extensao ) == -1 ){
			alert( document.form1.campo.value + "\nA foto precisa ser no formato jpg" );
			return false;
		}
	}


function check_ext(campo) {
	with(document.form1) {
		if (campo.value != "") {
			arquivo = (campo.value);
			tipo = arquivo.substring(arquivo.length-4,arquivo.length);
			tipo = tipo.toLowerCase()

			if (tipo == "jpeg") {} else {
				alert("A foto precisa ser no formato jpg");
				campo.focus();
				return false;
			}

		}


	}
}


function validar()
{
	if (document.form1.nome.value == "")
	{
		alert('Por favor informe seu nome!');
		document.form1.nome.focus();
		return false ;
	}
	if (!CALEPINO.util.checkEmail(document.form1.email.value))
	{
		alert('O seu e-mail está incorreto.');
		document.form1.email.focus();
		return false;
	}
	if (document.form1.email.value != document.form1.emailconf.value)
	{
		alert('A confirmação de e-mail está incorreta!');
		document.form1.emailconf.focus();
		return false ;
	}
	if (document.form1.dianasc.value == "0")
	{
		alert('Por favor informe o dia de seu nascimento!');
		document.form1.dianasc.focus();
		return false ;
	}
	if (document.form1.mesnasc.value == "0")
	{
		alert('Por favor informe o mês de seu nascimento!');
		document.form1.mesnasc.focus();
		return false ;
	}
	if (document.form1.anonasc.value == "0")
	{
		alert('Por favor informe o ano de seu nascimento!');
		document.form1.anonasc.focus();
		return false ;
	}
	if (document.form1.cidade.value == "")
	{
		alert('Por favor informe sua cidade!');
		document.form1.cidade.focus();
		return false ;
	}
	if (document.form1.profissao.value == "")
	{
		alert('Por favor informe sua profissão!');
		document.form1.profissao.focus();
		return false ;
	}
	if (document.form1.profissao.value == "")
	{
		alert('Por favor informe sua profissão!');
		document.form1.profissao.focus();
		return false ;
	}
	var cont = 0;
	if (document.form1.foto1.value != "")
	{
		cont++;

		arquivo1 = (document.form1.foto1.value);
		tipo1 = arquivo1.substring(arquivo1.length-4,arquivo1.length);
		tipo1 = tipo1.toLowerCase();

		if ((tipo1 == ".jpg")||(tipo1 == "jpeg")){}
		else
		{
			alert("A foto precisa ser no formato jpg");
			document.form1.foto1.focus();
			return false ;
		}
	}
	if (document.form1.foto2.value != "")
	{
		cont++;

		arquivo2 = (document.form1.foto2.value);
		tipo2 = arquivo2.substring(arquivo2.length-4,arquivo2.length);
		tipo2 = tipo2.toLowerCase();

		if ((tipo2 == ".jpg")||(tipo2 == "jpeg")){}
		else
		{
			alert("A foto precisa ser no formato jpg");
			document.form1.foto2.focus();
			return false ;
		}

	}
	if (document.form1.foto3.value != "")
	{
		cont++;

		arquivo3 = (document.form1.foto3.value);
		tipo3 = arquivo3.substring(arquivo3.length-4,arquivo3.length);
		tipo3 = tipo3.toLowerCase();

		if ((tipo3 == ".jpg")||(tipo3 == "jpeg")){}
		else
		{
			alert("A foto precisa ser no formato jpg");
			document.form1.foto3.focus();
			return false ;
		}

	}
	if (document.form1.foto4.value != "")
	{
		cont++;

		arquivo4 = (document.form1.foto4.value);
		tipo4 = arquivo4.substring(arquivo4.length-4,arquivo4.length);
		tipo4 = tipo4.toLowerCase();

		if ((tipo4 == ".jpg")||(tipo4 == "jpeg")){}
		else
		{
			alert("A foto precisa ser no formato jpg");
			document.form1.foto4.focus();
			return false ;
		}

	}
	if (document.form1.foto5.value != "")
	{
		cont++;

		arquivo5 = (document.form1.foto5.value);
		tipo5 = arquivo5.substring(arquivo5.length-4,arquivo5.length);
		tipo5 = tipo5.toLowerCase();

		if ((tipo5 == ".jpg")||(tipo5 == "jpeg")){}
		else
		{
			alert("A foto precisa ser no formato jpg");
			document.form1.foto5.focus();
			return false ;
		}

	}
	if (document.form1.foto6.value != "")
	{
		cont++;

		arquivo6 = (document.form1.foto6.value);
		tipo6 = arquivo6.substring(arquivo6.length-4,arquivo6.length);
		tipo6 = tipo.toLowerCase();

		if ((tipo6 == ".jpg")||(tipo6 == "jpeg")){}
		else
		{
			alert("A foto precisa ser no formato jpg");
			document.form1.foto6.focus();
			return false ;
		}

	}
	if(cont<1){
		alert('Você deve inserir 1 foto!');
		document.form1.foto1.focus();
		return false ;
	}
	if (document.form1.regulamento.checked != true)
	{
		alert('Para concluir o cadastro deverá concordar com o regulamento!');
		document.form1.regulamento.focus();
		return false ;
	}


	return true;
}


