$(document).ready(
	
	
	function(){
		$(".lb").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'
   		});
	
		
	
	   /*var so1 = new SWFObject("/public/flash/pakiety_marena_lang.swf", "mymovie", "225", "120", "8", "#fff");
	   so1.addParam("quality", "high");
	   so1.addParam("wmode", "transparent");
	   so1.addParam("salign", "t");
	   so1.write("dPakiety");
	*/
		$('#logoLink').click(function(){
			location.href='http://marenaspa.pl/pl/start'; 
		});
	
	if($('#searchPhrase').val()=='')
		$('#searchPhrase').val('szukaj');
	
	$('#searchPhrase').focus(
		function(){
			$(this).val('');
		}
	);
	$('#searchPhrase').blur(
		function(){
			var searchString = $(this).val();
			if(searchString.length==0)
				$(this).val('szukaj');
		}
	);
	
	
	
	var height = $('.d1').height();
	
	$('.d1 img').each(
		function(){
			
			var height = $(this).parent('.d1').height();
			
			var imgHeight = $(this).height();
			
			if(height > imgHeight && imgHeight > 0){
			
			var mTop = (height-imgHeight ) / 2;	
			
			//alert(height+' '+imgHeight+' '+mTop);
			
			$(this).css('margin-top', Math.floor(mTop) );
			}
		}
	);
	
	$('#ulPobytowe li').mouseover(
	
		function(){
			
			$('.d2 a, .d2 p',this ).each(function(){
				$(this).addClass('redOver');
			})
		}
	
	);
	
	$('#ulPobytowe li').mouseout(
	
		function(){
		
			$('.d2 a, .d2 p',this).each(function(){
				$(this).removeClass('redOver');
			})
		
		}
	
	);
	
	$('.bannerContener').click(
		function(){
			
			location.href=$('.bannerTitle',this).children('a').eq(0).attr('href');
		}
	);
	$('#bottomStartBoxes > div').click(
		function(){
			
			location.href=$('.bannerTitle',this).children('a').eq(0).attr('href');
		}
	);
	

	
		if($('#popup-box-trigger').length > 0){
			$('#popup-box-trigger').fancybox({
				'scrolling'		: 'no',
				'onStart'		: function(){
					
					if($('#popup-box > table').length){
						var table_width = parseInt($('#popup-box > table').css('width') );
						$('#popup-box').width( table_width);
						
					
					}
					
				},
				'onClosed'		: function(){
	
				},
				'autoScale'		:	'false',
				'transitionIn'	:	'elastic',
				'transitionOut'	:	'elastic',
				'speedIn'		:	600, 
				'speedOut'		:	200, 
				'overlayShow'	:	true,
				'overlayColor'  : 	'#000',
				'overlayOpacity':	'0.6'
			});
			
			
	}
			$('#popup-box-trigger').trigger('click');
}
)


