var startingPoint = 30;
var farLeft = startingPoint;
var numPanels = 5;
var panelSize = 247;
var farRight = startingPoint + ((numPanels - 3) * panelSize) * -1;

var Navigation = new SmoothMovement(-640, -640);
var position = panelSize;

function NavigateLeft()
{
	if(position < farLeft)
		NavigationGoTo(position += panelSize, true);
}

function NavigateRight()
{
	if(position > farRight)
		NavigationGoTo(position -= panelSize, true);
}


function NavigationGoTo(index, showAnimation){	
	position = index;
	Navigation.target = index;

	if(showAnimation == true)
	{
		// animate the movement
		Navigation.animate(
		
		    20,
		    function(position){
		      // move the background image
		      document.getElementById('slider').style.left = position + "px";
		    },
		    function(){
		     });
	}
	else
		document.getElementById('slider').style.left = position + "px";
	 
}



