var lc_strHeadline = '';

function onLcContentPageLoaded_headlineChangeHandler(strHeadline)
{
    lc_strHeadline = strHeadline;
    onLcContentPageLoaded_realHeadlineChangeHandler();
}

function onLcContentPageLoaded_realHeadlineChangeHandler()
{
    var strHeadline = lc_strHeadline;

    try
    {
        if(top.aktiontext){top.aktiontext.document.getElementById('actiontext').innerHTML=strHeadline; } else { top.contentFrame.aktiontext.document.getElementById('actiontext').innerHTML=strHeadline; }
    }
    catch(ex)
    {
        window.setTimeout('onLcContentPageLoaded_realHeadlineChangeHandler()', 100);
        return;
    }
}



function demoTry(iIndex, iTry)
{
    if(typeof(iTry) == 'undefined')
    {
        iTry = 1;
    }

    try
    {
        top.header.Menu_OnPageLoadHandler(iIndex);

    }
    catch(E)
    {
        if(iTry < 10)
        {
            window.setTimeout('demoTry(' + iIndex + ', ' + (iTry + 1) + ')', 250);
        }
    }
}

var iCurIndex1 = -1;
var iCurIndex2 = -1;

function setMenu2(iIndex)
{
	try
	{
		top.subMenu.Menu_OnPageLoadHandler(iCurIndex2);
	}
	catch(E)
	{
		window.setTimeout('setMenu2(' + iIndex + ');', 250);
	}
}

function onLcContentPageLoaded_completeHandler(strActionImageUrl, strActionBannerNumber, strActionHeadlineText, strActionLongtextUrl, iMenuItemIndex, strMenuName, iMenuItemLevel)
{
  var bIsStartPage = false;
  if(top.location.href.indexOf('/startPage.htm') > -1)
  {
      bIsStartPage = true;
  }

  if(bIsStartPage)
  {
      try
      {
          top.contentFrame.bodyFrame.document.body.style.backgroundImage = 'url(http://www.edv-ferdinandeum.at/images/bgBodyStart.gif)';
      }
      catch(E)
      {
      }
  }

  if(strMenuName == 'Menü Deutsch')
  {
      if(iMenuItemIndex == 0)
      {
          if(!bIsStartPage)
          {
              window.open('http://www.edv-ferdinandeum.at/startPage.htm', '_top');
          }

          return;
      }
  }

  if(bIsStartPage)
  {
      window.open('http://www.edv-ferdinandeum.at/index.htm?SHOW_URL=' + top.contentFrame.bodyFrame.location.href, '_top');
  }
   
  
	var iIndex1 = -1;
	var iIndex2 = -1;
	
	if(strMenuName == 'Menü Deutsch')
	{
		for(var i = 0; i < LCSiteMenus.length; i++)
		{
			if(LCSiteMenus[i][0] == 0 && LCSiteMenus[i][3] == strMenuName)
			{
				var bCountIndex2 = true;
				
				for(var j = i + 1 + iMenuItemIndex; j > i; j--)
				{
					if(LCSiteMenus[j][0] == 1)
					{
						bCountIndex2 = false;
						iIndex1++;
					}
					else if(bCountIndex2)
					{
						iIndex2++;
					}
				}
				
				break;
			}
		}
	}
	
	iCurIndex2 = iIndex2;
	if(!bIsStartPage)
  {
		if(iIndex1 != iCurIndex1)
		{
			iCurIndex1 = iIndex1;
			
			top.header.lcGraphTabHandleClick(iCurIndex1 + 1, false);
			window.open('http://www.edv-ferdinandeum.at/subMenu_ger.htm', 'subMenu');
		}
		else
		{
			setMenu2(iCurIndex2);
			
		}
	}
}


