$(document).ready(function(){
	
	// Hides every definition list "news_set" then shows the first project set and sets its class to "active_news_set"
	$(".news_set").css({ display: "none" });
	$(".news_set").eq(0).css({ display: "block" });
	$(".news_set").eq(0).toggleClass("active_news_set");
	// Set the first news item link to have the current_section class
	$("#sub_nav a").eq(0).toggleClass("current_section");
	
	// Sets up the click function for every sub navigation link
	$("#sub_nav a").each(function(int){
		$(this).click( function(){ 
			// Find the "active_news_set" then hide it
			$(".active_news_set").hide();
			// Turn off the existing "active_news_set", then turn it on for the clicked set
			$(".active_news_set").toggleClass("active_news_set");
			$(".news_set").eq(int).toggleClass("active_news_set");
			// Remove the .current_section class from any existing link, then add it to the clicked link
			if ($(".current_section")) {
				$(".current_section").toggleClass("current_section");
			}
			$(this).toggleClass("current_section");
			// Show the clicked set
			$(".active_news_set").fadeIn("medium");
			
			return false;
		});
	});
	
});



