// Scrolling pour le Zoom des articles de Brochure
var ZoomBrochure_width;
var ZoomBrochure_interv;
var ZoomBrochure_valInterval;
var ZoomBrochure_valScroll;
var ZoomBrochure_positionScroll;
var ZoomBrochure_speed;

function ZoomBrochure_reload() {
	ZoomBrochure_width = 400;
	ZoomBrochure_interv = null;
	ZoomBrochure_valInterval = 0;
	ZoomBrochure_valScroll = 0;
	ZoomBrochure_positionScroll = 0;
	ZoomBrochure_speed = 0;
}

function ZoomBrochure_setScroll(type)
{
	if (ZoomBrochure_interv != null || (ZoomBrochure_positionScroll <= 0 && type == 'Left') || ((ZoomBrochure_positionScroll + ZoomBrochure_width) > document.getElementById('ZoomBrochure_Scroll').scrollWidth && type == 'Right'))
		return;
	ZoomBrochure_valInterval = 20;
	ZoomBrochure_valScroll = 0;
	ZoomBrochure_speed = 40;
	ZoomBrochure_interv = setInterval('ZoomBrochure_scrollCategorie'+type+'()', 20);
}

function ZoomBrochure_scrollCategorieLeft()
{
	var tmp_speed;

	if (ZoomBrochure_interv != null && ZoomBrochure_valScroll < ZoomBrochure_width)
	{
		if ((ZoomBrochure_valScroll + (1 + ZoomBrochure_speed)) > ZoomBrochure_width)
			tmp_speed = ZoomBrochure_width - ZoomBrochure_valScroll;
		else
			tmp_speed = 1 + ZoomBrochure_speed;
		ZoomBrochure_positionScroll -= tmp_speed;
		document.getElementById('ZoomBrochure_Scroll').scrollLeft = ZoomBrochure_positionScroll;
		ZoomBrochure_valScroll += tmp_speed;
	}
	else
	{
		clearInterval(ZoomBrochure_interv);
		ZoomBrochure_interv = null;
		if (ZoomBrochure_positionScroll <= 0)
			document.getElementById('btnMoveCategorieLeft').style.visibility = 'hidden';
		document.getElementById('btnMoveCategorieRight').style.visibility = 'visible';
	}
}

function ZoomBrochure_scrollCategorieRight()
{
	var tmp_speed;

	if (ZoomBrochure_interv != null && ZoomBrochure_valScroll < ZoomBrochure_width)
	{
		if ((ZoomBrochure_valScroll + (1 + ZoomBrochure_speed)) > ZoomBrochure_width)
			tmp_speed = ZoomBrochure_width - ZoomBrochure_valScroll;
		else
			tmp_speed = 1 + ZoomBrochure_speed;
		ZoomBrochure_positionScroll += tmp_speed;
		document.getElementById('ZoomBrochure_Scroll').scrollLeft = ZoomBrochure_positionScroll;
		ZoomBrochure_valScroll += tmp_speed;
	}
	else
	{
		clearInterval(ZoomBrochure_interv);
		ZoomBrochure_interv = null;
		if ((ZoomBrochure_positionScroll + ZoomBrochure_width) >= document.getElementById('ZoomBrochure_Scroll').scrollWidth)
			document.getElementById('btnMoveCategorieRight').style.visibility = 'hidden';
		document.getElementById('btnMoveCategorieLeft').style.visibility = 'visible';
	}
}