var totalShowcases = 4; // incl. 0
var currentShowcase = 0;
var lastShowcase = 0;
var showcaseEffectDelay = 8;

$(document).ready(function() {
	setInterval("swapShowcase()",showcaseEffectDelay*1000);
});

function swapShowcase() {
	$("#showcase-"+currentShowcase).animate({ left: "-840px" }, 500);
	lastShowcase = currentShowcase;
	currentShowcase = (currentShowcase == totalShowcases) ? 0 : currentShowcase+1;
	$("#showcase-"+(currentShowcase)).animate({ left: "0px" }, 500, function() {
		$("#showcase-"+(lastShowcase)).css("left","840px");
	});
}

function resetShowcase(id) {
	$("#showcase-"+id).css("left","840px");
}