$(document).ready(function (){
	
	var w = $(this).width();
	var h = $(this).height();

	$("div[class='cerrar_popup']").click(function (event){
		event.preventDefault();
		$("#"+$(this).attr("nom_pop")).hide('slow');
	});

	$("a[class='popup']").click(function(event){
		event.preventDefault();
		open_pop_up ("#"+$(this).attr("nom_pop"));
	});
	
	function open_pop_up (nom_pop_up)
	{
		$(nom_pop_up).hide();
		w = $(window).width()/2 - $(nom_pop_up).width()/2;
		h = $(window).height()/2 - $(nom_pop_up).height()/2;
		$(nom_pop_up).css("left",w + "px");
		$(nom_pop_up).css("top",h + "px");
		$(nom_pop_up).show('slow');
	}
});

