var theMarginLeft = 0;
var theFeaturedCount = 0;
var theCurrentFeature = 1;

function moveLeft() {
	if (theCurrentFeature<=(theFeaturedCount-4)) {
		theCurrentFeature++;
		theMarginLeft -= 235;
		$('#featured .container ul').animate({marginLeft: theMarginLeft+'px'}, 500);
	}
}

function moveRight() {
	if (theMarginLeft<0) {
		theCurrentFeature--;
		theMarginLeft += 235;
		$('#featured .container ul').animate({marginLeft: theMarginLeft+'px'}, 500);
	}
}

$(function() {
		
	theFeaturedCount = $('#featured .container ul li').length;
	$('#next').click(function() { 	
		moveLeft();
		return false;
	});
	
	$('#prev').click(function() {
		moveRight();
		return false;
	});
		
});

