var nombre_pixel = 2;
var delai = 20;
var taille_cadre = 406;

function MoveRight()
{
	taille_frise = recupTaille();
	taille_max = eval(taille_frise - taille_cadre);
	//alert(taille_max);
	posLeft = document.getElementById('bloc_img_petite_frise2').offsetLeft;
	//alert(posLeft);
	if(posLeft < "0")
	{
		NewPos = posLeft + nombre_pixel + "px";
		//alert(NewPos);
		document.getElementById('bloc_img_petite_frise2').style.left = NewPos;
	}
	rightTime = setTimeout('MoveRight();', delai);
}

function EndMoveRight()
{
	clearTimeout(rightTime);
}

function MoveLeft()
{
	taille_frise = recupTaille();
	//alert(taille_frise);
	taille_max = taille_frise - taille_cadre;
	taille_max = eval("-" + "taille_max");
	//alert(taille_max);

	posLeft = document.getElementById('bloc_img_petite_frise2').offsetLeft;
	//alert(posLeft);
	if(posLeft > taille_max)
	{
		NewPos = posLeft - nombre_pixel + "px";
		//alert(NewPos);
		document.getElementById('bloc_img_petite_frise2').style.left = NewPos;
	}
	leftTime = setTimeout('MoveLeft();', delai);
}

function EndMoveLeft()
{
	clearTimeout(leftTime);
}

function recupTaille()
{
	nb = '8';

	var taille_width = 0;
	for(i = 1; i <= nb; i++)
	{
		taille_width = taille_width + 60;
		if(i != nb) taille_width = taille_width + 9;
	}
	
	return taille_width;

}