// When the document loads do everything inside here ...  
$(function(){  

	$('#news_items>div+div').hide();
	$("#news_archive a.tab").click(newsYear);
	$("#news_archive .content a").click(loadNews);

});

function newsYear() {
	// switch all tabs off  
	$(".active").removeClass("active");  

	// switch this tab on  
	$(this).addClass("active");  

	// slide all elements with the class 'content' up  
	$(".content").hide();

	// Now figure out what the 'title' attribute value is and find the element with that id.  Then slide that down.  
	var content_show = $(this).attr("id").replace(/^tab/, 'content');  
	$("#"+content_show).show()
}

function loadNews() {
	$('#news_items>div').hide();
	$($(this).attr('href')).show();
	return false;
}