var Tab = { // manage tabulated page content, show/hide tabs and content sections
	Sel: function(selTab) { // switch selected tab and content section
		var i=1, tab=true, area, tabSet=selTab.replace(/Tab([0-9]+)/,""); // get tab set name
		var tabName=tabSet+"Tab", sel=document.getElementById(selTab); // get tab name and current tab
		var obj=document.getElementById(selTab+"Area"); // get current tab area
		while (tab) { // for every tab/area, perform show/hide
			tab = document.getElementById(tabName + i);
			if (tab) {
				if (sel && tab.id != sel.id) { tab.className = ""; } // unselect tabs
				area = document.getElementById(tabName + (i++) + "Area"); // get tab area
				if (area && obj && area.id != obj.id) { // hide unselected tab area
					area.className = ((tabSet != "")? tabName + " " : "") + "offTab";
				}
			}
		}
		if (sel) { // set selected item
			if (obj) { obj.className = ((tabSet != "")? tabName + " " : "") + "selTab"; } // current tab area
			sel.className = "selTab"; // curent tab
			sel.blur(); // remove click focus
		}
		return false; // disable anchor location HREF
	},
	Init: function(tabSet, act) { // initialize tab set and interraction method
		var i, j, obj=true;
		act = (act && act.length > 0)? act : "click"; // set default tab action to click
		for (i=0; i < tabSet.length; i++) { // for each tab set
			j = 1; obj = true;
			while (obj) { // tab interractions
				obj = document.getElementById(tabSet[i] + "Tab" + (j++));
				if (obj) { obj["on" + act] = function() { return Tab.Sel(this.id); }; }
			}
		}
	}
};

