


function scroll(direction, nb){
    //variable
    var position = parseInt($("#slide").css('left'));
    var longueur = -(parseInt(nb)+1)*parseInt($("#slide").css('width'));
    var stop = position - 480;
    direction = parseInt(direction);
    //alert("position = "+position+" / direction = "+direction+" / longueur = "+longueur+" / nombre = "+nb+" / stop = "+stop);
    if((position >= 0 && direction == -1) || (stop <= longueur && direction == 1)){
        //on fait rien
    } else{
        var slide = position - (482 * direction);
        $('#slide').animate({left :slide+"px"}, 500, 'linear');
    } 
}

/* fonction pour les liens*/
$(function(){
    $(".menu_defaut").each(function() { 
        var href = $(this).find('a').attr('href'); 
        var target = $(this).find('a').attr('target'); 
        $(this).find('a').click(function(){
            if(target == "_blank") window.open(href); else document.location = href;
            return false; 
        });
        $(this).click(function() {
            if(target == "_blank") window.open(href); else document.location = href;
        });            
    });
});

