        iLastLvl1 = -1;
        iLastLvl2 = -1;
        iLastSubMenu = -1;
        iLastLvl1Hover = -1;
        iLastLvl2Hover = -1;
        iLastActive = -1;

				function setActiveItemLvl1(iMenuIndex, strCssPost, iTry)
				{
					if(typeof(iTry) == 'undefined')
					{
						iTry = 1;
					}
	
					try
					{
						onmouseclickLvl1(iMenuIndex, strCssPost);
					}
					catch(E)
					{
						if(iTry < 10)
						{
							window.setTimeout('setActiveItemLvl1(' + iMenuIndex + ', "' + strCssPost + '", ' + (iTry + 1) + ')', 250);
						}
					}
				}

				function setActiveItemLvl2(iMenuIndex, iParent, strCssPost, iTry)
				{
					if(typeof(iTry) == 'undefined')
					{
						iTry = 1;
					}
	
					try
					{
						onmouseclickLvl1(iParent, strCssPost);
						onmouseclickLvl2(iMenuIndex);
					}
					catch(E)
					{
						if(iTry < 10)
						{
							window.setTimeout('setActiveItemLvl2(' + iMenuIndex + ', ' + iParent + ', "' + strCssPost + '", ' + (iTry + 1) + ')', 250);
						}
					}
				}


				function setActiveMenu(iMID, strMenuName)
				{
					var iMenuNameIndex = -1;
		
					// Index von Menü suchen
					for (i=0; i< LCSiteMenus.length; i++)
					{
						var menuName = LCSiteMenus[i][3];
						if (menuName == strMenuName)
						{
							iMenuNameIndex = i;
							break;
						}
					}

					if (iMenuNameIndex > -1)
					{
				
						iParent = -1;				
						iLvl1Count = 0;
						for (var i = iMenuNameIndex + 1; i < LCSiteMenus.length; i++)
						{
							

							if (LCSiteMenus[i][0] == 1)
							{
								iLvl1Count++;
								strMenuItem = 'menuItem' + iLvl1Count;
								if (LCSiteMenus[i][1] == iMID)
								{
									setActiveItemLvl1(i-1, strMenuItem);
									break;
								}
								iParent = i;
							}
						
							if ((LCSiteMenus[i][0] == 2) && (LCSiteMenus[i][1] == iMID))
							{
								
								setActiveItemLvl2((i - 1), (iParent - 1), strMenuItem);
								
								break;		
							}
					
						}
					}
				}

				// Workaraound damit bei MouseOver wirklich nur dann getriggert wird wenn Menü verlassen wird und nicht auch bei onmouseover von einem Child Element
        function domContains (container, containee)
        {
          while (containee)
          {
            if (container === containee)
            {
              return true;
            }
            containee = containee.parentNode;
          }
          return false;
        }

        // Workaraound damit bei MouseOver wirklich nur dann getriggert wird wenn Menü verlassen wird und nicht auch bei onmouseover von einem Child Element
        function checkMouseLeave (node, evt)
        {
          if (typeof evt.relatedTarget != 'undefined')
          {
            return !domContains(node, evt.relatedTarget);
          }
          else if (typeof evt.toElement != 'undefined' && typeof node.contains != 'undefined')
          {
            return !node.contains(evt.toElement);
          }
        }

        function onmouseoverLvl1(iMenuIndex, strCssPost, iTry)
        {
	          if(typeof(iTry) == 'undefined')
            {
            	iTry = 1;
            }
            try
            {

            	if ((iLastLvl1Hover > -1) && (iLastLvl1Hover != iLastLvl1))
            	{
	            	document.getElementById('lvl1_' + iLastLvl1Hover).setAttribute('class', 'lvl1normal');
            	}

            	var objLvl1Hover = document.getElementById('lvl1_' + iMenuIndex);
            	if (typeof (objLvl1Hover) != 'undefined')
            	{
                objLvl1Hover.setAttribute('class', 'lvl1active ' + strCssPost);
                iLastLvl1Hover = iMenuIndex;
            	}
            	
            }
            catch(E) 
            {
            	if(iTry < 10)
              {
              	window.setTimeout('onmouseoverLvl1(' + iMenuIndex + ',"' + strCssPost + '",' + (iTry + 1) + ');', 250);
              }
            }
        }
        
        function onmouseoutLvl1(strCssPost)
        {
        	if ((iLastLvl1Hover > -1) && (iLastLvl1Hover != iLastLvl1))
            {
                document.getElementById('lvl1_' + iLastLvl1Hover).setAttribute('class', 'lvl1normal ' + strCssPost);
            }
      	}
      	
				function onmouseclickLvl1(iMenuIndex, strCssPost)
        {
            document.getElementById('lvl1_' + iMenuIndex).setAttribute('class', 'lvl1active ' + strCssPost);
            iLastActive = iMenuIndex;
            iLastLvl1 = iMenuIndex;
            iLastActiveLvl = 1;
        }

        function onmouseoverLvl2(iMenuIndex)
        {
          if ((iLastLvl2Hover > -1) && (iLastLvl2Hover != iLastLvl2))
            {
		            document.getElementById('lvl2_' + iLastLvl2Hover).setAttribute('class', 'lvl2normal');
            }

            var objLvl2Hover = document.getElementById('lvl2_' + iMenuIndex);
            if (typeof (objLvl2Hover) != 'undefined')
            {
                objLvl2Hover.setAttribute('class', 'lvl2active');
                iLastLvl2Hover = iMenuIndex;
            }
        }

        function onmouseoutLvl2(iMenuIndex)
        {
          	if ((iLastLvl2Hover > -1) && (iLastLvl2Hover != iLastLvl2))
          	{
		            document.getElementById('lvl2_' + iLastLvl2Hover).setAttribute('class', 'lvl2normal');
          	}
        }
        
        function onmouseclickLvl2(iMenuIndex)
        {
            /*if (iParent > -1)
            {
                eval('lvl1_' + iParent).className = 'lvl1active ' + strCssPost;
            }*/

            document.getElementById('lvl2_' + iMenuIndex).setAttribute('class', 'lvl2active');

            iLastLvl2 = iMenuIndex;
            iLastActive = iParent;
        }


    function writeMenu(strMenuName)
    {

        var iMenuNameIndex = -1;

            // Index von Menü suchen
        for (i=0; i< LCSiteMenus.length; i++)
        {
            var menuName = LCSiteMenus[i][3];
            if (menuName == strMenuName)
            {
                iMenuNameIndex = i;
                break;
            }
        }

        if (iMenuNameIndex > -1)
        {

            strLvl1 = '<table id="lvl1Container"><tr>';
            strLvl2 = '';
            bLvl2TagOpen = false;
            iParentLvl1 = -1;

            // letztes Lvl1 Item suchen für Trenngrafik
            var iLvl1End = -1;
            for (var i = iMenuNameIndex + 1; i < LCSiteMenus.length; i++)
            {
                if (LCSiteMenus[i][0] == 1)
                {
                    iLvl1End = i;
                }
                if (LCSiteMenus[i][0] == 0)
                {
                    break;
                }
            }

            for (var i = iMenuNameIndex + 1; i < LCSiteMenus.length; i++)
            {
                if (LCSiteMenus[i][0] == 0)
                {
                    break;
                }

                strHref = 'http://www.officecms.com/members/igyzacek/' + LCSiteMenus[i][2] + '&MID=' + LCSiteMenus[i][1];
                strCssPost = 'normal';
                strActionBannerNr = LCLib_GetStringBetweenTags(LCSiteMenus[i][4], '_mibanner_', '_mibanner2_');

                /*if ((iMenuItemIndex + 1) == (i - menuNameIndex))
                {
                    strCssPost = 'active';
                }*/

                if (LCSiteMenus[i][0] == 1)
                {
                    var bSubMenu = false;
                    if (i < (LCSiteMenus.length-1))
                    {
                        if (LCSiteMenus[i+1][0] == 2)
                        {
                            bSubMenu = true;
                        }
                    }


                    strLvl1 += '<td><div id="lvl1_' + i + '" class="lvl1' + strCssPost + '" onmouseover="onmouseoverLvl1(' + i + ',' + bSubMenu + ', &quot;' + strActionBannerNr + '&quot;, true)" onmouseout="onmouseoutLvl1(' + i + ')" onclick="onmouseclickLvl1(' + i + ',' + bSubMenu + ')">';
                    strLvl1 += '<a href="' + strHref + '" target="_top">' + LCSiteMenus[i][3] + '</a></div>';

                    // Trenngrafik einfügen
                    if (iLvl1End != i)
                    {
                        strLvl1 += '<div><img src="http://www.officecms.com/members/igyzacek/images/div_menu.gif" border="0"></div>';
                    }

                    strLvl1 += '</td>';

                    if (bLvl2TagOpen == true)
                    {
                        strLvl2 += '</tr></table></div>';
                        bLvl2TagOpen = false;
                    }
                    if (bLvl2TagOpen == false)
                    {
                        strLvl2 += '<div id="lvl2Container_' + i + '" class="lvl2Container"><table><tr>';
                        bLvl2TagOpen = true;
                    }

                    iParentLvl1 = i;

                }

                // ***** LVL2 ******
                if (LCSiteMenus[i][0] == 2)
                {
                    strLvl2 += '<td><div id="lvl2_' + i + '" class="lvl2' + strCssPost + '" onmouseover="onmouseoverLvl2(' + i + ', &quot;' + strActionBannerNr + '&quot;, true)" onmouseout="onmouseoutLvl2(' + i + ')" onclick="onmouseclickLvl2(' + i + ', ' + iParentLvl1 + ')">';
                    strLvl2 += '<a href="' + strHref + '" target="_top">' + LCSiteMenus[i][3] + '</a></div></td>';

                    // Prüfen ob nächstes Element Lvl1, dann kein Trennzeichen mehr
                    if (i < (LCSiteMenus.length-1))
                    {
                        if (LCSiteMenus[i+1][0] == 2)
                        {
                            strLvl2 += '<td><img src="http://www.officecms.com/members/igyzacek/images/div_submenu.gif" border="0"></td>';
                        }
                    }

                }

            }

            strLvl1 += '</tr></table>';
            if (bLvl2TagOpen == true)
            {
                strLvl2 += '</tr></table></div>';
            }

            document.write(strLvl1 + strLvl2);
        }
    }


    function writeStartMenu(strMenuName)
    {

        var iMenuNameIndex = -1;

        // Index von Menü suchen
        for (i=0; i< LCSiteMenus.length; i++)
        {
            var menuName = LCSiteMenus[i][3];
            if (menuName == strMenuName)
            {
                iMenuNameIndex = i;
                break;
            }
        }

        if (iMenuNameIndex > -1)
        {

            strLvl1 = '<table id="lvl1Container"><tr>';
            strLvl2 = '';
            bLvl2TagOpen = false;
            iLastLvl1Div = -1;
            iParentLvl1 = -1;

            // letztes Lvl1 Item suchen für Trenngrafik
            var iLvl1End = -1;
            for (var i = iMenuNameIndex + 1; i < LCSiteMenus.length; i++)
            {
                if (LCSiteMenus[i][0] == 1)
                {
                    iLvl1End = i;
                }
                if (LCSiteMenus[i][0] == 0)
                {
                    break;
                }
            }

            for (var i = iMenuNameIndex + 1; i < LCSiteMenus.length; i++)
            {
                if (LCSiteMenus[i][0] == 0)
                {
                    break;
                }

                strHref = 'http://www.officecms.com/members/igyzacek/' + LCSiteMenus[i][2] + '&MID=' + LCSiteMenus[i][1];
                strCssPost = 'normal';
                strActionBannerNr = LCLib_GetStringBetweenTags(LCSiteMenus[i][4], '_mibanner_', '_mibanner2_');

                /*if ((iMenuItemIndex + 1) == (i - menuNameIndex))
                {
                    strCssPost = 'active';
                }*/

                if (LCSiteMenus[i][0] == 1)
                {
                    var bSubMenu = false;
                    if (i < (LCSiteMenus.length-1))
                    {
                        if (LCSiteMenus[i+1][0] == 2)
                        {
                            bSubMenu = true;
                        }
                    }


                    strLvl1 += '<td><div id="lvl1_' + i + '" class="lvl1' + strCssPost + '" onmouseover="onmouseoverLvl1(' + i + ',' + bSubMenu + ', &quot;' + strActionBannerNr + '&quot;, false)" onmouseout="onmouseoutLvl1(' + i + ')" onclick="onmouseclickLvl1(' + i + ',' + bSubMenu + ')">';
                    strLvl1 += '<a href="' + strHref + '" target="_top">' + LCSiteMenus[i][3] + '</a></div>';

                    // Trenngrafik einfügen
                    if (iLvl1End != i)
                    {
                        strLvl1 += '<div><img src="http://www.officecms.com/members/igyzacek/images/div_menu.gif" border="0"></div>';
                    }

                    strLvl1 += '</td>';
                    if (bLvl2TagOpen == true)
                    {
                        strLvl2 += '</div>';
/*                        var objLvl1Div = eval('lvl1_' + iLastLvl1Div);
                        objLvl1Div.innerHTML += strLvl2;
    */                    bLvl2TagOpen = false;
                    }
                    iLastLvl1Div = i;
                    if (bLvl2TagOpen == false)
                    {
                        strLvl2 = '<div id="lvl2Container_' + i + '" class="lvl2ContainerStart">';
                        bLvl2TagOpen = true;
                    }

                    iParentLvl1 = i;

                }

                // ***** LVL2 ******
                if (LCSiteMenus[i][0] == 2)
                {

                    strLvl2 += '<div id="lvl2_' + i + '" class="lvl2' + strCssPost + '" onmouseover="onmouseoverLvl2(' + i + ', &quot;' + strActionBannerNr + '&quot;, false)" onmouseout="onmouseoutLvl2(' + i + ')" onclick="onmouseclickLvl2(' + i + ', ' + iParentLvl1 + ')">';
                    strLvl2 += '<a href="' + strHref + '" target="_top">' + LCSiteMenus[i][3] + '</a></div>';

                    // Prüfen ob nächstes Element Lvl1, dann kein Trennzeichen mehr
                /*    if (i < (LCSiteMenus.length-1))
                    {
                        if (LCSiteMenus[i+1][0] == 2)
                        {
                            strLvl2 += '<td><img src="http://www.officecms.com/members/igyzacek/images/div_submenu.gif" border="0"></td>';
                        }
                    }*/

                }

            }

            if (bLvl2TagOpen == true)
            {
                strLvl2 += '</div>';
/*                var objLvl1Div = eval('lvl1_' + iLastLvl1Div);
                objLvl1Div.innerHTML += strLvl2;
    */            bLvl2TagOpen = false;
            }
            strLvl1 += '</tr></table>';

            document.write(strLvl1);
        }
    }
