function externalLinkWithBreadcrumb(strUrl, strBreadcrumb, strInfoHtm)
{
    window.open(strUrl, 'bodyFrame');
    setPagePath(strBreadcrumb);
    if (strInfoHtm && strInfoHtm != '')
    {
        window.open(strInfoHtm, 'actionIFrame');
    }
}

function setMenu(iIndex, iTry)
{
    if(typeof(iTry) == 'undefined')
    {
        iTry = 1;
    }

    try
    {
        top.menuFrame.objMenu.selectItem(iIndex);
    }
    catch(E)
    {
        if(iTry < 10)
        {
            window.setTimeout('setMenu(' + iIndex + ', ' + (iTry + 1) + ');', 250);
        }
    }
}
/*function setNewsBg(iTry)
{
    if(typeof(iTry) == 'undefined')
    {
        iTry = 1;
    }

    try
    {
        top.actionFrame.document.body.style.backgroundImage= 'url("../../images/d_actionFrame.gif")';
    }
    catch(E)
    {
        if(iTry < 10)
        {
            window.setTimeout('setNewsBg(' + (iTry + 1) + ');', 250);
        }
    }
}*/


function setPagePath(strPagePath, iTry)
{
    if(typeof(iTry) == 'undefined')
    {
        iTry = 1;
    }

    try
    {
        top.bannerFrame.document.getElementById('actiontext').innerHTML = strPagePath;
    }
    catch(E)
    {
        if(iTry < 10)
        {
            window.setTimeout('setPagePath("' + strPagePath + '", ' + (iTry + 1) + ');', 250);
        }
    }
}

function setInfoHtm(strUrl, iTry)
{
    if(typeof(iTry) == 'undefined')
    {
        iTry = 1;
    }

    try
    {
        window.open(strUrl, 'actionIFrame');
    }
    catch(E)
    {
        if(iTry < 10)
        {
            window.setTimeout('setInfoHtm("' + strUrl + '", ' + (iTry + 1) + ');', 250);
        }
    }
}

var bCurrentIsStartPage = true;
var strCurInfoHtm = '';

function onLcContentPageLoaded_completeHandler(strActionImageUrl, strActionBannerNumber, strActionHeadlineText, strActionLongtextUrl, iMenuItemIndex, strMenuName, iMenuItemLevel, strInfoHtm)
{
    if(strInfoHtm != strCurInfoHtm)
    {
        strCurInfoHtm = strInfoHtm;

        if(strInfoHtm.length > 0)
        {
            strInfoHtm = 'http://www.naturalenergies.at/' + strInfoHtm;
        }
        else
        {
            strInfoHtm = 'http://www.naturalenergies.at/InfoBlank.htm';
        }

        setInfoHtm(strInfoHtm);
    }

    if(strMenuName == 'Menü Deutsch' || strMenuName == 'Menü Englisch' || strMenuName == 'Startseite Deutsch' || strMenuName == 'Startseite Englisch')
    {
        if(strMenuName == 'Menü Deutsch' || strMenuName == 'Menü Englisch')
        {
            setMenu(iMenuItemIndex);
        }
        else
        {
            setMenu(-1);
        }

        var strPagePath = '';

        for(var i = 0; i < LCSiteMenus.length; i++)
        {
            if(LCSiteMenus[i][0] == 0 && LCSiteMenus[i][3] == strMenuName)
            {
                var iCurLevelOfInterest = iMenuItemLevel;
                for(var j = i + 1 + iMenuItemIndex; j > i; j--)
                {
                    if(LCSiteMenus[j][0] == iCurLevelOfInterest)
                    {
                        if(strPagePath.length > 0)
                        {
                            strPagePath = ' - ' + strPagePath;
                        }

                        var strHref = LCSiteMenus[j][2];
                        if(strHref.substr(0, 8) == '_lccms_/')
                        {
                            if(strHref.indexOf('?') > -1)
                            {
                                strHref += '&';
                            }
                            else
                            {
                                strHref += '?';
                            }

                            strHref += 'MID=' + LCSiteMenus[j][1];
                        }

                        strPagePath = '<a href="' + strHref + '" target="bodyFrame">' + LCSiteMenus[j][3]  + '</a>' + strPagePath;

                        iCurLevelOfInterest--;

                        if(iCurLevelOfInterest == 0)
                        {
                            break;
                        }
                    }
                }

                break;
            }
        }

        setPagePath(strPagePath);
        setNewsBg();
    }

    setNewsBg();


/*
    var bIsStartPage = ((strMenuName == 'Startseite Deutsch' || strMenuName == 'Startseite Englisch') && iMenuItemIndex == 0);

    if(bIsStartPage != bCurrentIsStartPage)
    {
        bCurrentIsStartPage = bIsStartPage;

        if(bIsStartPage)
        {
            top.document.body.rows = '578,*';
        }
        else
        {
            top.document.body.rows = '*,0';
        }
    }

    if(bIsStartPage)
    {
        try
        {
            top.contentFrame.bodyFrame.document.body.style.padding = '0px';
            top.contentFrame.bodyFrame.document.body.style.margin = '0px';
        }
        catch(E)
        {
        }
    }*/
}

