function TabEngine() {
	this.tabs = null;
	this.containers = null;
	this.currentIndex = 0;
	
	this.manageTabChange = function(index) {
		if (index!=this.currentIndex) {
			this.currentIndex = index;
			for (var i=0; i<this.containers.length; i++) {
				if (i == index) this.containers[i].style.display = "block";
				else this.containers[i].style.display = "none";
			}
		}
	}
	
	this.initialize = function(id, q) {
		this.tabs = new Array();
		this.containers = new Array();
		for (var i=1; i<=q; i++) {
			var tab = document.getElementById('JS_Tab_Engine_'+id+'_Tab_'+i);
			var container = document.getElementById('JS_Tab_Engine_'+id+'_Container_'+i);
			tab.index = i-1;
			tab.te = this;
			tab.onclick = function() {
				this.te.manageTabChange(this.index);
			}
			this.tabs.push(tab);
			this.containers.push(container);
		}
	}
}