var tabBar = null;


// update the page content when the response is received
function tab_Change(responseText, status) {
	document.getElementById('content').innerHTML = responseText;
}


// request page content
function tabSelect(tabBarID, tabName) {
	tabBar = document.getElementById(tabBarID);
	
	$.post("ajax.php", {action: tabName}, tab_Change);
	formatTabBar(tabName);
}


function formatTabBar(activeTabName) {
	if (tabBar == null) {
		return;
	}
	tabs = tabBar.childNodes;
	for (var i = 0; i < tabs.length; i++) {
		tabs[i].className = "Tab";
	}
	document.getElementById(activeTabName).className = "Tab Active";
}

