$(document).ready(function(){wClick=0
	$("#mod_1 img:eq(1)").css("opacity","0");
	$("#mod_1").hover(function()
	{
		$("#mod_1 img:eq(1)").stop().animate({"opacity":"0.9"},"easy");
	},
	function()
	{
		$("#mod_1 img:eq(1)").stop().animate({"opacity":"0"},"easy");
	}).click(function()
	{
		if(wClick==0)
		{
			$(this).addClass("nivel_superior");
			$(".mod_1").addClass("nivel_superior").stop().animate({"opacity":"1"},"easy");
			mWindow();wClick++;
			$.post(
				"components/content.php",
				{
					modulo:($(this).attr("id")).replace(/\D/g,""),
					tipo:$(this).attr("tipo"),
					id:$(this).attr("cont")
				},
				function(data)
				{
					$(".mod_1").html("");
					$(".mod_1").html(data);
				}
			);
		}
		else
		{
			$("div.m_window").stop().animate({"opacity":"0"},"easy").remove();
			wClick=0;$(this).removeClass("nivel_superior");
			$(".mod_1").removeClass("nivel_superior").stop().animate({"opacity":"0"},"easy");
		};
	});
	$("#mod_2 img:eq(1)").css("opacity","0");
	$("#mod_2").hover(function()
	{
		$("#mod_2 img:eq(1)").stop().animate({"opacity":"0.9"},"easy");
	},
	function()
	{
		$("#mod_2 img:eq(1)").stop().animate({"opacity":"0"},"easy");
	}).click(function()
	{
		if(wClick==0)
		{
			$(this).addClass("nivel_superior");
			$(".mod_2").addClass("nivel_superior").stop().animate({"opacity":"1"},"easy");
			mWindow();wClick++;
			$.post(
				"components/content.php",
				{
					modulo:($(this).attr("id")).replace(/\D/g,""),
					tipo:$(this).attr("tipo"),
					id:$(this).attr("cont")
				},
				function(data)
				{
					$(".mod_2").html("");
					$(".mod_2").html(data);
				}
			);
		}
		else
		{
			$("div.m_window").stop().animate({"opacity":"0"},"easy").remove();
			wClick=0;$(this).removeClass("nivel_superior");
			$(".mod_2").removeClass("nivel_superior").stop().animate({"opacity":"0"},"easy");
		};
	});
	$("#mod_3 img:eq(1)").css("opacity","0");
	$("#mod_3").hover(function()
	{
		$("#mod_3 img:eq(1)").stop().animate({"opacity":"0.9"},"easy");
	},
	function()
	{
		$("#mod_3 img:eq(1)").stop().animate({"opacity":"0"},"easy");
	}).click(function()
	{
		if(wClick==0)
		{
			$(this).addClass("nivel_superior");
			$(".mod_3").addClass("nivel_superior").stop().animate({"opacity":"1"},"easy");
			mWindow();wClick++;
			$.post(
				"components/content.php",
				{
					modulo:($(this).attr("id")).replace(/\D/g,""),
					tipo:$(this).attr("tipo"),
					id:$(this).attr("cont")
				},
				function(data)
				{
					$(".mod_3").html("");
					$(".mod_3").html(data);
				}
			);
		}
		else
		{
			$("div.m_window").stop().animate({"opacity":"0"},"easy").remove();
			wClick=0;$(this).removeClass("nivel_superior");
			$(".mod_3").removeClass("nivel_superior").stop().animate({"opacity":"0"},"easy");
		};
	});
	$("#mod_4 img:eq(1)").css("opacity","0");
	$("#mod_4").hover(function()
	{
		$("#mod_4 img:eq(1)").stop().animate({"opacity":"0.9"},"easy");
	},
	function()
	{
		$("#mod_4 img:eq(1)").stop().animate({"opacity":"0"},"easy");
	}).click(function()
	{
		if(wClick==0)
		{
			$(this).addClass("nivel_superior");
			$(".mod_4").addClass("nivel_superior").stop().animate({"opacity":"1"},"easy");
			mWindow();wClick++;
			$.post(
				"components/content.php",
				{
					modulo:($(this).attr("id")).replace(/\D/g,""),
					tipo:$(this).attr("tipo"),
					id:$(this).attr("cont")
				},
				function(data)
				{
					$(".mod_4").html("");
					$(".mod_4").html(data);
				}
			);
		}
		else
		{
			$("div.m_window").stop().animate({"opacity":"0"},"easy").remove();
			wClick=0;$(this).removeClass("nivel_superior");
			$(".mod_4").removeClass("nivel_superior").stop().animate({"opacity":"0"},"easy");
		};
	});
	function mWindow()
	{
		$("#contenedor_modulos").append("<div class='m_window'></div>");
		$("div.m_window").animate({"opacity":"0.75"},"easy");
		$("div.m_window").click(function()
		{
			$(this).animate({"opacity":"0"},"easy").stop().remove();
			wClick=0;$("div.nivel_superior").removeClass("nivel_superior");
			$(".display").removeClass("nivel_superior").stop().animate({"opacity":"0"},"easy");
		});
	}});
