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();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 2,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
});


function mycarousel2_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();
								});
							};

							jQuery(document).ready(function() {
								jQuery('#mycarousel2').jcarousel({
									auto: 2,
									wrap: 'last',
									initCallback: mycarousel_initCallback
								});
							});
							
function mycarousel3_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();
								});
							};

							jQuery(document).ready(function() {
								jQuery('#mycarousel3').jcarousel({
									auto: 2,
									wrap: 'last',
									initCallback: mycarousel_initCallback
								});
							});
							
							
							

/*******************************************************************/

/*
$(document).ready(function() {
	    maxWidth = 786;
	    minWidth = 233;	
	    
	 	$(function() 
	 	{
	 	    try
	 	    {
					$(".carousel").jCarouselLite({btnNext: ".next",btnPrev: ".prev",visible: 3});
				}
				catch(err){}
				
		});
	    
		$("#mainMenu div ul li a.openMenu").bind("mouseenter", function(){	
			$("div.sottomenu").hide();	
			$(this).parent().parent().parent().animate({width: maxWidth+"px"}, { queue:false, duration:200});			
			$(this).parent().find("div.sottomenu").show();									
		});
		 $("#mainMenu div ul li.primolivello").bind("mouseleave", function(){	
			$(this).parent().parent().animate({width: minWidth+"px"}, { queue:false, duration:200});		
		}); 	
		
		  $(function() {
		   	$('#hpGallery').cycle({ //slideshow
		    	fx:     'fade',
		        speed:  'slow',
			    timeout: 5000,
				pager: "#nav", 	
			    pause: true	,
				pagerAnchorBuilder: function(idx, slide) { 
					return '#nav a:eq(' + idx + ')'; 
					}			         
		       	});					
			 $('#pausa').click(function() {  //pausa slideshow
		     $('#hpGallery').cycle('pause'); 
		    	});	
		    });
		});	
*/
