/**
 * Global Javascripts
 *
 * $Id$
 *
 * @author Florian Fackler
 * @package global
 */

var rndNr               =    new Date().getTime(),
    flashParams         =    {    quality         :    "high",
                                  menu            :    "false",
                                  wmode           :    "transparent",
                                  bgcolor         :    "#000000",
                                  allowFullScreen :    "true"
                             },

    BANNER_MREC         =    00000000000;
 
if ($.browser.msie && $.browser.version<7)
{   var einsImSinn      =   '',
        hoverIMG        =   {   Start       :   'images_layout/nav_startA.png',
                                Charaktere  :   'images_layout/nav_charakterA.png',
                                Bilder      :   'images_layout/nav_bilderA.png',
                                Episoden    :   'images_layout/nav_episodenA.png',
                                Videos      :   'images_layout/nav_videoA.png',
                                Songtexte   :   'images_layout/nav_songtexteA.png',
                                Specials    :   'images_layout/nav_spezialA.png'
                            },

        // Wir merken uns das derzeitige Hintergrundbild
        storeBG         =   function()
                            {   einsImSinn = $(this).css('filter');
                                var id = $(this).attr('id').replace(/nav\-serie-/,'');
                                $(this).css('filter','progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src="'+hoverIMG[id]+'"');
                            },

        restoreBG       =   function()
                            {   if  ( einsImSinn )
                                {    $(this).css('filter',einsImSinn);
                                }
                            };
    $(function()
    {   $('a[id^=nav-serie]').hover(storeBG,restoreBG);
    });
}

$(function()
{   // Flash Top-Navigation (flashvars, params, attributes)
    swfobject.embedSWF("swf/bubblemenu.swf", "topflashnavi", "790", "157", "9.0.0", "swf/expressinstall.swf", {homeLink:"index.htm"}, flashParams);

    // Flash-TV auf der linken Navigationsseite
    swfobject.embedSWF("swf/jetzt_im_tv.swf", "pokitoTV", "158", "202", "9.0.0", "swf/expressinstall.swf", {}, flashParams);

    // Merkzettel auf der linken Navigatinsonseite
    swfobject.embedSWF("swf/merkzettel.swf","nav-merkzettel", "143", "134", "9.0.0","swf/expressinstall.swf", {}, flashParams);

    // Popups
    $('a[target=_blank][href][lang]').click(function()
    {   var wh =[800,600],
            hr = $(this).attr('href') || '';
        if (! hr)
        {    return false;
        }
        if ( $(this).attr('lang').match(/^\d+x\d+/) )
        {   wh = $(this).attr('lang').split('x');
        }
        var pokipop = window.open(hr,'pokioPopup'+wh.join(''),'resizable=yes,width='+wh[0]+',height='+wh[1]);
        pokipop.focus();
        return false;
    });
});

//$.getScript('http://www.mypokito.de/packdenkoffer/gewinnspiel.js');

// Teaser Anordnung etc. (externes File)
$.getScript('http://www.mypokito.de/js/navigation_teaser.js');