	
	var m_selectedTab = null;
	var m_selectedPage = null;
	
	function getElementById (elementId)
	{
		return document.getElementById (elementId);
	}
	
	function selectTab (tab)
	{
		if (m_selectedTab != tab)
		{
			// Deselect the old tab and hide the old page
			if (m_selectedTab != null)
				m_selectedTab.className = 'tab';
			
			if (m_selectedPage != null)
				m_selectedPage.className = 'pageView';
			
			// Select the new tab and show the new page
			m_selectedTab = tab;
			m_selectedTab.className = 'tabselected';
			
			m_selectedPage = getElementById (tab.id.replace("Tab", "Page"));
			m_selectedPage.className = 'pageViewSelected';
		}
	}


