$(document).ready(
	function()
	{
		$('div#sidebar-galeria').serialScroll(
			{target:'#sidebargaleria-main', items:'div.sidebargaleria-wpis', prev:'img.prev', next:'img.next', axis:'xy', force:'true', interval: 0, lazy:'true'}
		);
		
		$('div#nauczyciele').serialScroll(
			{target:'#nauczyciele-main', items:'div.nauczyciele-wpis', prev:'img.prev', next:'img.next', axis:'xy', force:'true', interval: 60000, lazy:'true'}
		);
		
		$('div#uczniowie-o-nas').serialScroll(
			{target:'#uczniowie-main', items:'div.uczniowie-wpis', prev:'img.prev1', next:'img.next1', axis:'xy', force:'true', interval: 60000, lazy:'true'}
		);
		
		$('div#ciekawostki').serialScroll(
			{target:'#ciekawostki-main', items:'div.ciekawostki-wpis', prev:'img.prev2', next:'img.next2', axis:'xy', force:'true', interval: 60000, lazy:'true'}
		);
		
		$('#infooter-polec form').hide();
		$('#infooter-polec img').click(
			function()
			{
			$(this).hide();
			$('#infooter-polec form').fadeIn('slow');
			}
		);
		
		$('ul#faq').accordion();
	}
);


$(document).ready(function() {

$("img.rounded").load( function () {
	var img = $(this);
	
	// build imgwrapper
	var imgwrapper = $('<div class="rounded_wrapper"></div>');
	imgwrapper.width(img.width());
	imgwrapper.height(img.height());
	
	// move CSS properties from img to imgwrapper
	imgwrapper.css('float', img.css('float'));
	img.css('float', 'none')
	
	imgwrapper.css('margin-right', img.css('margin-right'));
	img.css('margin-right', '0')

	imgwrapper.css('margin-left', img.css('margin-left'));
	img.css('margin-left', '0')

	imgwrapper.css('margin-bottom', img.css('margin-bottom'));
	img.css('margin-bottom', '0')

	imgwrapper.css('margin-top', img.css('margin-top'));
	img.css('margin-top', '0')

	imgwrapper.css('display', 'block');
	img.css('display', 'block')

	// wrap image
	img.wrap(imgwrapper);
	
	// add rounded corners
	img.after('<div class="tl"></div>');
	img.after('<div class="tr"></div>');
	img.after('<div class="bl"></div>');
	img.after('<div class="br"></div>');
});

	
});
