//=============================================================================================================
// Author: Hans-Juergen Schaeffer (SHA) (C) gedas deutschland GmbH
// This script is used to show a tabed pannel and switch the shown panel when 
// a tab-button is clicked.
// ============================================================================================================

var tabCount = 1; //initialy only one tab
var tabCount1 = 1; //initialy only one tab

/*
* Changes the tab-button i to be aktive and the other tab-buttons
* to be inaktive. 0 < i < number of tab-buttons - 1
*/
function changeActiveTab(i) {
	for( j=0; j < tabCount; ++j ) {
		if( i==j ) { activateTab(j); }
		else { deactivateTab(j); }
	}
}

/*
* Activates the tab-button i and shows it's content panel.
*/
function activateTab(i) {
//alert("activateTab :"+i);
	document.getElementById( "tab-bg:"+i ).className="tab_on"
	document.getElementById( "tab-body:"+i ).style.display='block';
}

/*
* Deactivates the tab-button i and hides it's content panel.
*/
function deactivateTab(i) {
//alert("deactivateTab :"+i);
	document.getElementById( "tab-bg:"+i ).className="tab_off"
	document.getElementById( "tab-body:"+i ).style.display='none';
}

/*
* Call this function before calling any other function.
* Set parameter i to the number of tab-buttons when calling.
* Initialises the script.
*/
function initTabScript(i) {
	tabCount = i;
}

/*
* Changes the tab-button i to be aktive and the other tab-buttons
* to be inaktive. 0 < i < number of tab-buttons - 1
*/
function changeActiveTab1(i) {
//alert (tabCount1);
	for( j=0; j <= tabCount1; ++j ) {
		if( i==j ) { activateTab1(j); }
		else { deactivateTab1(j); }
	}
}

/*
* Activates the tab-button i and shows it's content panel.
*/
function activateTab1(i) {
//alert("activateTab : "+i);
	document.getElementById( "tab-bg:"+i ).className="tab_on1"
	document.getElementById( "tab-body:"+i ).style.display='block';
}

/*
* Deactivates the tab-button i and hides it's content panel.
*/
function deactivateTab1(i) {
//alert("deactivateTab : "+i);
	document.getElementById( "tab-bg:"+i ).className="tab_off1"
	document.getElementById( "tab-body:"+i ).style.display='none';
}

/*
* Call this function before calling any other function.
* Set parameter i to the number of tab-buttons when calling.
* Initialises the script.
*/
function initTabScript1(i) {
//alert("initTabScript : "+i);
	tabCount1 = i;
}