var countLimit = 3;  //Specify Number of Items Minus 1
var count = 0;

$(document).ready(function(){
		
	$("#next").click(function(){
	
	next();
	buttonCheck();
	
	});
	
	$("#previous").click(function(){
	
	previous();
	buttonCheck();
	
	});

});

function next()
{
		
	if ( count < countLimit ){
		
		$("#workcontainer").animate({ 
				marginLeft: "-=175px"
			}, 500 );
		count++;
		
	}

}

function previous()
{
	
	if ( count > 0 ){
		
		$("#workcontainer").animate({ 
					marginLeft: "+=175px"
				}, 500 );
		count--;
		
	}
	
}

function buttonCheck()
{

	if ( count < countLimit ){
	
		document.getElementById("next").src = "base/icon_next.png";
	
	} else {
	
		document.getElementById("next").src = "base/icon_next_void.png";
	
	}

	if ( count > 0 ){
	
		document.getElementById("previous").src = "base/icon_previous.png";
	
	} else {
	
		document.getElementById("previous").src = "base/icon_previous_void.png";
	
	}

}
