// JavaScript Document

$(document).ready(function () {
    Page_Init();
});


function Page_Init() {
    $("a[rel^='prettyPhoto']").prettyPhoto({ theme: 'facebook', opacity: 0.2 });

    Cufon_Init();
    $('.Menu_Link').hover(function () { $(this).addClass('Hover'); Cufon_Init(); }, function () { $(this).removeClass('Hover'); Cufon_Init(); });
    $('.Liste_01').find('.Liste_01_Title').hover(function () { $(this).addClass('Hover'); Cufon_Init(); }, function () { $(this).removeClass('Hover'); Cufon_Init(); });

    Window_Init();

    Liste_Init();
}

function Cufon_Init() {
    Cufon.replace('.AvantGarde ', { fontFamily: 'AvantGarde' });
}

function Window_Init() {
    $(window).load(function () {
        //Agrandie la page si le contenu est plus petit que l'écran
        if (parseInt($('body').outerHeight()) < parseInt(document.documentElement.clientHeight)) {
            /* var Hauteur = parseInt(document.documentElement.clientHeight) - parseInt($('body').outerHeight());
            $('#Hauteur').height(Hauteur + 'px');*/
        }
    });
}

function Liste_Init() {
    $('.Liste_01').find('.Liste_01_Content').hide();

    $('.Liste_01').find('.Liste_01_Title').toggle(
        function () {

            $('.Liste_01_Title').each(function (index) {
                if ($(this).hasClass('Actif') == true) {
                    $(this).click();
                }
            });

            $(this).addClass('Actif');
            Cufon_Init();
            $(this).next('.Liste_01_Content').delay(400).slideDown(400, 'linear');

        },
        function () {
            $(this).next('.Liste_01_Content').slideUp(400, 'linear');
            $(this).removeClass('Actif');
            Cufon_Init();
        }
    );

    $('.Liste_01').find('.Liste_01_Title').first().click();
}

