/* miniaturka repertuaru: rozwijanie i lightbox */
$(function() {
	$('.gallery_repertuar a').lightBox();
	});

$(document).ready(function() {
	$('#repertuar').mouseover(function () {
	if($(this).attr('id') == "repertuar")
	$(this).animate({height:190},250);
	});

	$('#repertuar').mouseout(function () {
	if($(this).attr('id') == "repertuar")
	$(this).animate({height:133},250);
	});
		});


/* menu2js */
$(document).ready(function() {
		function ukryj(){
		$('#menu2js > .menu_non_ul > ul').hide();
		}
						   
						   
	$('#header').mouseover(function () {
	ukryj();
	});
	
	$('#a').mouseover(function () {
		ukryj();
	});
			
	$('#b').mouseover(function () {
		ukryj();
	});
	
	$('#e').mouseover(function () {
		ukryj();
	});
	
	
	$('.m').mouseover(function () {		
		ukryj();
		idtegoelementu = $(this).attr('id');
		$('.'+idtegoelementu).show();
	});
	
	$('#menu2js > .menu_non_ul > ul').hide(); 
	
	path = window.location.pathname.split( 'g/' ); 
	u = path[1]; 
	
	if(path != "") 
	{
		ukryj();
		$('#'+u).addClass("otwarta");
		$('.'+u).show();
	}
	
	$('#content').mouseover(function () { 
		ukryj();
		$('.'+u).show();
	});

});


/* podwójne slide */

$(document).ready(function() {

	var C = new Array();

	i = 0;
	$('.slide').each(function() {
	$(this).attr('id', i);
	C[i]=$(this).attr('id');
	i++;
	});
	
	n=i;
	
	var animate_bloczek = function(i) { 
			
	if (C.length == 0)
	return;
	
	x = C[i];
	$('#'+x).css('z-index', 50);
	
	$('#'+x).animate({top: 0}, 2500, function() {
				 
					setTimeout(function() { 
									 $('#'+x).animate({top: +155}, 2200, function() { 
												 if(i != n - 1)
									 			 animate_bloczek(i+1);
												 
												 else
												 {
												 $('.slide').each(function() {
													$(this).css('z-index', 0);
													$(this).animate({top: -100}, 0);
												 });
												 animate_bloczek(0);
												 }
									});
								
								}, 3600)
				 	
		
	});
	
	};
	
	animate_bloczek(0);

	

});


$(document).ready(function() {

	var D = new Array();
	k = 0;
	
	$('#filmy > .menu_non_ul > .slidecont > div').each(function() {
	$(this).attr('id', k+"a");
	D[k]=$(this).attr('id');
	k++;
	
	});
	
	h=k;
	
	var animate_bloczek2 = function(k) { 
			
	if (D.length == 0)
	return;
	
	y = D[k];
	$('#'+y).css('z-index', 50);
	
	$('#'+y).animate({top: 0}, 4500, function() {
				 
					setTimeout(function() { 
									 $('#'+y).animate({top: +330}, 3000, function() { 
												 if(k != h - 1)
									 			 animate_bloczek2(k+1);
												 
												 else
												 {
												 $('#filmy > .menu_non_ul > .slidecont > div').each(function() {
													$(this).css('z-index', 0);
													$(this).animate({top: -300}, 0);
												 });
												 animate_bloczek2(0);
												 }
									});
								
								}, 4000)
	 
		
	});
	
	};
	
	animate_bloczek2(0);
	

});