xTarget = 160;
zindex = 0;
current = -1;
nextImage = 5000;
slideSpeed = 30;

function slideShow ()
{
	if (typeof(div_array) == 'undefined') return;
	setNextDiv();
	next ();
}

function setNextDiv()
{
	if (current<div_array.length-1)
			current++;
	else	current=0;
}

function next ()
{
	obj = document.getElementById(div_array[current]);
	obj.style.display = "block";
	obj.style.zIndex = zindex++;
	x=500;
	move(obj);
}

function move(obj) 
{
	var xDiff = xTarget - x;
	x += xDiff/4;
	obj.style.left = x + "px";
	if (Math.round(xDiff) == 0) 
	{
		window.clearTimeout(move_timeout);
		move_timeout = null;
		if (div_array.length>1)
		{
			setNextDiv();
			window.setTimeout ("next ();", nextImage);
		}
	} else {
		move_timeout = window.setTimeout("move(obj);",slideSpeed);
	}
}

