/* 
 * 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');

/**
 * StackContent Widget library.
 * @ignore
 * @author Jeremy KUHN
 */
zwg.widgets.content.StackContent = function() {

}
/**
 * The current selected stack
 */
zwg.widgets.content.StackContent.selectedStack = null;
/**
 * Show/hide the specified document part.
 * @param {String} the part Id.
 */
zwg.widgets.content.StackContent.showHide = function(string_id) {
	if(zwg.widgets.content.StackContent.selectedStack == null || string_id != zwg.widgets.content.StackContent.selectedStack) {
		if(zwg.widgets.content.StackContent.selectedStack != null) {
			document.getElementById(zwg.widgets.content.StackContent.selectedStack+'_header').className = 'stackContent_stack-header';
			document.getElementById(zwg.widgets.content.StackContent.selectedStack+'_content').style.display = 'none';
		}
		
		document.getElementById(string_id+'_header').className = 'stackContent_stack-header stackContent_stack-header-selected';
		document.getElementById(string_id+'_content').style.display = 'block';
		
		zwg.widgets.content.StackContent.selectedStack = string_id;
	}
}
