var validWBox = 240; /* imageBox width */
var validWImg = 160; /* image width */
var numImg = 4; /* count image */

function getMoveStatus(currMove) {
	var theLeft = document.getElementById('imageBoxInside').style.left;
	/* current left position of ImageBoxInside */

	var imgNumComul = numImg * validWImg;
	/* comulative image width (10*130) */

	theLeft = parseInt(theLeft.replace('px', ''));
	if (currMove == 'next') {
		theLeft = theLeft - validWBox;
	} else {
		theLeft = theLeft + validWBox;
	}
	if (theLeft == validWBox) {
		return false;
	} else if (isNaN(theLeft) && currMove == "prev") {
		return false;
	} else if (theLeft <= (0 - imgNumComul)) {
		return false;
	} else {
		return true;
	}
}

/* ——————- */
function moveToPrevious() {
	var validMove = getMoveStatus('prev');
	if (validMove) {
		new Effect.Move('imageBoxInside', { x: validWBox, y: 0, transition: Effect.Transitions.sinoidal });
	}
}

function moveToNext() {
	var validMove = getMoveStatus('next');
	if (validMove) {
		new Effect.Move('imageBoxInside', { x: (0 - validWBox), y: 0, transition: Effect.Transitions.sinoidal });
	}
}
