$(document).ready(function() {
	
	//When page loads...
	$(".tab_content").hide(); //Hide all content
	
	var ArrBlock=$(".tabs");
	 for (var i = 0, j = ArrBlock.length; i < j; i++)
	 {
		$("#"+ArrBlock[i].id+"_all>ul.tabs li:first").addClass("active").show(); //Activate first tab
		$("#"+ArrBlock[i].id+"_all>.tab_container>.tab_content:first").show(); //Show first tab content
	 }
	
	
	
	//On Click Event
	$("ul.tabs li").click(function() {
		var str="#"+$(this).parent("ul").attr('id')+"_all";
		$(str+">ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(str+">.tab_container>.tab_content").hide(); //Hide all tab content
	
		var activeTab = $("#"+$(this).attr('id')+"_content"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
	
	});
