

var lc_strBannerID = '';
var strCurrentBannerID = '';

function onLcContentPageLoaded_realBannerChangeHandler()
{
    try
    {
        if(strCurrentBannerID != lc_strBannerID)
        {

            if(lc_strBannerID.length > 0)
            {
                top.contentFrame.actionbannerallFrame.document.getElementById('actionbannerdiv').innerHTML='<IFRAME NAME="actionbannerFrame" MARGINWIDTH="0" MARGINHEIGHT="0" SRC="http://www.heron.co.at/_lccms_/banners/' + lc_strBannerID + '/bannerinclude.htm" WIDTH="73" HEIGHT="1500" SCROLLING="No" NORESIZE FRAMEBORDER="0" HSPACE="0" VSPACE="0" ALIGN="left"></IFRAME>';
            }
            else
            {
                top.contentFrame.actionbannerallFrame.document.getElementById('actionbannerdiv').innerHTML='<IFRAME NAME="actionbannerFrame" MARGINWIDTH="0" MARGINHEIGHT="0" SRC="http://www.heron.co.at/actionbannerFrame.htm" WIDTH="73" HEIGHT="1500" SCROLLING="No" NORESIZE FRAMEBORDER="0" HSPACE="0" VSPACE="0" ALIGN="left"></IFRAME>';
            }


            strCurrentBannerID = lc_strBannerID;
        }
   }
   catch(E)
    {
        window.setTimeout('onLcContentPageLoaded_realBannerChangeHandler()', 200);
        return;
  }
}

function onLcContentPageLoaded_bannerChangeHandler(strBannerID)
{
    lc_strBannerID = strBannerID;
    onLcContentPageLoaded_realBannerChangeHandler();

}

function deselectAllMenuItems()
{
    top.menuFrame.lcGraphTabHandleClick(-1, false);
}

function setActiveItem1(iIndex)
{
    try
    {
        top.menuFrame.lcGraphTabHandleClick(iIndex, false);
    }
    catch(E)
    {
        window.setTimeout('setActiveItem1(' + iIndex + ');', 250);
    }
}

function setActiveItem2(iIndex)
{
    try
    {
        top.menutwoFrame.Menu_OnPageLoadHandler(iIndex);
    }
    catch(E)
    {
        window.setTimeout('setActiveItem2(' + iIndex + ');', 250);
    }
}

function onLcContentPageLoaded_completeHandler(strActionImageUrl, strActionBannerNumber, strActionHeadlineText, strActionLongtextUrl, iMenuItemIndex, strMenuName, iMenuItemLevel,strAltText)
{
    if(strMenuName != 'Menü Deutsch')
    {
        deselectAllMenuItems();
        return;
    }

    var iFirstLevelItem = -1;
    var iSecondLevelItem = -1;

    if(strMenuName == 'Menü Deutsch' || strMenuName == 'Menü Englisch')
    {
        for(var i = 0; i < LCSiteMenus.length; i++)
        {
            if(LCSiteMenus[i][0] == 0 && LCSiteMenus[i][3] == strMenuName)
            {
                var j = i + iMenuItemIndex + 1;

                iFirstLevelItem = -1;
                var iTmp = j;

                for(; j >= 0; j--)
                {
                    if(LCSiteMenus[j][0] == 0)
                    {
                        break;
                    }

                    if(iMenuItemLevel > 1 && iSecondLevelItem == -1)
                    {
                        if(LCSiteMenus[j][0] == 1)
                        {
                            iSecondLevelItem = iTmp - j - 1;
                        }
                    }

                    if(LCSiteMenus[j][0] == 1)
                    {
                        iFirstLevelItem++;
                    }
                }

                break;
            }
        }
    }

    top.iFirstLevelItem = iFirstLevelItem;
    top.iSecondLevelItem = iSecondLevelItem;

    if(top.menuFrame.selectedMenu == iFirstLevelItem + 1)
    {
        setActiveItem2(iSecondLevelItem);
    }

    setActiveItem1(iFirstLevelItem + 1);
}

