function moveScroller(dir)
{
	way = dir;
	
	window.clearInterval(iv_auto);

	iv = setInterval(doMove,45);	 
	
}


var way = "";
var iv = null;
var iv_auto = null;


function doMove()
{
	if (way == "-")
	{
		if (parseInt(document.getElementById('scroller').style.left) > (parseInt(document.getElementById('photoScroll1').clientWidth - document.getElementById('scroller').clientWidth)))							 
			document.getElementById('scroller').style.left = parseInt(document.getElementById('scroller').style.left) - 2 + 'px';
	}
	else
	{
		if (parseInt(document.getElementById('scroller').style.left) < 0)
			document.getElementById('scroller').style.left = parseInt(document.getElementById('scroller').style.left) + 2 + 'px';
	}
}


function doAutoMove()
{
	if (way == "+")
	{
		if (parseInt(document.getElementById('scroller').style.left) > (parseInt(document.getElementById('photoScroll1').clientWidth - document.getElementById('scroller').clientWidth))) {							 
			document.getElementById('scroller').style.left = parseInt(document.getElementById('scroller').style.left) - 1 + 'px';
		} else {
		 	way = "-";
		}
	}
	else
	{
		if (parseInt(document.getElementById('scroller').style.left) < 0) {
			document.getElementById('scroller').style.left = parseInt(document.getElementById('scroller').style.left) + 1 + 'px';
		} else {
		 	way = "+";
		}

	}

}

function stopScroller()
{
	window.clearInterval(iv);
	iv_auto = setInterval(doAutoMove,45);
}				

function stopAutoScroller() {
	window.clearInterval(iv_auto);
}

function startAutoScroller(){
	iv_auto = setInterval(doAutoMove,45);
}		 

function baz_onLoad()
{
	way = "-";
	iv_auto = setInterval(doAutoMove,45);
}

