this.randomimage = function(){

	var pause = 5000;
	var length = $("#image1 li").length;
	var temp = -1;

	this.getRan = function(){
		// get the random number
		var ran = Math.floor(Math.random()*length) + 1;
		return ran;
	};
	this.show = function(){
		var ran = getRan();
		// to avoid repeating tips we need to check
		while (ran == temp){
			ran = getRan();
		};
		temp = ran;
		$("#image1 li").hide();
		$("#image1 li:nth-child(" + ran + ")").fadeIn("slow");
	};
	// initiate the script and also set an interval
	show(); setInterval(show,pause);

};

$(document).ready(function(){	
	randomimage();
});