(function($) { // Hubsoft.com && SebringCreative.com - Dual licensed under the MIT and GPL licenses.
	$.fn.dumbCrossFade = function(settings) {
		var config = {'index':0,'showTime':5000,'transitionTime':1000,'doHoverPause':true, 'maxZIndex':100};
		var timeOut = null;
		var itemArray = [];

		function cancelCrossFade() {
			if (timeOut !== null) { window.clearTimeout(timeOut); timeOut = null; }
		}
		function doCrossFade() {
			timeOut = window.setTimeout(function() {
				var currentIndex = config.index;
				var nextIndex = (config.index >= itemArray.length - 1) ? 0 : config.index + 1;
				itemArray[currentIndex].css('z-index',(config.maxZIndex-1)+'');
				itemArray[nextIndex].css('z-index',config.maxZIndex+'');
				itemArray[nextIndex].fadeIn(config.transitionTime, function() {
					itemArray[currentIndex].hide();
				});
				config.index = nextIndex;
				doCrossFade();
			},config.showTime);
		}

		if (settings) $.extend(config, settings);

		this.each(function() {
			(itemArray.length === config.index) ? $(this).show() : $(this).hide();
			if (config.doHoverPause) { $(this).hover(
				function() {
					cancelCrossFade();
				},
				function() {
					cancelCrossFade();
					doCrossFade();
				}
			); }
			itemArray[itemArray.length] = $(this);
		});

		doCrossFade();

		return this;
	};
})(jQuery);