function swapImage(imageCount) {
	var whichImage = imageCount.no % 5;
	var nextImage = ( imageCount.no + 1 ) % 5;
	//console.info(nextImage);
	if( whichImage != 5) {
		$("#image" + nextImage).css("display","block");
		$("#image" + whichImage).fadeOut(900);
	}
	else
		$("#image" + nextImage).fadeIn(900);
	imageCount.no+=1;
}

function ImageCount(theCount) {
	this.no = theCount;//this is an object so it can be altered inside a function as I couldn't seem to do it by returning the amended number from a function
}

jQuery(document).ready(function() {
	//console.info("begin");
//var imageCount = new ImageCount(Math.floor(Math.random()*5));
	var imageCount = new ImageCount(0);
imageCount.no= (Math.floor(Math.random()*5));
$("#image" + imageCount.no).css("display","block");
	setInterval (function() { swapImage(imageCount) }, 10000);
});