var featureLeft = 0;

$(document).ready (function () {
	$("#filter li.minus").click (hideImages);
	$("#filter li.plus").click (showImages);
	$("#feature_prev").click (prevFeature);
	$("#feature_next").click (nextFeature);
	$("#feature ul#content").css ("width", ($('#feature ul#content').children().size()*930)+"px");
});

function hideImages () {
	$(".image").slideUp (200);
}

function showImages () {
	$(".image").slideDown (200);
}

function nextFeature () {
	if (!$("#feature_next").hasClass ("disabled")) {
		featureLeft -= 930;
		$("#feature ul#content").animate ({marginLeft: featureLeft}, 500);
		if (featureLeft == 0-$("#feature ul#content").width() + 930) $("#feature_next").addClass ("disabled");
		if ($("#feature ul#content").width() > 930) $("#feature_prev").removeClass ("disabled");
	}
}

function prevFeature () {
	if (!$("#feature_prev").hasClass ("disabled")) {
		featureLeft += 930;
		$("#feature ul#content").animate ({marginLeft: featureLeft}, 500);
		if (featureLeft == 0) $("#feature_prev").addClass ("disabled");
		if ($("#feature ul#content").width() > 930) $("#feature_next").removeClass ("disabled");
	}
}