/*
Hide and show tabs
*/

tabs = Class.create();
tabs.prototype = {
	
	initialize: function (pIdName) {
		this.checkBrowser();
		this.obj = new Array();
		this.idMenuShown = 'menu' + pIdName;
		this.idMenu = null;
		this.idShown = 'tab' + pIdName;
		this.id = null;
	},

	showTab: function (pIdName) {
		if ('tab' + pIdName != this.idShown) {	
			this.id = 'tab' + pIdName;
			var elementId = this.id;
			var elementIdShown = this.idShown;
			this.obj[elementId] = (this.dom)? document.getElementById(elementId).style : document.elementId;
			this.obj[elementIdShown] = (this.dom)? document.getElementById(elementIdShown).style : document.elementIdShown;
			this.obj[elementId].display = 'block';
			this.obj[elementIdShown].display = 'none';
			this.idShown = this.id;
		}
	},

	showMenu: function (pIdName) {
		if ('menu' + pIdName != this.idMenuShown) {		
			this.idMenu = 'menu' + pIdName;
			var elementIdMenu = this.idMenu;
			var elementIdMenuShown = this.idMenuShown;
			if (this.dom) {
				document.getElementById(elementIdMenu).setAttribute('class', 'selected');
				document.getElementById(elementIdMenu).className = 'selected';
				document.getElementById(elementIdMenuShown).setAttribute('class', 'hidden');
				document.getElementById(elementIdMenuShown).className = 'hidden';
			} else {
				document.elementIdMenu.className = 'selected';
				document.elementIdMenuShown.className = 'selected';
			}
			this.idMenuShown = this.idMenu;
		}
	},

	checkBrowser: function () {
		this.dom = document.getElementById;
		this.ns4 = document.layers;
	}

}

