$(document).ready(
	
	
	function(){
		$(".ltbx").lightBox({
		overlayBgColor: '#222',
		overlayOpacity: 0.8,
		imageLoading: '/public/images/lightbox-ico-loading.gif',
		imageBtnClose:'/public/images/lightbox-btn-close.gif',
		imageBtnPrev: '/public/images/lightbox-btn-prev.gif',
		imageBtnNext: '/public/images/lightbox-btn-next.gif',
		containerResizeSpeed: 500,
		txtImage: 'Obraz',
		txtOf: 'z'
   });
		
		
		
		$('#menu li').not('#menu li ul li').hover(
		
		function(){
				
				if($('#menu li.pr_active ul').height()){
					$('#menu li.pr_active').children('.subBGLayer,ul').hide();
				}
				if(($(this).index()) == $('#menu li:last').index())
					$(this).addClass('last_active');
				else
					$(this).addClass('active');
				var height=$(this).children('ul').height();
				var posY = $(this).position().top+9;
				$(this).children('.subBGLayer,ul').show();
				if(height)
					$(this).children('.subBGLayer').height(height);
					$(this).children('.subBGLayer,ul').css('top',posY+'px');
		}
		,function(){
			
			$(this).removeClass('active');
			$(this).removeClass('last_active');
			$(this).children('.subBGLayer,ul').hide();
			if($('#menu li.pr_active ul').height()){
					$('#menu li.pr_active').children('.subBGLayer,ul').show();
				}
		});
		
		//ma pobrac ten wiersz ktory jets aktywny i wyswietlic jesli istniej jego submenu
		if($('#menu li.pr_active ul').height()){
			
			var height=$('#menu li.pr_active').children('ul').height();
				var posY = $('#menu li.pr_active').position().top+9;
				$('#menu li.pr_active').children('.subBGLayer,ul').show();
				$('#menu li.pr_active').children('.subBGLayer').height(height);
				$('#menu li.pr_active').children('.subBGLayer,ul').css('top',posY+'px');
		}	
	}
)


