/////////////////////////////////////////////////////////////////////////////////////////////////////
// this function toggles the content area's display property to be visible or not based on user request..
////////////////////////////////////////////////////////////////////////////////////////////////////
function setSectionFocus( focusId ){

	var i = 0;
	var thisElement;
	var focusTab;
	/////////////////////////////////////////////////////
	//show all sections
	/////////////////////////////////////////////////////
	if ( focusId == "sectionAll" ) {
	    while ( true ) {
			thisElement = document.all("section" + (++i));
			if ( thisElement == null )
			{
				// thisElement may be the all tab, skip over and test again
				thisElement = document.all("section" + (++i));
				if ( thisElement == null )				
				{
					break;
				}				
			}
			thisElement.className = "activeTabContent";
		}
	}
	////////////////////////////////////////////////////
	//show selected section
	////////////////////////////////////////////////////
	else {
	    while ( true ) {
			thisElement = document.all("section" + (++i));
			if( thisElement == null )
				break;
			boolShowHide = ( thisElement.id == focusId ) ? "activeTabContent" : "inactiveTabContent";
			thisElement.className = boolShowHide;
			if(boolShowHide == "activeTabContent"){
				thisElement.style.visibility = 'visible';
			//document.getElementById( thisElement.id +'frame' ).style.visibility = 'visible';
			//alert('frame : ' + document.getElementById( focusId +'frame' ).style.visibility);
			} else {
				thisElement.style.visibility = 'hidden';
			//document.getElementById( thisElement.id +'frame' ).style.visibility = 'hidden';
			}
		} // end for
	} // end else

	// set section tab focus
	focusTab = ( focusId == "sectionAll" ) ? "sectionAllTab" : ( focusId + "Tab" );
	setSectionTabFocus( focusTab );
	initialize();
	return;
}

////////////////////////////////////////////////////////////////////////////////////////////////
// function toggles the display on the Tab itself (active or inactive)
////////////////////////////////////////////////////////////////////////////////////////////////
function setSectionTabFocus( focusTab ){

	var i = 0;
	var thisElement;
	var tabCorner;
	var done = false;

	//first time through check the all tab
	thisElement = document.all("sectionAllTab");
	
	if ( thisElement == null )
		done = true;		//checked all tab
	
	while ( true ) {
		if ( !done ) 
			done = true;
		else
			thisElement = document.all("section" + (++i) + "Tab");

		if ( thisElement == null )
			break;
		else {
			tabCorner = thisElement.id + "Corner";

			if( thisElement.id == focusTab ) {
				thisElement.className = "activeSectionTab";
				if ( document.all(tabCorner) ){
					document.all(tabCorner).className = "activeTabCorner";
				}
			}else {
				thisElement.className = "inactiveSectionTab";
				if ( document.all(tabCorner) ){
					document.all(tabCorner).className = "inactiveTabCorner";
				}
			}
		}
	} // end for
	return;
}