/**
*  Script exécuter après le chargmenet de la page
*/



$(document).ready(function(){

/**
* Défilement vertical de la partie centrale
*/
    $("a[id^=HN_]").click(function () { 
        var id = $(this).attr('id');
        var showId = "FN_" + id.substr(3);
        
        // Qui est actuellement affiché ?
        var visibleId = $("[id^=FN_]:visible").attr('id');
        if (showId != visibleId) {
            $("#"+visibleId).slideUp(400);
            $("#"+showId).slideDown(400);
            $("a[id^=HN_]").attr('class', '');
            $(this).attr('class', 'selected');
        }
        return false;
    });

/**
* Ouverture des pages dans une nouvelle fenêtre
*/

    $("a.newwindow").click(function(){
        window.open(this.href);
        return false;
    });


if ( $("div[id^=carousel]").length > 0 ) {
/**
* Hauteur fixe pour zones de défilement carousellite
*/

    $("div[id^=carousel] ul li").height(320);

/**
* Défilement zone revue de presse en bas de page
*/

    $("#carouselA").jCarouselLite({
        btnNext: "#nextA",
        btnPrev: "#prevA",
        vertical: 1,
        visible: 1
    });




/**
* Défilement zone revue de presse en bas de page
*/

    $("#carouselP").jCarouselLite({
        btnNext: "#nextP",
        btnPrev: "#prevP",
        vertical: 1,
        visible: 1
    });

/**
* Défilement zone témoignages en bas de page
*/

    $("#carouselT").jCarouselLite({
        btnNext: "#nextT",
        btnPrev: "#prevT",
        vertical: 1,
        visible: 1
    });
} // Fin traitement zones CarouselLite

    $(".fbox").fancybox();
    
/**
* Fancybox du choix des langues
**/    
  $(".lgfbox").fancybox({ 'hideOnContentClick': false }); // menu langues
  $(".bigfbox").fancybox({ frameWidth: 700, frameHeight: 500 }); // charte parrainage

/**
* Liens vidéo
*/ 
    $('a[rel=video]').fancybox({frameWidth:512,frameHeight:308,padding:0});
    $('a[rel=videopro]').fancybox({frameWidth:512,frameHeight:308,padding:0});

});

/**
* Variante défilement partie centrale
*/

/*


  $("a[id^=HN_]").click(function () { 
        var id = $(this).attr('id');
        var showId = "FN_" + id.substr(3);
        
        // Qui est actuellement affiché ?
        var visibleId = $("[id^=FN_]:visible").attr('id');
        if (showId != visibleId) {
            
            $("#"+visibleId).slideUp(600, function(){$("#"+showId).slideDown(400);});
            
        }
        return false;
    });

*/    

