//=========================================================================================================
//---------------------------------------------------------------------------------------------------------
//	Toggle lists
//---------------------------------------------------------------------------------------------------------
//	item is the parent node of the link clicked on, which is the list item (LI)
//=========================================================================================================
var CurrentListHeight	= 0;
ListHeight	= new Array();

var ListWidth			= 160;

function InitLists()
{
	StartListHeight		= getOffsetHeight( "startlist" );

	document.getElementById( 'multilist' ).style.height	= StartListHeight + "px";
	document.getElementById( 'multilist' ).style.width	= ListWidth + "px";
}

function ToggleList( item, level )
{
	StartListHeight		= getOffsetHeight( "startlist" );
	CurrentListHeight	= StartListHeight;

	//	Get all lists under the active item
	lists	= item.parentNode.getElementsByTagName( "UL" );

	//	Hide all the lists
	for( var i = 0; i < lists.length; i++ )
	{
		lists[ i ].style.display	= "none";
	}

	//	Show only the active list
	//		Active list will be the first list element under the clicked on item
	active_list	= item.getElementsByTagName( "UL" );
	active_list[0].style.display	= "block";

//	stuff_id	= active_list[0].getAttribute( "id" );
//	alert( stuff_id );

	ListHeight[ level ]	= active_list[0].offsetHeight;

	for( var listlevel = level; listlevel > 0; listlevel-- )
	{
		if( ListHeight[ listlevel ] > CurrentListHeight )
		{
			CurrentListHeight	=  ListHeight[ listlevel ];
		}
	}

	document.getElementById( 'multilist' ).style.height	= ( 1 + CurrentListHeight ) + "px";
	document.getElementById( 'multilist' ).style.width	= ( 1 + ( ListWidth * ( level + 1 ))) + "px";

//---------------------------------------------------------------------------------------------------------
//	Links
//---------------------------------------------------------------------------------------------------------
	links	= item.parentNode.getElementsByTagName( "A" );

	for( var l = 0; l < links.length; l++ )
	{
		links[ l ].className	= "none";
	}

	active_link	= item.firstChild;
	active_link.className	= "active";

}
