$(document).ready(function() {
	// add a "current" class to nav elements for wayfinding
	$(".navlev1 a, .navlev2 a, .navlev3 a").each(function() {
		if (document.location.href.indexOf(this.getAttribute("href")) != -1) $(this).parents("li").addClass("current");
	});
	// this line removes the "current" status from the overview link if another nav item is also "current"
	//// this is because the href for the overview will always match the location even if we are on a different page in the same section
	if ($(".navlev2 li.current").size() > 1) $(".navlev2 li.current:first-child").removeClass("current");
	if ($(".navlev3 li.current").size() > 1) $(".navlev3 li.current:first-child").removeClass("current");
	
	// zebra stripe tables
	$("table").not(".practitioners").find("tr:odd td").addClass("alt");
	
	// make a first-child class for IE since it doesn't understand the selector
	$("ul li:first-child").addClass("first-child");
	
	// enable table sorting for practitioners list
	if ($("table.practitioners").size() > 1) {
		$("table.practitioners").tableSorter({
			sortColumn: 'Name',			// Integer or String of the name of the column to sort by.
			sortClassAsc: 'headerSortUp',		// Class name for ascending sorting action to header
			sortClassDesc: 'headerSortDown',	// Class name for descending sorting action to header
			headerClass: 'headerSort',			// Class name for headers (th's)
			stripingRowClass: ['','alt'],	// Class names for striping supplyed as a array.
			stripRowsOnStartUp: true		// Strip rows on tableSorter init.
		});
		$("table.practitioners th").attr("title","Click to sort the table based on this column");
	}
});