(function($){

	$.fn.randomtip = function(settings){
		var config = {
			'pause': 3000,
			'speed': 1000
		};
		if (settings) $.extend(config, settings);
 
		var length = $(this).children().length;
		var childs = $(this).children();
		var temp = -1;
		
		this.each(function(){
			var getRan = function(){
				// get the random number
				var ran = Math.floor(Math.random()*length);
				return ran;
			};
			var show = function(){
				var ran = getRan();
				// to avoid repeating
				while (ran == temp){
					ran = getRan();
				}; 
				temp = ran;
				
				childs.hide();
				childs.eq(ran).fadeIn(config['speed']);
			};
			show();
			setInterval(show,config['pause']);
		});
	};

})(jQuery);




