// Global variables
var elemCurrentSelectedTabContents = '';
var elemCurrentSelectedTab = '';

// Switch between the tabs
function swithtabs(whichtab)
{
	var elemTabContents = document.getElementById('tabcontents_' + whichtab );
	var elemTab = document.getElementById('tab_' + whichtab );
	
	// if currentselected tab exists, hide it
	if (elemCurrentSelectedTabContents)
	{
		elemCurrentSelectedTabContents.style.display = 'none';
		elemCurrentSelectedTabContents = '';
	}
	if (elemCurrentSelectedTab)
	{
		elemCurrentSelectedTab.className = 'nonActiveTab'
	}
	
	if (elemTabContents)
	{
		elemTabContents.style.display = 'block';
		elemCurrentSelectedTabContents = elemTabContents;
	}
	if (elemTab)
	{
		elemTab.className = 'activeTab';
		elemCurrentSelectedTab = elemTab;
	}
	
	//Set pass active tab field
	var elemActiveTab = document.getElementById('ActiveTab');
	if (elemActiveTab)
	{
		elemActiveTab.value = whichtab;
	}
	
	//Reposition the document footer
	placeFooter();
}

function fnOtherFunctions()
{
	fnSetTab();
}

function fnSetTab(blaat)
{
	var tabId = '';
	//If the page supports tab remembering, get the last tab
	var curTab = document.getElementById('ActiveTab');
	if (curTab)
	{
		tabId = curTab.value;
	}
	
	//If no id is found, the 1st tab is the default
	if (tabId == '')
	{
		tabId = 1;
	}
	
	curTabSelected = document.getElementById('tab_' + tabId);
	if (curTabSelected)
	{
		curTabSelected.className = 'activeTab';
		elemCurrentSelectedTab = curTabSelected;
	}
	curShowTab = document.getElementById('tabcontents_' + tabId);
	if (curShowTab)
	{
		curShowTab.style.display = 'block';
		elemCurrentSelectedTabContents = curShowTab;
	}

}
