var timer;
var totWidth = imgWidth*nbImages;
var imgWidthOffset = Math.round(imgWidth/10);

function scroll() {
    var scrollingLeft = parseInt($("#scrolling").css("left"));
    var scrollingOffset = scrollingLeft % totWidth;
    if (-totWidth < scrollingLeft) $("#scrolling").css("left", (scrollingLeft-1)+"px");
    else $("#scrolling").css({ left: scrollingOffset+"px" });
    timer = setTimeout("scroll()", 50);
}

$(document).ready(function(){
    $("#scrolling").append($("#scrolling").html());
    scroll();
});


function affiche_fiche(id){
    var id_affiche = document.getElementById("id_affiche").value;
    document.getElementById("fiche_"+id_affiche).style.display = "none";
    document.getElementById("fiche_"+id).style.display = "";
    document.getElementById("id_affiche").value = id;
}

function affiche_image(id){
    var id_image = document.getElementById("id_image").value;
    document.getElementById("fiche_"+id_image).style.display = "none";
    document.getElementById("fiche_"+id).style.display = "";
    document.getElementById("id_image").value = id;
}

