function envioLista(){
	var ancho = $(document).width();
	var mail = $("#emailtr").val();
	if($("#condiciones").attr("checked") != true){ 
		$("#error").fadeIn()
		$("#splash_background").fadeIn('slow');
		$("#error").fadeIn('slow');
		$("#error").css("left",(ancho/2)-245);
		$("#error").css("top",180);
		$("#txttt").html("No ha aceptado las condiciones de privacidad");
		return false; 
	}
	
   $.ajax({
        type:'POST',
        url:"inc/mailing.php",
        data:{ac:'alta',email:mail},
        dataType:"json",
        success:function(dat){
			if(dat.error == 0){
				$("#completado").fadeIn()
				$("#splash_background").fadeIn('slow');
				$("#completado").fadeIn('slow');
				$("#completado").css("left",(ancho/2)-245);
				$("#completado").css("top",180);	
			
			} else {
				$("#error").fadeIn()
				$("#splash_background").fadeIn('slow');
				$("#error").fadeIn('slow');
				$("#error").css("left",(ancho/2)-245);
				$("#error").css("top",180);
				$("#txttt").html(dat.msg);		
	
				return false; 
			}
		}
    });	
}

function datos(){
		var ancho = $(document).width();
		$("#splash_background").fadeIn('slow');

		$("#datos").fadeIn('slow');

		$("#datos").css("left",(ancho/2)-245);

		$("#datos").css("top",40);
}
function closedattos(){
		$("#splash_background").hide();
		$("#baja").hide();
		$("#datos").hide();
		$("#completado").hide();
		$("#error").hide();		
}
function splash(){

		var ancho = $(document).width();

		$("#splash_background").fadeIn('slow');

		$("#splash").fadeIn('slow');

		$("#splash").css("left",(ancho/2)-245);

		$("#splash").css("top",40);

	}



	function menudeldia(){

		var ancho = $(document).width();

		$("#splash_background").fadeIn('slow');

		$("#menudeldia").fadeIn('slow');

		$("#menudeldia").css("left",(ancho/2)-245);

		$("#menudeldia").css("top",40);

	}



	function carta(){

		var ancho = $(document).width();

		$("#splash_background").fadeIn('slow');

		$("#carta").fadeIn('slow');

		$("#carta").css("left",(ancho/2)-245);

		$("#carta").css("top",40);

	}
	function m1(){

		var ancho = $(document).width();

		$("#splash_background").fadeIn('slow');

		$("#m1").fadeIn('slow');

		$("#m1").css("left",(ancho/2)-245);

		$("#m1").css("top",40);

	}
	function m2(){

		var ancho = $(document).width();

		$("#splash_background").fadeIn('slow');

		$("#m2").fadeIn('slow');

		$("#m2").css("left",(ancho/2)-245);

		$("#m2").css("top",40);

	}
	function m3(){

		var ancho = $(document).width();

		$("#splash_background").fadeIn('slow');

		$("#m3").fadeIn('slow');

		$("#m3").css("left",(ancho/2)-245);

		$("#m3").css("top",40);

	}
	function m4(){

		var ancho = $(document).width();

		$("#splash_background").fadeIn('slow');

		$("#m4").fadeIn('slow');

		$("#m4").css("left",(ancho/2)-245);

		$("#m4").css("top",40);

	}	



	function entrantes(){

		$("#entrantes").show();

		$("#carnes").hide();

		$("#guarniciones").hide();

		$("#vinos").hide();

		$("#postres").hide();

	}

	

	function carnes(){

		$("#entrantes").hide();

		$("#carnes").show();

		$("#guarniciones").hide();

		$("#vinos").hide();

		$("#postres").hide();

	}

	

	function guarniciones(){

		$("#entrantes").hide();

		$("#carnes").hide();

		$("#guarniciones").show();

		$("#vinos").hide();

		$("#postres").hide();

	}

	

	function vinos(){

		$("#entrantes").hide();

		$("#carnes").hide();

		$("#guarniciones").hide();

		$("#vinos").show();

		$("#postres").hide();

	}

	

	function postres(){

		$("#entrantes").hide();

		$("#carnes").hide();

		$("#guarniciones").hide();

		$("#vinos").hide();

		$("#postres").show();

	}



$(document).ready(function(){

	

	$("#splash_background").click(function(){

		$("#splash_background").hide();
		$("#baja").hide();

		$("#splash").hide();

		$("#menudeldia").hide();
		$("#completado").hide();
		$("#error").hide();	
		$("#carta").hide();	
				$("#datos").hide();

	});

	

	$("#cerrar").click(function(){
		$("#baja").hide();
		$("#splash_background").hide();

		$("#splash").hide();

	});



	$("#cerrar_menudeldia").click(function(){

		$("#splash_background").hide();

		$("#menudeldia").hide();


	});

	

	$("#cerrar_carta").click(function(){

		$("#splash_background").hide();

		$("#carta").hide();

	});

	

})