$(function(){
							var ilosc_boxow=$('.box_').size();
							
							var szerokosc_diva=206;
							var szerokosc_scrollera =ilosc_boxow*szerokosc_diva;
							var przesuniecie = szerokosc_diva*4+1;
							
							$('#scroller').css('width',szerokosc_scrollera+'px');
							var poczatkowy_left=$('#scroller').css('left') ;
					
							
							$('#next').click(function(){
								var obecny_left=$('#scroller').css('left');
								if(parseFloat(obecny_left,10)>=0&&parseFloat(obecny_left,10)<szerokosc_scrollera&&szerokosc_scrollera>przesuniecie){
									var o_ile_przesunac =(parseFloat(obecny_left,10) - przesuniecie)+'px';
									$('#scroller').animate({left:o_ile_przesunac},500)
								}
								})
								$('#prev').click(function(){
									var obecny_left=$('#scroller').css('left');
									if(parseFloat(obecny_left,10)<parseFloat(poczatkowy_left)&&parseFloat(obecny_left,10)>=-szerokosc_scrollera){
										var o_ile_przesunac = parseFloat(obecny_left,10)+przesuniecie+'px';
										$('#scroller').animate({left:o_ile_przesunac},500)
								}
							});
						})

$(function(){
	

	$("#top ul li a img, #nasi_partnerzy a img, .nasza_oferta_teksty a img").hover(function(){
		if($(this).attr("src").indexOf("_hover") == -1) {
			var newSrc = $(this).attr("src").replace(".png","_hover.png#hover");
			$(this).attr("src",newSrc);
		}
	},
	function(){
		if($(this).attr("src").indexOf("_hover.png#hover") != -1) {
			var oldSrc = $(this).attr("src").replace("_hover.png#hover",".png");
			$(this).attr("src",oldSrc);
		}
	});
	
	$('#icons ul li a img').css('opacity', 0.5)
	$('#icons ul li a').hover(function(){
		$(this).children().css('opacity', 1)
	},function(){
		$(this).children().css('opacity', 0.5)
	})

	$('.gallery_box:odd').addClass('gallery_box_odd');
	$('.kalendarium_wpis:odd').addClass('kalendarium_wpis_dark');
	
	
	$('.box').hover(function(){
		$(this).children().next().stop();
		$(this).children().next().animate({'top':'215px'}, 'slow')
	},function(){
		$(this).children().next().stop();
		$(this).children().next().animate({'top':'340px'}, 'slow')
	})
			
			var flashvars = {phpPath: base_url+"flash/count_img.php"};
			var params = {
				menu: "false",
				scale: "noScale",
				bgcolor: "#000000",
				allowsciptaccess: "sameDomain",
				wmode: "transparent"
			};
			var attributes = {};
			swfobject.embedSWF(base_url+"flash/slideshow.swf", "flash", "100%", "100%", "9.0.0", false, flashvars, params,attributes);
	
			
			
	
	$('.galeria_lb').lightBox();	
	$('.lb-gal-1').lightBox();	
	$('.lb-gal-2').lightBox();	
	$('.lb-gal-3').lightBox();	
	$('.lb-gal-4').lightBox();	
	$('.lb-gal-5').lightBox();	
	$('.lb-gal-6').lightBox();	
	

	
});
