function toggleTreeBranch( button )
{
	ToggleTreeBranch( button );
}

function ToggleTreeBranch( button )
{
	// "toggle" will be a "SPAN" tag that contains the
	// contents of the branch

//	toggle = button.document.all[ button.getAttribute( "TOGGLE" ) ];
	toggle = document.getElementById(button.getAttribute( "TOGGLE" ));

	// Was it visible before?
	if (typeof(toggle) == "object")
	{
		if ( ( toggle.style.display == "none" )
		||   ( toggle.style.display == "" ) )
		{
			// Make it visible
			toggle.style.display = "inline"; 
			button.src = "/e107_themes/bulldozer/images/toggle.png";

			if ( "true" == toggle.getAttribute( "EXTERNAL" ) )
			{
				var HTMLstr = window.external.GetTOC( toggle.id );
				toggle.innerHTML = HTMLstr;
				toggle.setAttribute( "EXTERNAL", "");
				top.CheckTOCEffectivity();
			}
		}
		else
		{
			// Make it invisible
			toggle.style.display = "none";
			button.src = "/e107_themes/bulldozer/images/toggle.png";
		}
	}
	else
	{
		// ***** TO DO *****
		// Could be an error message here if the toggle doesn't exist!!!
		alert("Internal Table of Contents Error.\nTry again or Reinstall Book Data.\n");
	}
}

