var reel = document.getElementById("reel"); // The moving div itself

reel_x = 0; // The position of the absolute
counter=0; // This resets and counts on every click
slide=1; // Determins which slide you are on

arrowCheck(); // Checks to see if your on slide 1 or 5 and acts accordingly

function Previous()
{	
	slide = slide-1
	counter = 0;
	dx = 40;
	Slide();
	arrowCheck();
}

function Next()
{	
	slide = slide + 1
	counter = 0 ;
	dx = -40;
	Slide();
	arrowCheck();
}

function Slide()
{	
	reel_x = reel_x + dx;	
	reel.style.marginLeft = reel_x + 'px';
	
	if ( counter < 400) 
	{	
		timerID = setTimeout("Slide()", 30);
		arrowCheck();
		counter = counter + 40;
	}	
}

function arrowCheck()
{
	if (slide <= 1)
	{
		document.getElementById("prev").innerHTML = '<a href="#prev">Previous</a>';
	}
	else
	{
		document.getElementById("prev").innerHTML = '<a href="#prev" onclick="Previous();">Previous</a>';
	}
	
	if (slide >= 2)
	{
		document.getElementById("next").innerHTML = '<a href="#next">Next</a>';
	}
	else
	{
		document.getElementById("next").innerHTML = '<a href="#next" onclick="Next();">Next</a>';
	}
}

