/*
 * tabset.js Apr 18, 2005
 *
 * $Id$
 *	$Revision$
 * $Date$
 * $Author$
 * $State$ 
 * 
 * Copyright 2005 progos.hu All rights reserved. PROGOS
 * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

function TabSet() {
	this.m_tabs = new Object();
}

TabSet.prototype.addTab = function _tbs_addTab(tab) {
	this.m_tabs[tab.m_id] = tab;
}

TabSet.prototype.activate = function _tbs_activate(id) {
	if (this.m_tabs[id] == null) {
		return;
	}

	for (t in this.m_tabs) {
		var tab = this.m_tabs[t];
		tab.m_div.style.display = (t == id ? "block" : "none");
		tab.m_tab.className = (t == id ? "active-tab" : "tab");
	}
}

function Tab(id) {
	this.m_id = id;
	this.m_div = document.getElementById(id);
	this.m_tab = document.getElementById("_tab_" + id);
}

