(function($){
	// slide show elements
	$.fn.extend({
		TopBanner: function(options) {
			var defaults = {
				item: "div",
				time: 3000,
				mosaic: true,
				mousestop: false
			};
			
			var o = $.extend(defaults, options);
			
			return this.each(function() {
				var obj = $(this);
				
				var interval;
				var time = o.time;
				var current = 0;
				var old = 0;
				var slide = o.slide;
				var mosaic = o.mosaic;
				var mousestop = o.mousestop;
				var count = $(this).children(slide).size();
				
				if(count > 1){ interval = setInterval(rotator, time); }
				
				if(mousestop){
					obj.hover(function() {
						clearInterval(interval);
					}, function() {
						if(count > 1){ interval = setInterval(rotator,time); }
					});
				}
				
				function rotator(){
					current = (current + 1) % count; 
					
					if(mosaic){
						obj.children(slide).eq(old).fadeOut();
						obj.children(slide).eq(current).fadeIn();
					} else {
						obj.children(slide).eq(old).fadeOut(function(){
							obj.children(slide).eq(current).fadeIn();
						});
					}
					
					old = current;
				}
			});
		}
	})
})(jQuery);
