var cyclerate = 2000; // time image is fully shown. does not count hiderate or showrate
var hiderate = 700; // image is faded out over this period of time
var showrate = 500; // imge is faded in over this period of time

$(document).ready(function() {
	setTimeout(cycleImage, cyclerate);
});

function cycleImage() {
	var next = $('#imagecycle a.displayed').next();
	$('#imagecycle a').removeClass('displayed').fadeOut(hiderate);
	
	if(next.length == 0) {
		next = $('#imagecycle a:first');
	}
	
	setTimeout(function() {
		$(next).fadeIn(showrate).addClass('displayed');
		setTimeout(cycleImage, showrate + cyclerate);
		}, hiderate);
}
