/*----------------------------------------------------------------------------\
'   File:			qds_cTabManager.js
'	Copyright (C):	2002, QuadroS DK (http://www.QuadroS.dk)
'					This file is free software; you can redistribute it and/or modify it under the terms 
'					of the GNU General Public License as published by the Free Software Foundation; 
'					either version 2 of the License, or (at your option) any later version.
'					You can read the full GNU General Public License at http://www.gnu.org/copyleft/gpl.html
'
'	Description:	Only tested on IE
'	Dependencies:	
'
'Version			1.0
'	Author:			Jon Emil Sørensen (emil.sorensen@iconmedialab.dk)
'	Company:		QuadroS (http://www.QuadroS.dk)
'	Date:			2003-01-15
\----------------------------------------------------------------------------*/

function qds_cTabManager(_name){	
	this.name = _name;
	this.normalizedClassName = '';
	this.highlightedClassName = '';
	this.selectedClassName = '';
	this.currentTab = null;
	this.currentTabContainer = null;

	qds_cTabManager.prototype.hideTabContainer = qds_cTabManager_hideTabContainer;
	qds_cTabManager.prototype.highlightTab = qds_cTabManager_highlightTab;
	qds_cTabManager.prototype.normalizeTab = qds_cTabManager_normalizeTab;
	qds_cTabManager.prototype.showTabContainer = qds_cTabManager_showTabContainer;
}

function qds_cTabManager_hideTabContainer(tab, tabContainer){
	if (document.readyState == 'complete'){
		var tabHeader = document.getElementById(tab.id + 'Header'); 
		tabHeader.className = this.normalizedClassName;
		//tab.className = this.normalizedClassName;
		tabContainer.style.display = 'none';
	}
}
function qds_cTabManager_highlightTab(tab){
	
	if (document.readyState == 'complete'){		
		//alert(this.highlightedClassName);
		if (tab!=this.currentTab) {
			var tabHeader = document.getElementById(tab.id + 'Header'); 
			tabHeader.className = this.highlightedClassName;
			//tab.className = this.highlightedClassName;
		}
	}
}
function qds_cTabManager_normalizeTab(tab){	
	
	if (document.readyState == 'complete'){
		
	//	alert(this.normalizedClassName);
		if (tab!=this.currentTab) {
			var tabHeader = document.getElementById(tab.id + 'Header'); 
			tabHeader.className = this.normalizedClassName;
			//tab.className = this.normalizedClassName;
		}
	}
}
function qds_cTabManager_showTabContainer(tab, tabContainer){
	if (document.readyState == 'complete'){
		if (tab!=this.currentTab){			
			this.hideTabContainer(this.currentTab, this.currentTabContainer);			
			tabContainer.style.display = 'block';			
			var tabHeader = document.getElementById(tab.id + 'Header');
			tabHeader.className = this.selectedClassName;
			//tab.className = this.selectedClassName;
			this.currentTab = tab;
			this.currentTabContainer = tabContainer;
			
		}
	}
}
