    //active_side = 132;

    //Layer für das  Menu


    //Zweig
    strBranch           = 'branch';

     //Display-Eigenschaften für Menupunkte
    arrDisplay = new Array('none','inline');

	// enthält das aktuelle Objekt
	akt_obj = false;

	// globales Array
    arrTree = new Array();


    function expand(obj)
    {
    	if(obj.lastChild.style.display != "inline")
	    {
		    intEvent = (obj.lastChild.style.display == 'none'
		                || expand.arguments.length > 1) ? 1 : 0;
			
			if(akt_obj && akt_obj.childNodes.length>1) {
				akt_obj.lastChild.style.display = "none";
				akt_obj.firstChild.removeAttribute('id');
			}
			akt_obj = obj;
	
			if(is_active_link(obj.firstChild.name) && obj.childNodes.length==1) 
				obj.firstChild.setAttribute('id',"oneactive");
			
			else if(is_active_link(obj.firstChild.name))
			{
				obj.firstChild.setAttribute('id',"oneactive");
				obj.lastChild.style.display=arrDisplay[intEvent];
			}
			else 
			{
				obj.firstChild.setAttribute('id',"active");
				obj.lastChild.style.display=arrDisplay[intEvent];
				
			}
		}
    }


    /** "Parsen" der Listeneinträge und erzeugen der Baumstruktur */

    function build_tree()
    {
        if( arrTree.length <= intDimension)
            {
            arrTree.push(strBranch);
            }

		if(objItem.lastChild.tagName == "UL") 
			objItem.firstChild.setAttribute('onclick',"expand(this.parentNode);blur()");


        if (!is_file(objItem))
            {
            arrTree[intDimension] = 'line';
            if (is_end(objItem))
                {
                arrTree[intDimension] = 'space';
                }
            }
        }


    /**
      * Dimensionen > 1 verstecken und
      * Listen-Eigenschaften entfernen
      **/
    function collapse_menu()
    {
        objItem.style.listStyleType = 'none';
        objItem.style.display = 'inline';
        objItem.style.padding = 0;
        objItem.parentNode.style.display = (get_dimension(objItem) == 0)
                                                ? 'inline'
                                                : 'none';

    }

    /** Befindet sich Objekt innerhalb des Menues */
    function in_menu(obj)
    {
    objParentNode = obj.parentNode;
    while(objParentNode != objMenu && objParentNode.tagName != 'BODY')
        {
        objParentNode = objParentNode.parentNode;
        }
    return(objParentNode == objMenu);
    }


    /** Enthält objekt eine UL-Liste */
    function is_file()
    {
    return(!objItem.hasChildNodes()||objItem.lastChild.tagName!='UL')
    }


    function get_dimension()
    {
        intDimension=-1;
        objParentNode=objItem.parentNode;
        while(objParentNode!=objMenu)
            {
            if(objParentNode.tagName=='UL'){intDimension++;}
            objParentNode=objParentNode.parentNode;
            }
        return intDimension;
    }

    function is_end()
    {

    return(objItem==objItem.parentNode.lastChild);
    }


    function strip_spaces(str)
    {
    strOut=str.replace(/>\s+</gm,'><');
    strOut=str.replace(/>\s+/gm,'>');
    strOut=str.replace(/\s+</gm,'<');
    return strOut;
    }

    /** Durchalufen alle Li-Elemente */
    function init_menu()
    {
    if (!document.getElementsByTagName
        || typeof document.getElementsByTagName('html')[0].innerHTML != 'string')
        {
        return;
        }

    objMenu.innerHTML = strip_spaces(objMenu.innerHTML);

    for (l = 0; l < document.getElementsByTagName('li').length; ++l)
            {
            objItem = document.getElementsByTagName('li')[l];

            if (in_menu(objItem))
                {
                intDimension = get_dimension(objItem);
                collapse_menu(objItem);
                build_tree(objItem);
                }
            }
    objMenu.innerHTML = strip_spaces(objMenu.innerHTML);
    opening();
    objMenu.style.visibility	=	"visible";
    }


    /** Aktuellen Link ermitteln und Menu epandieren */
    function opening()
    {

    for(a = 0; a < document.links.length; ++a)
        {
        if (in_menu(document.links[a]))
            {

            objFolder = document.links[a].parentNode;

		    if (is_active_link(document.links[a].getAttribute("name")))
                {
                while(objFolder.parentNode != objMenu)
                    {
                    if(objFolder.tagName == 'UL')
                        {
                        expand(objFolder.parentNode,1);
                        document.links[a].setAttribute("id","subactive");
                        }
                     else if(objFolder.parentNode.parentNode.tagName == "DIV")
                        {
                    	 expand(objFolder,1);
                     
                        }

                    objFolder=objFolder.parentNode;
                    }
                }
            }
        }
    }


    /** Prüfen ob Link aktueller Seite entspricht */
    function is_active_link(id)
    {
	  return ("side"+active_side == id);
    }


