$(document).ready(function() {
	
	var animationSpeed = 750;
	var allowAnimation = true;
	
	var boxCount   = 5;
	var boxVisible = 3;
	var boxActual  = 0;
	var boxWidth   = 251;
	var boxGap     = 31;
	
	$('a.arrow-left').click(function() {
    	if (!allowAnimation || boxActual <= 0)
    		return false;
    		
    	boxActual -= 1;
    	var left = 0 - (boxActual * boxWidth) - (boxActual * boxGap);		 
    	
		allowAnimation = true;
		$('.slider-wrap').animate({ left: left + 'px' }, animationSpeed, 'easeInOutExpo', function() { allowAnimation = true; });
		return false;
	});
	
	$('a.arrow-right').click(function() {
    	if (!allowAnimation || boxActual >= (boxCount - boxVisible))
    		return false;
    		
    	boxActual += 1;
    	var left = 0 - (boxActual * boxWidth) - (boxActual * boxGap);
		   	
		allowAnimation = true;
		$('.slider-wrap').animate({ left: left + 'px' }, animationSpeed, 'easeInOutExpo', function() { allowAnimation = true; });
		return false;
	});
		
});
