var ml = $('scroller').style.marginLeft.substr(0,$('scroller').style.marginLeft.indexOf('px'));
var timr;
var direction;
var x = $('scroller').getElementsByTagName('div');
var nprod = x[0].id;
var mleft = nprod * 112 - 700;

function stop() {
	clearInterval(timr);
}

function scrollme(dir) {
	if (dir=='left') {
		ml=(parseInt(ml)-1);
	} else {
		ml=(parseInt(ml)+1);		
	}
	$('scroller').style.marginLeft=ml+"px";

	if ($('scroller').style.marginLeft=="-"+mleft+"px") {
		stop();
		play('right');
	} else if ($('scroller').style.marginLeft=="0px") {
		stop();
		play('left');
	}
}

function play(dir) {
	direction=dir;
	stop();
	timr=setInterval("scrollme('"+dir+"');",20);
}
