(function($) {
	$.fn.RotateBanners = function(options) {
		options = $.extend({
			'rotatespeed': 3, // speed between fades
			'fadespeed': 1 // speed of fade animation
		}, options);
		return this.each(function() {
			$(this).data('rotatespeed',options['rotatespeed']);
			$(this).data('fadespeed',options['fadespeed']);
			if ($(this).length > 0) {
				$('> div', this).hide().css({
					position: 'absolute',
					left: '0px',
					top: '0px',
					zIndex: '7'
				});
				$('> div:first', this).css('z-index','10').show();
				var obj_target = $(this);
				setInterval(function(){
					var obj_current = $('> div:visible', obj_target).css('z-index','7');
					if ($(':visible', obj_target).next().length > 0) {
						var obj_next = $('> div:visible', obj_target).next();
					} else {
						var obj_next = $('> div:first', obj_target);
					}
					obj_next.css('z-index','10').fadeIn((options['fadespeed'] * 1000), function() {
						obj_current.hide();
					});
				}, options['rotatespeed'] * 1000);
			}
		});
	}
})(jQuery);
