
$(document).ready(function(){
  //Fancybox
  /* This is basic - uses default settings */	
	$("a.lightbox").lightBox({
         fixedNavigation:true,
         imageLoading: '/repository/js/lightbox/images/lightbox-ico-loading2.gif'
       });
	//$("a.fancybox").lightBox()();


//Prehazuje obrazek u souboru na pravo
    $("a[href$='.pdf']").css({ 
      'background-position' : 'right top',
      'padding' : '0px 23px 4px 0px'
    });

    $("p a.external").addClass("popup");

    $(".reference a").removeClass("popup");
    $(".reference a").removeClass("external");
    $(".reference a img").removeClass("popup");

    $('.lightbox').lightBox({
       fixedNavigation:true,
       imageLoading: 'http://www.shop360.cz/js/lightbox-jquery/images/lightbox-ico-loading2.gif',
       imageBtnClose: 'http://www.shop360.cz/js/lightbox-jquery/images/lightbox-btn-close.gif',
       imageBtnPrev: 'http://www.shop360.cz/js/lightbox-jquery/images/lightbox-btn-prev.gif',
       imageBtnNext: 'http://www.shop360.cz/js/lightbox-jquery/images/lightbox-btn-next.gif',
       overlayBgColor: '#000000',
       overlayOpacity: 0.8
    });




	$("div.video a").append("<span></span>"); // overlays the image with png play image

   if((pos = window.location.href.search(/\#lightbox-/)) >= 0)
		{
 			anchor = window.location.href.substring(pos + 10);
			setTimeout(function() {
				$("div.video a[rel=#"+anchor+"]:first").click();
			}, 20);
			//alert(anchor);
		} else {
//			alert('jupi neni tam');
		}

});


$(function() {

    /**
     *  kontrola noveho flashe
     *  pokud je verze flashe vetsi nez 9.115 prehraje se soubor mp4
     */
    if(flashembed.isSupported([9, 115])){
        $('a.player').each(function(i,el){
            var $a = $(el);
            $a.attr('href', $a.attr('href').replace('.flv', '.mp4'));
        });
    }

	// setup overlay actions to buttons
	$("a[rel]").overlay({

		// use the Apple effect for overlay
		effect: 'apple',

		expose: '#789',
		
		mask: {
			color: '#000000',
			loadSpeed: 200,
			opacity: 0.8
		},

		onLoad: function(content) {
			// find the player contained inside this overlay and load it
			this.getOverlay().find("a.player").flowplayer(0).load();
		},

		onClose: function(content) {
			$f().unload();
		}
	});

	// install flowplayers
 	$("a.player").flowplayer("http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf");

});




