var lc_iMenuItemIndex;
var lc_strMenuName;

var bFirstCall = true;

function onLcContentPageLoaded_realMenuItemIndexHandler()
{
    try
    {
        if(top.menuFrame.bHvMenuIsLoaded)
        {
            if(lc_strMenuName == 'Menü Deutsch' || lc_strMenuName == 'Menü Englisch')
            {
                if(bFirstCall)
                {
                    window.setTimeout('top.menuFrame.Menu_OnPageLoadHandler(lc_iMenuItemIndex);', 500);
                }
                else
                {
                    top.menuFrame.Menu_OnPageLoadHandler(lc_iMenuItemIndex);
                }
            }
            else
            {
                if(bFirstCall)
                {
                    window.setTimeout('top.menuFrame.Menu_OnPageLoadHandler(-1);', 500);
                }
                else
                {
                    top.menuFrame.Menu_OnPageLoadHandler(-1);
                }
            }

            bFirstCall = false;
        }
        else
        {
            window.setTimeout('onLcContentPageLoaded_realMenuItemIndexHandler();', 250);
        }
    }
    catch(e)
    {
        window.setTimeout('onLcContentPageLoaded_realMenuItemIndexHandler();', 250);
    }
}

function onLcContentPageLoaded_menuItemIndexHandler(iMenuItemIndex, strMenuName)
{
    lc_iMenuItemIndex = iMenuItemIndex;
    lc_strMenuName = strMenuName;

    onLcContentPageLoaded_realMenuItemIndexHandler();
}

var lc_strBannerID = '';
var strCurrentBannerID = '';

function onLcContentPageLoaded_realBannerChangeHandler()
{
    try
    {
        if(strCurrentBannerID != lc_strBannerID)
        {
            if(lc_strBannerID.length > 0)
            {
                top.contentFrame.actionBannerFrame.location.replace('http://www.mothwurf.com/_lccms_/banners/' + lc_strBannerID + '/bannerinclude.htm');
            }
            else
            {
                top.contentFrame.actionBannerFrame.location.replace('http://www.mothwurf.com/actionBannerFrame.htm');
            }


            strCurrentBannerID = lc_strBannerID;
        }
    }
    catch(ex)
    {
        window.setTimeout('onLcContentPageLoaded_realBannerChangeHandler()', 100);
    }
}

function onLcContentPageLoaded_bannerChangeHandler(strBannerID)
{
    lc_strBannerID = strBannerID;
    onLcContentPageLoaded_realBannerChangeHandler();
}

