// JavaScript Document

$(document).ready(function(){

	$('#castingbox a').lightBox();
	$('.bloody a').lightBox();
	$('.snap a').lightBox();
	$('.spy a').lightBox();
	$('.phenomen a').lightBox();

/*$(window).bind("resize", resizeWindow);

function resizeWindow( e ) {

	var arrPageScrolls = ___getPageScroll();
	var arrPageSizess = ___getPageSize();

}*/
	
	$(".avmouse").css({display: "block", opacity: 0, "background-image": "none", "background-color": "#000"});

	$(".avhref").hover(function() {	
		$(this).find(".avmouse").fadeTo(200, 0.5);
									  
									},
	function() {	
		$(this).find(".avmouse").stop().fadeTo(500, 0);		  
									  
	});


	
		$('#navigace a')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0 -88px)"}, {duration:0})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:500})
		})

$('#galeriepixy a').lightBox();

    // initialize scrollable 
    $("div.scrollable").scrollable({ 
    size: 1});
	
	
	//2nd level menu efekt
	$('#navigace ul').find("ul").css({display: "block"});
	$('#navigace ul').find("ul").hide();
	
	$("#navigace li").hover(function() {
		
		$(this).find("ul").slideDown(0);
		
									},
	function() {		  
		$(this).find("ul").slideUp(150);							  
	});
	/*$("#navigace li").hover(function() {	
											  
									},
	function() {
		
		  
									  
	});*/
	
	
	
	
	
	
	//vudea
	
   	 $('#vids div div').animate({opacity: 0.5}, 0);
	 $('#vids div object').hide();
	 
 	jQuery.fn.zavriOkenko = function() {										  
									$(this).stop().animate({width: 480, marginLeft: 0, height: 150}, 500);
									$(this).find('object').hide();
									overlayer = $(this).find('div');
									overlayer.show();
									overlayer.animate({opacity: 0.0}, 0)
									overlayer.animate({opacity: 0.0}, 500)
									overlayer.animate({opacity: 0.5}, 500)
									$('#rightbox').find('div').each(function() {
		$(this).css('zIndex', 1);
	});
									return false;
									
										 };
	 
	 
	 $('#vids div div').mouseover(function(){
											
					$(this).stop().animate({opacity: 1}, 300);
   
     }).mouseout(function(){  
   
         $(this).stop().animate({opacity: 0.5}, 300);  
   
    });
	 			 
									 
     $('#vids div div').click(function(){
		$('#rightbox').find('div').each(function() {
		$(this).css('zIndex', -1);
	});
   		$(this).hide();
		$(this).parent().find('object').show();
	});	
	 //video specify
	 $('.hraj').click(function(){
		     $(this).parent().stop().animate({width: 722, marginLeft: -120, height: 576}, 500);	 
	 });
	 $('.hrajpromo').click(function(){
		     $(this).parent().stop().animate({width: 722, marginLeft: -120, height: 406}, 500);	 
	 });
	 $('.mtv_video').click(function(){
		     $(this).parent().stop().animate({width: 640, marginLeft: -79, height: 340}, 500);	 
	 });
	 $('.thriller_video').click(function(){
		     $(this).parent().stop().animate({width: 480, marginLeft: 0, height: 320}, 500);	 
	 });
	 $('.historynd_video').click(function(){
		     $(this).parent().stop().animate({width: 720, marginLeft: -120, height: 406}, 500);	 
	 });
	 
	 
	 
	 //prilepenisipky
	 $("#navigace li").find('ul').each(function() {
      var first = $('<span></span>').addClass('sipkadwn');
      $(this).parent().append(first);
   });

	//galerie
	$('.fotoenter').animate({opacity: 0.5}, 0);
	$('.fotoenter').mouseover(function(){
											
		 $(this).stop().animate({opacity: 1}, 300);
   
     }).mouseout(function(){  
   
         $(this).stop().animate({opacity: 0.5}, 300);  
   
    });


});
