/* 
 * Copyright 2007 Jeremy KUHN
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

zwg.namespace('zwg.widgets.content');

/**
 * TabBar Widget library.
 * @ignore
 * @author Jeremy KUHN
 */
zwg.widgets.content.TabBar = function(string_id) {
	
}
/**
 * The current selected tab.
 */
zwg.widgets.content.TabBar.prototype.selectedTab = null;
/**
 * Select the specified tab.
 * @param {String} string_id The tab id.
 */
zwg.widgets.content.TabBar.prototype.selectTab = function(string_id) {
	if(this.selectedTab != null) {
		var selectedTabContent = document.getElementById(this.selectedTab+'_content');
		var selectedTabTab = document.getElementById(this.selectedTab+'_tab');
		selectedTabTab.className = 'tabItem';
		selectedTabContent.style.display = 'none';
	}
	
	this.selectedTab = string_id;
	var selectedTabContent = document.getElementById(this.selectedTab+'_content');
	var selectedTabTab = document.getElementById(this.selectedTab+'_tab');
	selectedTabTab.className = 'tabItem tabItem-selected';
	selectedTabContent.style.display = 'block';
}
