	$(document).ready(function(){
		$("#sezioni ul li a").hover(
			function () {
				$(this).stop().animate({
					opacity: 0
				});
			},
			function () {
				$(this).stop().animate({
					opacity: 1
				});
			}
		)
		$('#slidewrapper').after('<ul id="nav">').cycle({ 
			fx:     'fade', 
			timeout: 5000, 
			pause: 1,
			next:   '#next2', 
			prev:   '#prev2',
			pager:  '#nav',
			pagerAnchorBuilder: function(idx, slide) { 
				return '<li><a href="' + slide.src + '" rel="prettyPhoto[gallery]"><img src="' + slide.src + '" width="50" height="50" /></a></li>'; 
			} 
		});
		$('ul#nav li img').hover(
			function () {
				$(this).stop().animate({
					opacity: 0.5
				},100);
			},
			function () {
				$(this).stop().animate({
					opacity: 1
				},100);
			}
		)
		$('#slide_wrapper').cycle({
        fx:       'fade',
		speed: 1000,
        timeout:   5000,
		next:   '#next3', 
		prev:   '#prev3',
        after:     onAfter
		})
		function onAfter(curr,next,opts) {
			var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount;
			$('#caption').html(caption);
		}
		$("a[rel^='prettyPhoto'],.gallery a").prettyPhoto({theme: 'facebook'})
		
	});
