/*
 * ROBOT 04
 * slide jcarousel - homepage 
 */
 
 	/* SCROLL NEWS */
	function mycarousel_initCallback(carousel) {
	    // Disable autoscrolling if the user clicks the prev or next button.
	    carousel.buttonNext.bind('click', function() {
	        carousel.startAuto(0);
	    });
	
	    carousel.buttonPrev.bind('click', function() {
	        carousel.startAuto(0);
	    });
	
	    // Pause autoscrolling if the user moves with the cursor over the clip.
	    carousel.clip.hover(function() {
	        carousel.stopAuto();
	    }, function() {
	        carousel.startAuto();
	    });
	};
	
	/** SCOLL ARTISTI
	 * We use the initCallback callback
	 * to assign functionality to the controls
	 */
	function mycarousel_initCallback_artisti(carousel) {
		/*/ Disable autoscrolling if the user clicks the prev or next button.
	    carousel.buttonNext.bind('click', function() {
	        carousel.startAuto(0);
	    });
	
	    carousel.buttonPrev.bind('click', function() {
	        carousel.startAuto(0);
	    });
	    
	
	    // Pause autoscrolling if the user moves with the cursor over the clip.
	    carousel.clip.hover(function() {
	        carousel.stopAuto();
	    }, function() {
	        carousel.startAuto();
	    });

		
	    jQuery('.jcarousel-control a').bind('click', function() {
	        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
	        return false;
	    });
	
	    jQuery('#mycarousel-next').bind('click', function() {
	        carousel.next();
	        return false;
	    });
	
	    jQuery('#mycarousel-prev').bind('click', function() {
	        carousel.prev();
	        return false;
	    });
	    */
	};
	
	// Ride the carousel...
	jQuery(document).ready(function() {
		jQuery('#newslist').jcarousel({
	        auto: 4,
	        scroll: 2,
	        wrap: 'last',
	        initCallback: mycarousel_initCallback
	    });
	    jQuery("#artistlist").jcarousel({
	    	auto: 5,
	        scroll: 1,
	        size:3,
	        wrap: 'circular',
	        initCallback: mycarousel_initCallback_artisti,
	        // This tells jCarousel NOT to autobuild prev/next buttons
	        buttonNextHTML: null,
	        buttonPrevHTML: null
	    });
/*	    jQuery("#listanomi").jcarousel({
	    	auto: 5,
	        scroll: 1,
	        wrap: 'circular',
	        initCallback: mycarousel_initCallback_artisti,
	    });
*/		jQuery('#screeningslist').jcarousel({
			auto: 0,
	        scroll: 2,
	        wrap: 'last',
	        initCallback: mycarousel_initCallback
	    });
	    jQuery('#workshoplist').jcarousel({
			auto: 0,
	        scroll: 3,
	        wrap: 'last',
	        initCallback: mycarousel_initCallback
	    });
	});
