function toggleInfo(newinfo) {
	$('.councilmenu a').removeClass('selected');
	$('.councilmenu a.' + newinfo).addClass('selected');
	$('.hideinfo').hide();
	$('#' + newinfo).show();
	var url = document.location.toString();
	if (url.match('year/')) {
		var yearIndex = url.split('year/')[1];
		yearIndex = yearIndex.split('#')[0];
		window.location.hash = '#' + yearIndex + '&t=' + newinfo;
	} else {
	window.location.hash = '#t=' + newinfo;		
	}
}
$(document).ready(function(){
var url = document.location.toString();
if (url.match('t=')) {
	var findinfo = url.split('t=')[1];
	toggleInfo(findinfo);
}
	$("div#yearList").show();
	$(".yearTab").click(function() {
		$(".yearTab").addClass('selected');
		$(".topicTab").removeClass('selected');
		$("div#topicList").hide();
		$("div#yearList").show();
	});
	$(".topicTab").click(function() {
		$(".topicTab").addClass('selected');
		$(".yearTab").removeClass('selected');
		$("div#topicList").show();
		$("div#yearList").hide();
	});
	var url = document.location.toString();
  if (url.match('year/')) {
		var yearIndex = url.split('year/')[1];
		if(url.match('#')) {
			yearIndex = yearIndex.split('#')[0];
		}
		$("a[name=" + yearIndex + "]").addClass('selected');
		$(".yearTab").addClass('selected');
		$(".topicTab").removeClass('selected');
		$("div#topicList").hide();
		$("div#yearList").show("fast", function(){window.location.hash = yearIndex + '&t=resources';});
	}
  if (url.match('topic/')) {
		var topicIndex = url.split('topic/')[1];
		if(url.match('#')) {
			topicIndex = topicIndex.split('#')[0];
		}
		$("a[name=" + topicIndex + "]").addClass('selected');
		$(".topicTab").addClass('selected');
		$(".yearTab").removeClass('selected');
		$("div#yearList").hide();
		$("div#topicList").show("fast", function(){window.location.hash = topicIndex + '&t=resources';});
	}
	try {
	    $("#searchResults").tablesorter().tablesorterPager({container: $("#pager")});	
    }
    catch (err){};});


