        iLastLvl1 = -1;
        iLastLvl2 = -1;
        iLastSubMenu = -1;
        iLastLvl1Hover = -1;
        iLastLvl2Hover = -1;
        iLastActive = -1;
        strDefaultBanner = '01';

        function setDefaultBanner(strNumber)
        {
            strDefaultBanner = strNumber;
            if (strNumber == '')
            {
                strDefaultBanner = '01';
            }
        }

        function setBanner(strNumber, iTry)
        {
            if(typeof(iTry) == 'undefined')
            {
                iTry = 1;
            }
            try
            {
                var strBannerNumber = strDefaultBanner;
                if(strNumber.length > 0)
                {
                    strBannerNumber = strNumber;
                }


                top.getMovieName().callChangeSlider('http://www.michaelzacek.at/_lccms_/banners/' + strBannerNumber + '/flashbanner.xml', 'http://www.michaelzacek.at/_lccms_/banners/' + strBannerNumber + '/flashsettings.xml', 'http://www.michaelzacek.at/sliderconfig01.xml');
            }
            catch(E)
            {
                if(iTry < 3)
                {
                    window.setTimeout('setBanner("' + strNumber + '", ' + (iTry + 1) + ');', 250);
                }
            }
        }

        // Workaround 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 onmouseoutMenuDiv()
        {
            // aktives Submenu wieder anzeigen wenn vorhanden
            if (iLastActive > -1)
            {

                // letztes Submenu verschwinden lassen
                if ((iLastSubMenu > -1))
                {
                    var objLastSub = document.getElementById('lvl2Container_' + iLastSubMenu);
                    if (typeof (objLastSub) != 'undefined')
                    {
                      objLastSub.style.display = 'none';
                    }
                }

                var objLvl2Container = document.getElementById('lvl2Container_' + iLastActive);
                if (typeof (objLvl2Container) != 'undefined')
                {
                    objLvl2Container.style.display = 'block';
                }

            }
        }


        function onmouseclickLvl1(iMenuIndex, bSubMenu)
        {

            // letztes Submenu verschwinden lassen
    /*        if ((iLastSubMenu > -1) && (iLastSubMenu != iMenuIndex))
            {
                var objLastSub = eval('lvl2Container_' + iLastSubMenu);
                if (typeof (objLastSub) != 'undefined')
                {
                  objLastSub.style.display = 'none';
                }
            }*/

            // unterpunkte anzeigen wenn vorhanden
            if (bSubMenu == true)
            {
                var objLvl2Container = document.getElementById('lvl2Container_' + iMenuIndex);

                if (typeof (objLvl2Container) != 'undefined')
                {
                    objLvl2Container.style.display = 'block';
                }

                iLastSubMenu = iMenuIndex;
            }

        /*    if ((iLastLvl1 > -1) && (iLastLvl1 != iMenuIndex))
            {
                eval('lvl1_' + iLastLvl1).className = 'lvl1normal';
            }
            iLastLvl1 = iMenuIndex;            //alert(iLastLvl1 + '..' + iMenuIndex);

            if (iLastLvl2Hover > -1)
            {
                eval('lvl2_' + iLastLvl2Hover).className = 'lvl2normal';
            }
            if (iLastLvl2 > -1)
            {
                eval('lvl2_' + iLastLvl2).className = 'lvl2normal';
            }*/

            document.getElementById('lvl1_' + iMenuIndex).setAttribute('class', 'lvl1active');

            iLastLvl2Hover = -1;
            iLastLvl2 = -1;

            iLastActive = iMenuIndex;
            iLastLvl1 = iMenuIndex;
            iLastActiveLvl = 1;

        }

        function onmouseoverLvl1(iMenuIndex, bSubMenu, strBannerNr, bSetBanner, 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');
                iLastLvl1Hover = iMenuIndex;
            }

            // letztes Submenu und verschwinden lassen
            if ((iLastSubMenu > -1) && (iLastSubMenu != iMenuIndex))
            {
                var objLastSub = document.getElementById('lvl2Container_' + iLastSubMenu);
                if (typeof (objLastSub) != 'undefined')
                {
                  objLastSub.style.display = 'none';
                }
            }
            // aktives Submenu verschwinden lassen
            if ((iLastActive > -1) && (iLastActive != iMenuIndex))
            {
                var objLastSub = document.getElementById('lvl2Container_' + iLastActive);
                if (typeof (objLastSub) != 'undefined')
                {
                  objLastSub.style.display = 'none';
                }
            }

            // unterpunkte anzeigen wenn vorhanden
            if (bSubMenu == true)
            {
                var objLvl2Container = document.getElementById('lvl2Container_' + iMenuIndex);

                if (typeof (objLvl2Container) != 'undefined')
                {
                    objLvl2Container.style.display = 'block';
                }

                iLastSubMenu = iMenuIndex;
            }

            if (bSetBanner)
            {
                setBanner(strBannerNr);
            }


					}
					catch(E)
					{
						if(iTry < 10)
						{
							window.setTimeout('onmouseoverLvl1(' + iMenuIndex + ', "' + bSubMenu + '", "' +  strBannerNr + '", "' + bSetBanner + '", ' + (iTry + 1) + ');', 250);
						}
					}

        }

        function onmouseoutLvl1(iMenuIndex)
        {

          if ((iLastLvl1Hover > -1) && (iLastLvl1Hover != iLastLvl1))
            {
                document.getElementById('lvl1_' + iLastLvl1Hover).setAttribute('class', 'lvl1normal');
            }
      	}

        function onmouseclickLvl2(iMenuIndex, iParent)
        {
    /*        if ((iLastActive > -1) && (iLastActive != iParent))
            {
                eval('lvl1_' + iLastActive).className = 'lvl1normal';
            }
        */
            if (iParent > -1)
            {
                document.getElementById('lvl1_' + iParent).setAttribute('class', 'lvl1active');
            }


/*            if ((iLastLvl2 > -1) && (iLastLvl2 != iMenuIndex))
            {
                eval('lvl2_' + iLastLvl2).className = 'lvl2normal';
            }*/

            document.getElementById('lvl2_' + iMenuIndex).setAttribute('class', 'lvl2active');


            iLastLvl2 = iMenuIndex;
            iLastActive = iParent;
        }

        function onmouseoverLvl2(iMenuIndex, strBannerNr, bSetBanner)
        {
          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;
            }

            if (bSetBanner)
            {
                setBanner(strBannerNr);
            }
        }

        function onmouseoutLvl2(iMenuIndex)
        {

          if ((iLastLvl2Hover > -1) && (iLastLvl2Hover != iLastLvl2))
            {
                document.getElementById('lvl2_' + iLastLvl2Hover).setAttribute('class', 'lvl2normal');
            }

        }

    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.michaelzacek.at/' + 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.michaelzacek.at/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.michaelzacek.at/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.michaelzacek.at/' + 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.michaelzacek.at/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.michaelzacek.at/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);
        }
    }

