function RegisterTab(tabGroup, tabButtonId, tabId, clickCallbackFunctionString)
{
	var tabButton = document.getElementById(tabButtonId);
	var tabTab = document.getElementById(tabId);

	if (typeof(document.__Tab_Group) == 'undefined')
	{
		document.__Tab_Group = new Object();
	}
	if (typeof(document.__Tab_Group[tabGroup]) == 'undefined')
	{
		document.__Tab_Group[tabGroup] = new Object();
	}
	document.__Tab_Group[tabGroup][tabButtonId] = new Object();
	document.__Tab_Group[tabGroup][tabButtonId].button = tabButton;
	document.__Tab_Group[tabGroup][tabButtonId].tab = tabTab;

	tabButton.__tab = tabTab;
	tabTab.__button = tabButton;

	if (typeof(clickCallbackFunctionString) != 'undefined' && clickCallbackFunctionString != null)
	{
		document.__Tab_Group[tabGroup][tabButtonId].button.onclick = new Function('ShowTab(\'' + tabGroup + '\', \'' + tabButtonId + '\');' + clickCallbackFunctionString);
	}
	else
	{
		document.__Tab_Group[tabGroup][tabButtonId].button.onclick = new Function('ShowTab(\'' + tabGroup + '\', \'' + tabButtonId + '\');');
	}
}
function ShowTab(tabGroup, tabButtonId, keepMessage)
{
	if (typeof(document.__Tab_Group[tabGroup]) != 'undefined')
	{
		HideTabs(tabGroup, keepMessage);
		var tab = document.__Tab_Group[tabGroup][tabButtonId];
		var section = $(tab.tab);
		var button = $(tab.button);
		section.show();
		button.addClass("selected");
		//document.__Tab_Group[tabGroup][tabButtonId].tab.style.display = 'block';
		//$(document.__Tab_Group[tabGroup][tabButtonId].tab).addClass("selected");
	}
}
function HideTabs(tabGroup, keepMessage)
{
	if (typeof(keepMessage) == "undefined" || keepMessage == null)
	{
		keepMessage = false;
	}
	if (typeof(document.__Tab_Group[tabGroup]) != 'undefined')
	{
		for (var key in document.__Tab_Group[tabGroup])
		{
			var tab = document.__Tab_Group[tabGroup][key];
			var section = $(tab.tab);
			var button = $(tab.button);
			section.hide();
			button.removeClass("selected");
			//document.__Tab_Group[tabGroup][key].tab.style.display = 'none';
			//$(document.__Tab_Group[tabGroup][key].tab).removeClass("selected");
		}
		/* Integration with messaging system - hide any message that might be displayed... */
		if (!keepMessage && typeof(hideMessage) == "function") { hideMessage(); }
	}
}