	function initTabSystem(defaultTab)
	{
		var tab;
		if(document.location.hash!="")
			tab = document.getElementById(document.location.hash.replace('#', ''));
		if(!tab)
			tab = document.getElementById(defaultTab);
		else
			switchToTab(document.getElementById(defaultTab));
		switchToTab(tab);
	}
	
	function initTab(tab, button)
	{ if(tab && button) tab.button = button; }

	function switchToTab(tab)
	{
		if(tab)
		{
			if(typeof(tab)=="string") tab = document.getElementById(tab);
			if(this.currentTab && this.currentTab!=tab)
			{
				this.currentTab.style.display="none";
				if(tab.button && this.currentTab.button)
				{
					var oldClass = tab.button.className;
					tab.button.className = this.currentTab.button.className;
					this.currentTab.button.className = oldClass;
				}
			}
			tab.style.display="block";
			this.currentTab = tab;
		}
	}
