var rightInterval = null;
var leftInterval = null;

function StartScrollRight()
{
	rightInterval = window.setInterval(ScrollRight, 10);
}

function StopScrollRight()
{
	window.clearInterval(rightInterval)
}

function ScrollRight()
{
	var container = $('gallery-container');
	
	if((container.style.marginLeft != null) && (parseInt(container.style.marginLeft.replace(/px/, '')) <= -2000))
	{
		return;
	}
	
	if((container.style.marginLeft != null) && (container.style.marginLeft != ''))
	{
		container.style.marginLeft = parseInt(container.style.marginLeft.replace(/px/, '')) - 2 + 'px';
	}
	else
	{
		container.style.marginLeft = '-2px';
	}
}

function StartScrollLeft()
{
	leftInterval = window.setInterval(ScrollLeft, 10);
}

function StopScrollLeft()
{
	window.clearInterval(leftInterval)
}

function ScrollLeft()
{
	var container = $('gallery-container');
	if((container.style.marginLeft != null) && (parseInt(container.style.marginLeft.replace(/px/, '')) >= 0))
	{
		return;
	}
	
	if((container.style.marginLeft != null) && (container.style.marginLeft != ''))
	{
		container.style.marginLeft = parseInt(container.style.marginLeft.replace(/px/, '')) + 2 + 'px';
	}
	else
	{
		container.style.marginLeft = '+2px';
	}
}