/************************************************************************** 
*************************************************************************** 
*  Program Name: $Id: tab_control.js,v 1.1.1.1 2007/12/10 00:51:16 neo Exp $
*  Program Author:  Michael T. Schock
*  Creation Date: 05-15-2006
*  CVS Revision: $Revision: 1.1.1.1 $
*  Copyright (c) 2006
*************************************************************************** 
*************************************************************************** 
*  Program Summary:
*  Javascript functions for the tab class
*
*
*************************************************************************** 
**************************************************************************/

//  Function to change CSS when a tab is pressed
function On_Tab_Click(controlNumber, tabNumber, index)
{
	//  Variables
	var tabName;
	var tabClass;
	var loop;
	var bodyName;
	var bodyClass;
	
	//  Class Names
	tabClass = 'Tab_Unpressed_' + controlNumber;
	bodyClass = 'Tab_Invisible_' + controlNumber;
		
	//  Unselect all tabs
	for(loop = 0; loop < tabNumber; loop++)
	{
		//  Object names
		tabName = 'Tab_' + controlNumber + '_' + loop;
		bodyName = 'Tab_Content_' + controlNumber + '_' + loop;
		
		//  Set the Unpressed class and hide all content
		document.getElementById(tabName).className = tabClass;
		document.getElementById(bodyName).className = bodyClass;
	}

	//  Select the new tag based on the index passed to this function.
	bodyClass = 'Tab_Visible_' + controlNumber;
	tabClass = 'Tab_Pressed_' + controlNumber;
	
	tabName = 'Tab_' + controlNumber + '_' + index;
	bodyName = 'Tab_Content_' + controlNumber + '_' + index;
	
	document.getElementById(tabName).className = tabClass;
	document.getElementById(bodyName).className = bodyClass;
}

