// script include
	function tMnuItem(pId, pName, pTarget, pHref, pToolType, pActive, pParent){
		this.id = pId;
		this.name = pName;
		this.target = pTarget;
		this.href = pHref;
		this.parent = pParent;
		this.toolType = pToolType;
		this.active = pActive;
		this.subItems = new Array();
		this.createSubItem = tMnuItem_createSubItem;
		this.renderItem = tMnuItem_renderItem;
		this.renderContainer = tMnuItem_renderContainer;
		this.renderAllSubContainers = tMnuItem_renderAllSubContainers;
		this.sendCloseMessage = tMnuItem_sendCloseMessage;
		this.getItemById = tMnuItem_getItemById;
		};

	function tMnuItem_createSubItem(pId, pName, pTarget, pHref, pToolType, pActive){
	var mMnuItem = new tMnuItem(pId, pName, pTarget, pHref, pToolType, pActive, this)
		this.subItems[this.subItems.length] = mMnuItem;
		return(mMnuItem);
		};

	function renderMainMenu(){
		if(mainMenu.subItems.length>0){
			for(var i=0; i<mainMenu.subItems.length; i++){
				var strHTML = mainMenu.subItems[i].renderItem();
				document.write(strHTML);
				};
			};
		};
		
	function tMnuItem_renderItem(){
		var menuItem = null;
		var bgColor = "#f5f5f5";
		bgColor = (this.active == "true") ? "#ffffff" : "#f5f5f5";
		menuItem = "<tr><td id=" + this.id + " bgcolor=" + bgColor + "><table width=100% cellpadding=3 cellspacing=0 border=0><tr valign=top><td>";
		menuItem += "<font size=1><a style='text-decoration:none; font-weight: bold;' href='" + this.href + "' target='" + this.target + "'>" + this.name + "</a></font>";
		menuItem += "</td></tr></table>";
		if (this.subItems.length > 0){
			for(var i=0; i<this.subItems.length; i++){
				menuItem += "<table border=0 cellspacing=0 cellpadding=3 width=100%><tr><td>"
				menuItem += "<font size=1>&nbsp;&nbsp;&nbsp;&nbsp;<a style='text-decoration:none; font-weight: normal;' href='" + this.href + "' target='" + this.target + "'>" + this.subItems[i].name + "</a></font>";
				menuItem += "</td></tr></table>";
			}
		}
		menuItem += "</td></tr>";
		menuItem += "<tr><td height=1 bgcolor=#999999><img src='/_global/images/spacer.gif' width=1 height=1></td></tr>";
		return(menuItem);
	};
		
	function tMnuItem_renderContainer(){
	var tmpHTML = "";
		if(this.subItems.length>0){
			tmpHTML = "<TABLE id=\"p_" + this.id + "\" cellspacing=\"0\" cellpadding=\"0\" style=\"border-left:1px solid #999999;border-top:1px solid #999999;border-right:1px solid #999999;background: #CCCCD6;\">";
			tmpHTML += "<TR>"
			tmpHTML += "<TD id=\"td_" + this.id + "\" nowrap></TD></TR></TABLE>";
			document.getElementById(this.id).insertAdjacentHTML("beforeEnd", tmpHTML);
			for(var i=0; i<this.subItems.length; i++){
				this.subItems[i].renderItem(document.getElementById("td_" + this.id));
				};
			};
		};

	function tMnuItem_renderAllSubContainers(){
	var tmpHTML = "";
		for(var i=0; i<this.subItems.length; i++){
			tmpHTML += this.subItems[i].renderContainer();
			tmpHTML += this.subItems[i].renderAllSubContainers();
			};
		return(tmpHTML);
		};
		
	function tMnuItem_getItemById(pId){
	var mItem = null;
		if(this.id == pId) mItem = this
		else{
			for(var i=0; i<this.subItems.length; i++){
				mItem = this.subItems[i].getItemById(pId);
				if(mItem!=null) break;
				};
			};
		return(mItem);
		};
		
	function tMnuItem_sendCloseMessage(){
		if(this.parent!=null){
			if(this.subItems.length>0) document.getElementById("p_" + this.id).style.visibility = "hidden";
			};
		for(var i=0; i<this.subItems.length; i++){
			this.subItems[i].sendCloseMessage();
			};
		};

	function mnuOnMouseOver(){
	var objEvent = null;
	var dataElement = null;
	var otherElement = null;
		objEvent = window.event.srcElement;
		//foo.innerHTML = objEvent.id;
		if (objEvent.getAttribute("toolType") == "standard" && objEvent.className != "MenuActive")
		{
			objEvent.className = "MenuHot";
		}
		// hier den Pfeil ( img_.. ) abfangen
		if(objEvent.id.substring(0,4)=="img_"){
			objEvent = document.getElementById(objEvent.id.substring(4));
			};
		dataElement = mainMenu.getItemById(objEvent.id);
		if(dataElement!=null){
			for(var i=0; i<dataElement.parent.subItems.length; i++){
				otherElement = dataElement.parent.subItems[i];
				if(otherElement.id!=objEvent.id) otherElement.sendCloseMessage();
				};
			};
		if(document.getElementById("p_" + objEvent.id)!=null){
			document.getElementById("p_" + objEvent.id).style.visibility = "visible";
			};
			
		
		};

	function clearMenus(){
	var dataElement;
		dataElement = mainMenu.getItemById(window.event.srcElement.id);
		if(dataElement==null) mainMenu.sendCloseMessage()
		else{
			// ... location.href = dataElement.target;
			};
		};
		
function fnChangeLoc(){
		var src = window.event.srcElement;
		var href = src.getAttribute("href");
		var target = src.getAttribute("target");
		window.event.cancelBubble = "true";
		
		if (src.className != "MenuActive")
		{
			if (href == "")
			{
				window.location.href = "#";
			}
			else
			{
				if (target == "" || target == "_self")
				{
					window.location.href = href;
				}
				else
				{
					window.open(href, target, "");
				}
			}
		}
		else
		{
			return false;
		}
	}
	
	function fnHighlightMenu(){
		var src = window.event.srcElement;
		window.event.cancelBubble = "true";
		
		if (src.getAttribute("toolType") == "standard" && src.className != "MenuActive")
		{
			src.className = "MenuHot";
		}
	}
	
	function fnBlurMenu(){
		var src = window.event.srcElement;
		window.event.cancelBubble = "true";
		
		if (src.getAttribute("toolType") == "standard" && src.className != "MenuActive")
		{
			src.className = "MenuNormal";
		}
	}
	
	function fnPressMenu(){
		var src = window.event.srcElement;
		window.event.cancelBubble = "true";
		
		if (src.getAttribute("toolType") == "standard" && src.className != "MenuActive")
		{
			src.className = "MenuClicked";
		}
	}


