var actu_is_moving = false;
var position_actuelle=0;

function changeonglet(i, nb, id) {
	
    var o = document.getElementById("onglet" + i);
    for (a = 1; a <= nb; a++) {
        if (a != i) {
            document.getElementById("onglet" + a).className = "";
        } else {
            o.className = "selected";
        }
    }
	
}

function showOngletPr(i, nb, id) {
    if (!actu_is_moving) {	
        for (y = 1; y <= nb; y++) {
            if (i == y) {
                actu_is_moving = true;
				//alert(($("contenuInner").getStyle('left')));
                //var position_actuelle = parseInt(document.getElementById("contenuInner").getStyle('left'));
                var position_voulue = - ((i - 1) * 854);
                var deplacement = position_voulue - position_actuelle;
                new Effect.Move("contenuInner", {x:deplacement, y:0, mode:"relative"});
				position_actuelle=position_voulue;
                setTimeout(function (e) {actu_is_moving = false;}, 1000);
            }
        }
        changeonglet(i, nb, id);
    }
}