jQuery(function ($) {
	   
	var address = "http://www.kinosumperk.cz/wp-content/themes/oko";
	   
	$('#logo, #direct-reservation, .panel, #wraper').dropShadow({'color': '#000'});
//	$('.module.intro .right').corner('10px');
    $('#field-newsletter').clearLabel();
    $('.current_page_item a').click(function() {return false;})
    $('.right-now ul li:last').addClass('last');

	   $('.fancybox').fancybox({
							   'titleShow': false
							   });
	   
    $('.right-now a.popup, .upcoming a.popup').click(function() {
        var address = $(this).attr('href');
        if (address != "#") window.open(address, "Popup", "width=950, height=600, toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=yes");
        return false;
    })
    $('.reservation select').change(function(){
        $(this).parent().find('.popup').attr('href', $(this).find('option:selected').val());
    })
/*
// Dialog
				$('#abc').dialog({
					autoOpen: false,
					width: 600,
					buttons: {
						"Ok": function() {
							$(this).dialog("close");
						},
						"Cancel": function() {
							$(this).dialog("close");
						}
					}
				});

				// Dialog Link
				$('.module.right-now a').click(function(){
					//$('#abc').dialog('open');
					//return false;
				});

    //$('.module.right-now li:even, .module.upcoming li:even').css('background', 'url(\'images/layout/bg-white-yellow-upcoming.png\') top left repeat-x');

    /*
    $('.module.right-now').click(function() {
        $(this).find('#dialog').dialog('open');
        alert($(this).find('#dialog p').html());
        return false;
    })
    */

    $('.reservation a.button').hover(
        function() { $(this).addClass('ui-state-hover'); },
        function() { $(this).removeClass('ui-state-hover'); }
    );

    if ($('#slider').length > 0) {
		$('#slider').s3Slider({
		  timeOut: 4000
		});
	}

/*
$('#slider').nivoSlider({
    effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
    slices:5,
    animSpeed:500, //Slide transition speed
    pauseTime:5000,
    startSlide:0, //Set starting Slide (0 index)
    directionNav:false, //Next & Prev
    directionNavHide:true, //Only show on hover
    controlNav:false, //1,2,3...
    controlNavThumbs:false, //Use thumbnails for Control Nav
    controlNavThumbsFromRel:false, //Use image rel for thumbs
    controlNavThumbsSearch: '.jpg', //Replace this with...
    controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
    keyboardNav:false, //Use left & right arrows
    pauseOnHover:false, //Stop animation while hovering
    manualAdvance:false, //Force manual transitions
    captionOpacity:0.6, //Universal caption opacity
    beforeChange: function(){},
    afterChange: function(){},
    slideshowEnd: function(){} //Triggers after all slides have been shown
});
*/
    $('#dialog-how-to-reserve').dialog({
        height: 600,
        width: 680,
        autoOpen: false,
        zIndex: 1000
    });

    $('a.how-to-reserve-ticket').click(function() {
        $('#dialog-how-to-reserve').dialog('open');
        return false;
    })

    //$('.ui-dialog').bgiframe();

//VIDEO jw player
      $("a.trailer").click(function(){
        
	var arr = $(this).attr('rel').split(',');

	var params = {};
          params.allowfullscreen = "true";

        var attributes = {};
          attributes.align = "center";


	//swfobject.embedSWF('http://www.kinosumperk.cz/wp-content/themes/oko/modules/jwplayer/player.swf','videoPlayer',arr[2],arr[3],'9','false',{file:arr[0], plugins:"captions-2", "captions.file":arr[1],dock: false, autostart: true}, params,attributes);
    swfobject.embedSWF('http://www.kinosumperk.cz/wp-content/themes/oko/modules/jwplayer/player.swf','videoPlayer',arr[2],arr[3],"9.0.0", address + "modules/jwplayer/expressInstall.swf",{file:arr[0], plugins:"captions-2", "captions.file":arr[1],dock: false, autostart: true}, params,attributes);
  		

	 $("#videoStorage").dialog({
		open: function() {
			$('#slider .sliderImage:visible').mouseover();
		},
		height: parseInt(arr[3]) + 60,
		width: parseInt(arr[2]) + 30,
		modal: true,
		dialogClass: "dialogUi",
		close: function(event, ui) { swfobject.removeSWF("videoPlayer");
			$(this).append("<div id=\"videoPlayer\" style=\"display: none;\"></div>");
			$('#slider .sliderImage:visible').mouseout();
		}
		});
		return false;
	});
	   
//Banner
   
	   swfobject.embedSWF(address + "/images/flash/itcomp.swf", "banner-itcomp", "250", "120", "9.0.0", address + "modules/jwplayer/expressInstall.swf");
//	   swfobject.embedSWF(address + "/images/flash/ckistria.swf", "banner-ckistria", "250", "120", "9.0.0", address + "modules/jwplayer/expressInstall.swf"); 
	   swfobject.embedSWF(address + "/images/flash/vertebra.swf", "banner-vertebra", "250", "120", "9.0.0", address + "modules/jwplayer/expressInstall.swf");
	   swfobject.embedSWF(address + "/images/flash/mkcomp.swf", "banner-mkcomp", "250", "120", "9.0.0", address + "modules/jwplayer/expressInstall.swf"); 	
//	   $('#banner-itcomp').flash('images/flash/itcomp.swf');

});

