// speed of the animations
var aniSpeed = 2000;

// init
jQuery(function(){
	$("img.project").hide();
	ShowProject("img.project:first");
});

// show a particular project
function ShowProject(selector) {
	$("img.project.active").removeClass("active").fadeOut(aniSpeed);
	$(selector).addClass("active").fadeIn(aniSpeed);
	setTimeout(function(){
		var next = $("img.project.active").next();
		if(next.length == 0) {
			next = $("img.project:first");
		}
		ShowProject(next);
	}, aniSpeed * 3);
}
