jQuery(document).ready(function($){
    
    //Bloc de droite Full Height
    //Polices exotiques
    Cufon.replace('.din');
    Cufon.replace('#paneMenu');
    
    $(".carousel").jCarouselLite({
        btnNext: "#next",
        btnPrev: "#prev",
        visible: 1,
        scroll: 1,
        mouseWheel: false,
        speed: 200,
        circular: true,
        auto: 4000

    });
    
    //Touche Entrez pour les formulaires 
    $('form input').keypress(function(e) {
        if(e.which == 13){
            $(this).blur();
            var form=$(this).parents('form:first');
            form.submit();
            return false;
        }
        return true;
    });
    //Touche pour les sous-menu
    $('.listeFormations li').has('ul').children('a').click(function(){
        var it=this;
        $('.listeFormations li ul').slideUp('fast',function(){
            $(it).parents('li:first').children('ul').slideDown('slow');
        });
        return false;
    });
    $('.listeFormations .activeMenu:not(.lvl0)').parents('.lvl0').children('ul').css('display','block');
    $('.row').each(function(){
        var minWidth = 600;
        if ($(this).width()<minWidth) $(this).width(minWidth);
    });
    //RESIZE LA FENETRE
    $('#Wrapper').resize(function() {
        resz();
    });
    $(document).resize(function() {
        resz();
    });
    $(window).resize(function() {
        resz();
    });
    resz();
});
jQuery(window).load(function($){
    resz();
});
function resz(){
    // Incrémentation de sa valeur
    var wHeight=$(window).height();
    var o='#LeftColumn .bloc:last-child';
    var f='#Footer';
    $(o).css('margin-bottom','0px');
    var minHeight=0;
    var oBot=$(o).position().top+$(o).height();
    var fBot=$(f).position().top+$(f).height();
    if(oBot>=fBot){
        minHeight=oBot;
    }else{
        minHeight=fBot;
    }
    if(minHeight<wHeight){
        minHeight=wHeight;
    }
    var diff=0;
    if(oBot<minHeight){
        diff=minHeight-oBot;
        $(o).css('padding-bottom',diff);
    }
    if(fBot<minHeight){
        diff=minHeight-fBot;
        $(f).css('margin-top',diff);
    }
    return true;
}


