$(document).ready(function(){

	var wrapLocation = 0;
	var currentItem = 1;
	
	$(".wrap").css("width", itemCount * 450);
	
	function SetItemCountText(){
		var text =  currentItem + " of " + itemCount;
		$(".project-count").text(text);	
	}
	
	
	$(".btn-back").click(function(){
		wrapLocation += 450;
		currentItem--;
		if (wrapLocation > 0){
			wrapLocation = 0 - ((itemCount - 1) * 450);
			currentItem = itemCount;
		}
		$(".wrap").animate({
				marginLeft: wrapLocation +"px"
		}, 200);
		SetItemCountText();
		
	});
	
	$(".btn-forward").click(function(){
		wrapLocation -= 450;
		currentItem++;
		if (wrapLocation < (0 - ((itemCount - 1) * 450))){
			wrapLocation = 0;
			currentItem = 1;
		}
		$(".wrap").animate({
				marginLeft:wrapLocation + "px"
		}, 200);
		SetItemCountText();
	});
	
	SetItemCountText();
});
