var cur_pos = 0;
var speed = 5;
var hispeed=20;
var framewidth = 540;
var scrolltimer;
var direction=0;
function scrollpreview(dir)
{
	//alert(totalwidth);
	//if(framewidth>pictureswidth) return;
	direction = dir;
	if(direction==1)
	{
		if(cur_pos+hispeed*direction<5)
		{
			cur_pos +=hispeed*direction;
		}
	}
	else if(direction==-1)
	{
		if(cur_pos + pictureswidth > framewidth)
		{
			cur_pos +=hispeed*direction;
		}
	}
	document.all.dvPreview.style.left = cur_pos + 'px';
}

function scrollmebaby()
{

	if(direction==1)
	{
		if(cur_pos+speed*direction<5)
		{
			cur_pos +=speed*direction;
		}
	}
	else if(direction==-1)
	{
		if(cur_pos + pictureswidth > framewidth)
		{
			cur_pos +=speed*direction;
		}
	}
	document.all.dvPreview.style.left = cur_pos + 'px';
	//document.writeln(document.all.dvPreview.style.left);
}

function scrollover(dir)
{
	direction = dir;
	scrolltimer = setInterval("scrollmebaby()",60);
}

function scrollout(dir)
{
	direction = 0;
	clearInterval(scrolltimer);
}