<!--
//==========================
// TAB TOGGLE FUNCTION
// V.Einwohner (6/21/2007)
//==========================
function toggleTab(id)
{
	// Some variables
	var section			= "";
	var tab				= "";
	var sectionHide		= "";
	var tabOff			= "";
	var tabNameOn		= "";
	var tabNameOff		= "";
	var tabCount		= ""
	
	// Tab/Section clicked on
	section			= document.getElementById("section_"+id);
	tab				= document.getElementById("tab_"+id);
	
	// Number of tabs present
	tabCount		= getElementsByClassName(document,'img','tab').length;
	
	// If the tab clicked on was already open, don't force the close
	if (section.style.display != 'block')
	{
		// Run through all available tabs
		for (i=1; i<=tabCount; i++)
		{
			// Find opened section
			sectionHide		= document.getElementById("section_"+i);
			tabOff			= document.getElementById("tab_"+i); 
			tabNameOff		= document.getElementById("tab_"+i).name; 
			// If section is visable, hide it and turn off tab
			if (sectionHide.style.display == 'block')
			{
				sectionHide.style.display		= 'none';
	        	sectionHide.style.visibility	= 'hidden';
				tabOff.src						= '/weimages/buttonsetc/tabs/'+tabNameOff+'.gif';
				
				// Break out of loop since there can only be one tab to turn off
				break;
			}
	    }
		// Then display new section and turn on new tab
		section.style.display		= 'block';
        section.style.visibility	= 'visible';
		tabNameOn					= document.getElementById("tab_"+id).name;
		tab.src						= '/weimages/buttonsetc/tabs/'+tabNameOn+'_on.gif';
	}
}

// Function to open up a tab based on its name
function tabFocus(name)
{
	// Grab all tab inforamtion
	var numTabs = getElementsByClassName(document,'img','tab');
	// Loop through tabs
	for (var i=0;i<=numTabs.length;i++)
	{
		//alert(i+") "+numTabs[i].name+" | "+name)
		// Match name of tab with name that was passed into function
		if (numTabs[i].name == name)
		{
			// Open the matched tab
			toggleTab(i+1)
			// Break out of loop since there can only be one match
			break;
		}
	}
	// Scroll page to a place that brings most of tabs into view (better focus)
	window.scrollTo(0,215)
}

// Used to keep track of the number of tabs (and to grab all tab information)
function getElementsByClassName(oElm, strTagName, strClassName)
{
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/-/g, "\-");
	var oRegExp = new RegExp("(^|\s)" + strClassName + "(\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++)
	{
		oElement = arrElements[i];
		if(oRegExp.test(oElement.className))
		{
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}
//==========================
// TAB TOGGLE FUNCTION
// V.Einwohner (6/21/2007)
//==========================
//-->