var currentSelectedTabId = "tabRacecar"; // Programatically set in the html page

function switchRecentWorkTabs(obj) {
	// This function will change between two tab pages in the recent work tabbed view. It will change the visibility of the inner divs and change the class on the LI element.
	// As a general convention all tabs have an id prefixed by "tab" and the main tab pages (divs) have the same id prefixed by "tabPane".
	// Thus we can use the incoming tab id to do the switch by setting classes and css properties.
	
	var currentSelectedTab = document.getElementById(currentSelectedTabId);
	var currentSelectedTabPane = document.getElementById("tabPane" + currentSelectedTabId.substring(3));
	var newSelectedTab = document.getElementById(obj.id);
	var newSelectedTabPane = document.getElementById("tabPane" + obj.id.substring(3));
	
	// Switch tab classes:
	currentSelectedTab.className = "";
	newSelectedTab.className = "selected";
	
	// Switch visible tab panes:
	currentSelectedTabPane.style.display = "none";
	newSelectedTabPane.style.display = "block";
	
	currentSelectedTabId = obj.id;
//	alert(currentSelectedTabPane);
}
