// JavaScript Document
var intCount = 0;
	
function DynamicMenu_addParent(strName)
{
	var strID = 'ID' + intCount++; 

	var strTemp = '<DIV ID="' + strID + '" CLASS="parent" onClick="expandCollapse(this);">';
	strTemp = strTemp + '<IMG SRC="/images/plus.jpg" Height="9">';
	strTemp = strTemp + '&nbsp;' + strName ;
	strTemp = strTemp + '<DIV STYLE="display: none" CLASS="child"></DIV>';
	strTemp = strTemp + '</DIV>';
	this.div.innerHTML += strTemp;
	this.currentChild = document.getElementById(strID);
}

function DynamicMenu_addChild(strName,strURL)
{
	var strTemp = '&nbsp;&nbsp;&nbsp;&nbsp;<A STYLE="text-decoration: none; color:000000;" HREF="' + strURL + '" onClick="cancelBubble(arguments[0]);exit=false" onMouseOver="this.oldColor=this.style.color;this.style.color=\'red\';" onMouseOut="this.style.color=this.oldColor;">' + strName + '</A><BR>';
	if (document.all) {
		this.currentChild.children[1].innerHTML += strTemp;
	} else {
		this.currentChild.childNodes[2].innerHTML += strTemp;
	}
}

function cancelBubble(netEvent) 
{
	if (document.all) 
	{
		window.event.cancelBubble = true;
	} 
	else 
	{
		netEvent.cancelBubble = true;
	}
}

function expandCollapse(objElement) 
{
	if (document.all) 
	{
		var imgIcon = objElement.children[0];
		objElement = objElement.children[1];
	}
	else 
	{
		var imgIcon = objElement.childNodes[0];
		objElement = objElement.childNodes[2];
	}    

	if (objElement.style.display == "none") 
	{  
		objElement.style.display = "block" ;
		imgIcon.src = "/images/moin.jpg" ;
	}
	else 
	{
		objElement.style.display = "none" ;
		imgIcon.src = "/images/plus.jpg" ;
	}
}

function DynamicMenu() 
{
	var id = "Menu" + intCount++;
	document.write('<DIV Id="' + id + '"></DIV>');

	this.div = document.getElementById(id);
	this.currentChild = null;

	this.addParent = DynamicMenu_addParent;
	this.addChild = DynamicMenu_addChild;
}