//specify speed of scroll (greater=faster)
var speed = 4;

function moveDown(id) {
	var crossObj = document.getElementById("recipeIndex" + id);
	var contentHeight = crossObj.offsetHeight;
	if (parseInt(crossObj.style.top) >= (contentHeight * (-1) + 205)) {
		crossObj.style.top = parseInt(crossObj.style.top) - speed + "px";
		scrollTop = crossObj.style.top;
		setScrollImages(id, "down");
	}
	else {
		document.getElementById("imgScrollDown" + id).src = imgPath + 'scroll-down-inactive.gif';
	}
	moveDownVar = setTimeout("moveDown('"+ id +"')", 1);
}

function moveUp(id) {
	var crossObj = document.getElementById("recipeIndex" + id);
	if (parseInt(crossObj.style.top) <= -3) {
		crossObj.style.top = parseInt(crossObj.style.top) + speed + "px";
		scrollTop = crossObj.style.top;
		setScrollImages(id, "up");
	}
	else {
		document.getElementById("imgScrollUp" + id).src = imgPath + 'scroll-up-inactive.gif';
	}
	moveUpVar = setTimeout("moveUp('"+ id +"')", 1);
}

function setScrollImages(id, direction) {
	if (direction != 'up') {
		var imageUp = document.getElementById("imgScrollUp" + id);
		if (parseInt(scrollTop) < -3)
			imageUp.src = imgPath + 'scroll-up-active.gif';
		else
			imageUp.src = imgPath + 'scroll-up-inactive.gif';
	}
	if (direction != 'down') {
		var imageDown = document.getElementById("imgScrollDown" + id);
		var crossObj = document.getElementById("recipeIndex" + id);
		var contentHeight = crossObj.offsetHeight;
		if (parseInt(crossObj.style.top) >= (contentHeight * (-1) + 205))
			imageDown.src = imgPath + 'scroll-down-active.gif';
		else
			imageDown.src = imgPath + 'scroll-down-inactive.gif';
	}
}

