$(document).ready(function() {
	// listar monumentos
	if($("#seleciona_monumento").length) {
		$(".mark").removeClass('mark');
		$("#content > div").not("#seleciona_monumento").hide();
		switch(this.location.href.split("#")[1]) {
			case "makingof":
				$("#seleciona_monumento > ul").children(":first-child").next().children("a").addClass('mark');
				$("#projeto_makingof").show();
				break;
			case "ficha":
				$("#seleciona_monumento > ul").children(":first-child").next().next().children("a").addClass('mark');
				$("#projeto_ficha").show();
				break;
			case "apresentacao":
			default:
				$("#seleciona_monumento > ul").children(":first-child").children("a").addClass('mark');
				$("#projeto_apresentacao").show();
		}
		
		$("#seleciona_monumento > ul").children(":first-child").children("a").click(function() {
			$(".mark").removeClass('mark');
			$(this).addClass('mark');
			
			$("#content > div").not("#seleciona_monumento").hide();
			$("#projeto_apresentacao").show();
		});
		
		$("#seleciona_monumento > ul").children(":first-child").next().children("a").click(function() {
			$(".mark").removeClass('mark');
			$(this).addClass('mark');
			
			$("#content > div").not("#seleciona_monumento").hide();
			$("#projeto_makingof").show();
		});
		
		$("#seleciona_monumento > ul").children(":first-child").next().next().children("a").click(function() {
			$(".mark").removeClass('mark');
			$(this).addClass('mark');
			
			$("#content > div").not("#seleciona_monumento").hide();
			$("#projeto_ficha").show();
		});
	}
});

function submitContato() {
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	
	if($("#form_nome").val().length == 0) {
		alert("Campo Nome deixado em branco.");
		$("#form_nome").focus();
		return false;
	}
	if($("#form_email").val().length == 0) {
		alert("Campo Email deixado em branco.");
		$("#form_email").focus();
		return false;
	}
	else if(!filter.test($("#form_email").val())) {
		alert("Campo Email inválido.");
		$("#form_email").focus();
		return false;
	}
	if($("#form_assunto").val().length == 0) {
		alert("Campo Assunto deixado em branco.");
		$("#form_assunto").focus();
		return false;
	}
	if($("#form_msg").val().length == 0) {
		alert("Campo Mensagem deixado em branco.");
		$("#form_msg").focus();
		return false;
	}
	
	return true;
}

function submitConvide() {
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	
	if($("#form_nome").val().length == 0) {
		alert("Campo Nome deixado em branco.");
		$("#form_nome").focus();
		return false;
	}
	if($("#form_email").val().length == 0) {
		alert("Campo Email deixado em branco.");
		$("#form_email").focus();
		return false;
	}
	else if(!filter.test($("#form_email").val())) {
		alert("Campo Email inválido.");
		$("#form_email").focus();
		return false;
	}
	if($("#form_email_amigo").val().length == 0) {
		alert("Campo Email do amigo deixado em branco.");
		$("#form_email_amigo").focus();
		return false;
	}
	else if(!filter.test($("#form_email_amigo").val())) {
		alert("Campo Email do amigo inválido.");
		$("#form_email_amigo").focus();
		return false;
	}
	if($("#form_msg").val().length == 0) {
		alert("Campo Mensagem deixado em branco.");
		$("#form_msg").focus();
		return false;
	}
	
	return true;
}