$(document).ready(function()
{
	$(".tab_content").hide();
	//$("ul.tabs li:first").addClass("active").show();
	//$(".tab_content:first").show();
	var tab = $("#tab_activo").val();
       if (tab != "")
       {
		 $("#b_tab" + tab.substring(4,5)).addClass("active").show();
         $(tab).show();    
       }
	   else
	   {
        	$("ul.tabs li:first").addClass("active").show();
			$(".tab_content:first").show();
	   }
	$("ul.tabs li").click(function()
       {
		$("ul.tabs li").removeClass("active");
		$(this).addClass("active");
		$(".tab_content").hide();

		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn();
		$("#tab_activo").val(activeTab);
		return false;
	});
});
