$(document).ready(function(){

    // Slideshow de la page d'accueil et de l'institut
    $('#diaporama').cycle({
        fx : 'fade',
        speed:    2000,
        timeout:  2000
    });



/*  COULEUR INITIALE  DU H2 */
var colorInitial = $('#colonne a span:first').attr("rel");
$('#colonne a span:first').css("background-color", colorInitial);
$('#colonne a span:first').css("color", "white");
 $("#colonne h2").css("background-color", colorInitial);

/* SLIDES */
$("#slide").css('overflow','hidden');
$('#content #main #sections').serialScroll({
        //target:'',
        items:'li.produit', // Selector to the items ( relative to the matched elements, '#sections' in this case )
        //prev:'img.prev',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
        //next:'img.next',// Selector to the 'next' button (absolute too)
        axis:'xy',// The default is 'y' scroll on both ways
        navigation:'#content #colonne li a',
        cycle:  true,
        duration:300 // Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
});

/* CHANGEMENT DE COULEUR DU H2 */


$('#colonne a span').css("display","block");  /* important! */
$('#colonne a span').click( function() {
     var colorPage = $(this).attr("rel");
     $("#colonne h2").css("background-color", colorPage);
     $('#colonne a span').css("background-color","white");
     $('#colonne a span').css("color","#7F7F7F");
     $(this).css("background-color", colorPage);
     $(this).css("color", "white");
 } );



});

