$(document).ready(function(){
	jQuery('#mycarousel1, #mycarousel2').jcarousel({
        wrap:"circular",
		scroll:1,
		visible:5
    });
	
	$('ul#mycarousel1, ul#mycarousel2').children("li").hover(function() {
		$(this).siblings().stop().fadeTo(400,0.5);
	}, function() {
		$(this).siblings().stop().fadeTo(500,1);
	});

}); 


// DIAPORAMA EN-TETE ////////////////////////
function slideSwitch() {
    var $active = $('#diapo li.active');
    if ( $active.length == 0 ) $active = $('#diapo li:last');
var $sibs  = $active.siblings();
var rndNum = Math.floor(Math.random() * $sibs.length );
var $next  = $( $sibs[ rndNum ] );
 // var $next =  $active.next().length ? $active.next() : $('#diapo li:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 3000, function() {
            $active.removeClass('active last-active');
        });
	}
	$(function() {
		setInterval( "slideSwitch()", 5000 );
	});
