function TabController(){
	this._tabPanels = new Array();
	this._tabButtons = new Array();
}

//Initialize tab control
TabController.prototype.addTabDiv = function(tabButtonId, tabPanelId){
	this._tabButtons.push(document.getElementById(tabButtonId));

	var div = document.getElementById(tabPanelId);
	this._tabPanels.push(div);
	div.style.display="none";
}

//happens when one of the tab page is being clicked
TabController.prototype.switchToTab = function(tabPanelId){
	var index=-1;	
	for(var i=0;i<this._tabPanels.length;i++){
		this._tabButtons[i].className="controlpanel-button";
		this._tabPanels[i].style.display="none";
		
		if(this._tabPanels[i].id == tabPanelId){
			index = i;
		}
	}

	if(index!=-1){
		this._tabButtons[index].className="controlpanel-button-selected";
		this._tabPanels[index].style.display="";
	}
}