this.preview = function() {
    if(document.body.id == "preview"){
        $("body").each(function(){
            h = $(window).height();
            w = $(window).width();
        });
    }
};

this.init = function() {
    preview();
};

$(document).ready(function(){	
    init();

    // Arrondis sous IE
    if ($.browser.msie) {
        $('#nav > ul > li').each(function(){
            PIE.attach(this);
        });
    }

    // Petit hack permettant d'unifinier menu et sous menu
    $('#nav li').has('ul').hover(function(){
        $(this).prepend(
            $('<span />')
            .addClass('hideline')
            .css({
                'width': $(this).outerWidth() - 2,
                'top':$(this).scrollTop() + $(this).height() + 10,
                'left' : $(this).scrollLeft()
            })
            );
    }, function(){
        $('.hideline').remove();
    });

    // Tous les séminaires en images
    function mycarousel_initCallback(carousel) {
        $('#image-seminaire-conteneur .scroll .prev').bind('click', function() {
            carousel.prev();
            return false;
        });

        $('#image-seminaire-conteneur .scroll .next').bind('click', function() {
            carousel.next();
            return false;
        });
    }
    
    $("#jCarouselTSI li a").each(function(){
        $(this).mouseover(function() {
            $(".unroll", this).css("display", "none");
            $(".roll", this).css("display", "");
        });
        
        $(this).mouseout(function() {
            $(".unroll", this).css("display", "");
            $(".roll", this).css("display", "none");
        })
    })
        
    $("#jCarouselTSI").jcarousel({
        vertical: true,
        scroll:2,
        wrap:"circular",
        initCallback: mycarousel_initCallback
    });
});



