$(document).ready(function() {

	
$("#foo2").carouFredSel({
		items				: 1,		// numero di elementi da mostrare
		direction			: "left", 	// "right", "left", "up" or "down"
		circular			: true,		// continua in modo circolare nella stessa direzione (true) oppure torna indietro (false)
		infinite			: true,		// gira all'infinito (true) oppure si arresta quando ha mostrato tutti gli elementi (false)
		scroll : {
			items			: 1,
			easing			: "easeInOutQuad",
			duration		: 800,							
			pauseOnHover	: true
		},
		auto : {						
			play			: true,
			pauseDuration	: 2500,		// durata della pausa tra uno scroll e l'altro
			delay			: 700		// tempo che deve trascorrere prima di avviare il primo scroll
		},
		prev : {	
			button		: "#foo2_prev",		// indica l'elemento HTML usato per il pulsante prev - immagine posizionata tramite background css
			key			: "left",
			easing		: "easeInOutQuad",
			duration	: 800
		},
		next : { 
			button		: "#foo2_next",		// indica l'elemento HTML usato per il pulsante next - immagine posizionata tramite background css
			key			: "right",
			easing		: "easeInOutQuad",
			duration	: 800
		},
		pagination : {	
			container	: "#foo2_pag",		// lo stato normale e 'selected' sono gestiti con immagine posizionata tramite background css
			keys		: true,
			easing		: "easeInOutQuad",
			duration	: 800
		}
	});	
	
	// gestisce pulsante play
	$("#foo2_play").click(function() {
		$("#foo2").trigger("play", true).trigger("next");
		$(this).hide().next().show();
		return false;
	});
	
	// gestisce pulsante pause
	$("#foo2_pause").click(function() {
		$("#foo2").trigger("pause", true);
		$(this).hide().prev().show();
		return false;
	}).hide();

});






