$(document).ready(
	function(){
		$('body').addClass("js");
		initTabs();
	}
)

function initTabs(){
	tabs = $('#primary-content .tabSet .tabs li a');
	tabs.click(
		function(){
				//get the tab's tabSet ID
			targetID = "#" + $(this).closest('.tabSet').attr("id");
				//get the .selected tab from this tabSet
			selectedTabPath = targetID + " .tabs li a.selected";
				//unselect the currently selected tab of this tabSet
			$(selectedTabPath).removeClass("selected");
			
				//get the currently selected tabContent of the appropriate tabSet
			selectedTabContentPath = targetID + " .tabContentContainer .tabContent";
				//unselect the currently selected tabContent of this tabSet
			$(selectedTabContentPath).removeClass("selected");
				
			me = $(this);
				//select the clicked tab
			me.addClass("selected");
				
				//get the appropriate tabContent of the current tabSet
			currentTabPath = targetID + " " + me.attr("href");
				//set the tabContent of the current tabSet
			$(currentTabPath).addClass("selected");
			return false;
		}
	)
}
