

/*************************  Tabs  **************************/


$(document).ready(function() {

	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content


	//attribute an idea to each tab
	$('.tabs li').each(function(i) {
	var thisId = $(this).find("a").attr("href");
	thisId = thisId.substring(1,thisId.length) + '_top';
	$(this).attr("id",thisId);
	});	



	function changeTab(activeTab)
	{
	
				$("ul.tabs li").removeClass("active"); //Remove any "active" class
				$(activeTab + '_top').addClass("active"); //Add "active" class to selected tab, using the id created at document load
				
				$(".tab_content").hide(); //Hide all tab content
				$(activeTab).fadeIn(); //Fade in the active content
				
	
	}
	
	//check to see if a tab is called onload
	if (location.hash!=''){changeTab(location.hash);}
	
	
	
	//On Click Event
	$("ul.tabs li").click(function() {
	
			//call above function
			changeTab($(this).find("a").attr("href"));
			return false;
	});
	
	
	$(".external_link").click(function() {
	
			//call above function
			changeTab($(this).attr("href"));
			return false;
		});
	
	
		

});




