var totalWidth = 0;
var bool = 0;

function moveRight()
{
	var slider = document.getElementById("slideImages");
	var currentLeft = parseInt(slider.style.left);
	var total = 300 - parseInt(slider.style.width);

	if(bool == 0 && currentLeft > total)
	{
		var nextLeft = currentLeft - 2;
		slider.style.left = nextLeft + "px";
		setTimeout("moveRight()",1);
	}
}

function moveLeft()
{
	var slider = document.getElementById("slideImages");
	var currentLeft = parseInt(slider.style.left);

	if(bool == 0 && currentLeft < 0)
	{
		var nextLeft = currentLeft + 2;
		slider.style.left = nextLeft + "px";
		setTimeout("moveLeft()",1);
	}
}

function stop()
{ bool = 1; }

function init()
{ bool = 0; }

function countWidth(id)
{ totalWidth = totalWidth + 6 + id.width; }

function assignWidth()
{ document.getElementById("slideImages").style.width = totalWidth; }
