function setMenu(iIndex, iTry)
{
    if(typeof(iTry) == 'undefined')
    {
        iTry = 1;
    }

    try
    {
        top.menu.objMenu.selectItem(iIndex);
    }
    catch(E)
    {
        if(iTry < 10)
        {
            window.setTimeout('setMenu(' + iIndex + ', ' + (iTry + 1) + ');', 250);
        }
    }
}
var strCurActionBanner = '';
function setActionBanner(strBannerNumber)
{
    try
    {

        if(top.header.actionBannerFrame)
        {
            if(strBannerNumber.length > 0)
            {
                window.open('http://www.gasthof-schwaiger.at/_lccms_/banners/' + strBannerNumber + '/bannerinclude.htm', 'actionBannerFrame');
            }
            else
            {
                window.open('http://www.gasthof-schwaiger.at/actionBannerDefault.htm', 'actionBannerFrame');
            }
        }
        else
        {
            window.setTimeout('setActionBanner("' + strBannerNumber + '");', 250);
        }
    }
    catch(E)
    {
        window.setTimeout('setActionBanner("' + strBannerNumber + '");', 250);
    }
}


function onLcContentPageLoaded_completeHandler(strActionImageUrl, strActionBannerNumber, strActionHeadlineText, strActionLongtextUrl, iMenuItemIndex, strMenuName, iMenuItemLevel)
{
    var iIndex = -1;
    if(strMenuName == 'Menü Deutsch' || strMenuName == 'Menü Englisch')
    {
        iIndex = iMenuItemIndex;
    }
    setMenu(iIndex);

    if(strMenuName == 'Menü Deutsch' || strMenuName == 'Menü Englisch' || strMenuName == 'Menü 2 Deutsch' || strMenuName == 'Menü 2 Englisch' || strMenuName == 'Nicht eingeordnete Elemente')
    {
        if(strActionBannerNumber != strCurActionBanner)
        {
            strCurActionBanner = strActionBannerNumber;
            setActionBanner(strActionBannerNumber);
            //alert(strActionBannerNumber);
        }
    }

    var bShowWeather = ((strMenuName == 'Menü Deutsch' || strMenuName == 'Menü Englisch') && iMenuItemIndex == 0);
    if(bShowWeather)
    {
        top.header.document.getElementById('weather').style.visibility = 'visible';
    }
    else
    {
        top.header.document.getElementById('weather').style.visibility = 'hidden';
    }
}

