window.onload = initScroll;
var qstring = window.location.search.substring(1);
if (qstring.indexOf("d=4")<0 && qstring.indexOf("d=5")<0)
{
	maxscroll = 5;
}
else
{
	maxscroll = 10;
}

function initScroll() {
	if (document.getElementById) {
		obj = document.getElementById("scrollInner");
		if (obj) {
			obj.iCurrentStep = 0;
			obj.iStepIncrement = 150;
			obj.iMaxStep = maxscroll;
			obj.timer = null;
		}
	}
} 

function slideRight() {
	if (obj.iCurrentStep > 0) {
		var nextPos = (obj.iCurrentStep - 1) * obj.iStepIncrement;
		var leftPos = parseInt(obj.style.left);
		var iAbs = -leftPos;

		if (iAbs > nextPos) {
			obj.style.left = (leftPos + (obj.iStepIncrement / 5)) + "px";
			obj.timer = setTimeout("slideRight()", 10);
		} else {
			obj.iCurrentStep--;
			obj.timer = null;
		}
	} else {
		obj.iCurrentStep = 0;
	}
}

function slideLeft() {
	if (obj.iCurrentStep < obj.iMaxStep) {
		var nextPos = (obj.iCurrentStep + 1) * obj.iStepIncrement;
		var leftPos = parseInt(obj.style.left);
		var iAbs = -leftPos;

		if (iAbs < nextPos) {
			obj.style.left = (leftPos - (obj.iStepIncrement / 5)) + "px";
			setTimeout("slideLeft()", 10);
		} else {
			obj.iCurrentStep++;
			obj.timer = null;
		}
	} else {
		obj.iCurrentStep = obj.iMaxStep;
	}
}


