            var oActiveMenu = null;
            var menuActive = true;
            var searchActive = true;
            var hideTimer = 0;
            var timeBeforeAutoHide = 2500;

            var XMLHTTP = null;

            if (window.XMLHttpRequest) {
                XMLHTTP = new XMLHttpRequest();
                XMLHTTP1 = new XMLHttpRequest();
            } else if (window.ActiveXObject) {
                try {
                    XMLHTTP = new ActiveXObject("Msxml2.XMLHTTP");
                } catch (ex) {
                    try {
                        XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch (ex) {
                    }
                }
            }

            function app_setLangIdResult()
            {
                if (4 == XMLHTTP.readyState) location.reload();
            }

            function app_setLangId(langId)
            {
                XMLHTTP.open('POST', '/setLangId.php');
                XMLHTTP.onreadystatechange = app_setLangIdResult;
                XMLHTTP.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

                param = 'langId=' + encodeURIComponent(langId);

                XMLHTTP.send(param);
            }

            function app_searchOn() {
                document.getElementById('lyrSearch').style.visibility = 'visible';
                document.getElementById('lyrSearchGo').style.visibility = 'visible';
            }

            function app_mouseOutMenu()
            {
                menuActive = false;
                app_menuTimerAutoHide();
            }

            function app_menuTimerAutoHide()
            {
                if (menuActive)
                {
                    hideTimer = 0;
                    return;
                }

                if (hideTimer < timeBeforeAutoHide)
                {
                    hideTimer += 100;
                    setTimeout('app_menuTimerAutoHide()', 99);
                } else {
                    hideTimer = 0;
                    oActiveMenu.style.visibility = 'hidden';
                }
            }

            function app_setMenuBehavier(NewMenId)
            {
                oNewMen = document.getElementById(NewMenId);

                if (null != oActiveMenu) oActiveMenu.style.visibility = 'hidden';
                oActiveMenu = oNewMen;
                oActiveMenu.style.visibility = 'visible';
                menuActive = true;
            }

            function app_searchMouseOut()
            {
                searchActive = false;
                app_searchTimerAutoHide();
            }

            function app_searchTimerAutoHide()
            {
                if ("" == document.getElementById('lyrSearch').value) {
                    if (searchActive)
                    {
                        hideTimer = 0;
                        return;
                    }

                    if (hideTimer < timeBeforeAutoHide)
                    {
                        hideTimer += 100;
                        setTimeout('app_searchTimerAutoHide()', 99);
                    } else {
                        hideTimer = 0;
                        document.getElementById('lyrSearch').style.visibility = 'hidden';
                    }
                }
            }

            function app_searchBehavier()
            {
                document.getElementById('lyrSearch').style.visibility = 'visible';
                searchActive = true;
            }

            function app_setLayerTopPos(h, t)
            {
                    var tPos = t;
                    var offset = h + t;
                    var lyrButtonsHeight = $('#lyrButtons').height();
                    var lyrNewsContainerHeight = $('#lyrNewsContainer').height();

                    $('#lyrPlayer').css({top: tPos});
                    $('#lyrButtons').css({top: offset + 8});

                    if (null != lyrNewsContainerHeight)
                    {
                            $('#lyrNewsContainer').css({top: offset + lyrButtonsHeight + 16});
                    } else lyrNewsContainerHeight = 0;

                    if (0 == lyrNewsContainerHeight) var offset2 = 12;
                    else var offset2 = 24;

                    $('#lyrSponsor').css({top: offset + lyrButtonsHeight + lyrNewsContainerHeight + offset2});
            }

            function trim(s) {
                // Erst f�hrende, dann Abschlie�ende Whitespaces entfernen
                // und das Ergebnis dieser Operationen zur�ckliefern

                return s.replace (/^\s+/, '').replace (/\s+$/, '');
            }

            function app_setLayer(direction)
            {
                if ('down' == direction)
                {
                    $(document).ready(function() {
                        $('#lyrNav2').css({ visibility : 'visible'});

                        h = $('#lyrPlayer').height();
                        app_setLayerTopPos(h, 312);
                    });

                } else {
                    if ("" == trim(document.getElementById('lyrAllLinks').innerHTML))
                    {
                        $(document).ready(function() {
                            $('#lyrNav2').css({ visibility : 'hidden'});

                            h = $('#lyrPlayer').height();
                            app_setLayerTopPos(h, 284);
                        });
                    }
                }
            }

            function app_setLogin()
            {
                // Hier wird nur das hin- und herschalten zwischen Login und Logout beschrieben.
                // Welche sonstigen Funktionen mit einem Logout verbunden sein m�ssen, muss dimedis festlegen und ggf. hier einf�gen

                a = document.getElementById('Login');

                if ('Login' == a.innerHTML)
                {
                    app_setLayer('down');
                    document.getElementById('lyrLoginData').style.visibility = 'visible';
                    //a.innerHTML = 'Logout';
                } else {
                    document.getElementById('lyrLoginData').style.visibility = 'hidden';
                    document.getElementById('lyrLoginName').style.visibility = 'hidden';
                    //a.innerHTML = 'Login';

                    app_setLayer('up');
                }
            }

            function app_showOverlay(LayerId)
            {
                $(LayerId).css({height: $('#lyrPlayer').height()});
                $(LayerId).fadeIn('slow');
            }

            function app_hideOverlay(LayerId)
            {
                $(LayerId).fadeOut('slow');
            }

            function app_CountdownLength()
            {
                VonDatum = new Date();
                BisDatum = new Date(2010, 8, 15, 0, 0, 0);

                var daysCounter = Math.ceil((BisDatum.getTime() - VonDatum.getTime()) / 86400 / 1000);
                var leftPosCounter = Math.round(293 + (199 - daysCounter) * 2.2914);
                var widthCounter = 749 - leftPosCounter;

                $('#lyrCountdownLine').css({left: leftPosCounter, width: widthCounter});
                $('#lyrCountdownDays').text(daysCounter);
            }

            function app_showOverlayNightTalkText(LayerId)
            {
                    var lyrName = '#' + LayerId.id;
                    var leftPos = $(lyrName).position().left;
                    var lyrText = LayerId.getAttribute('text');
                    var lyrLink = LayerId.getAttribute('link');

                    $('#lyrCountdownNightTalkTextLink').text(lyrText);
                    $('#lyrCountdownNightTalkTextLink').attr('href', lyrLink);
                    $('#lyrCountdownNightTalkText').css({left: leftPos + 4});
                    $('#lyrCountdownNightTalkText').fadeIn('slow');
            }

            function app_hideOverlayNightTalkText()
            {
                    //$('#lyrCountdownNightTalkText').fadeOut('slow');
            }


