/* based on jquery.innerfade, stripped down by 1PCS to only offer fading with no change to container height */
(function($) {
	$.fn.testimonialfade = function(options) {
		return this.each(function() {   
			$.testimonialfade(this, options);
		});
	};
	$.testimonialfade = function(container, options) {
		var settings = {
			'timeout':2000
		};
		if (options) {
			$.extend(settings, options);
		}
		var elements = $(container).children();
		if (!elements.length) { return false; }
		setTimeout(function() {
			$.testimonialfade.next(elements, settings, 1, 0);
		}, settings.timeout);
		$(elements[0]).show();
	};
	$.testimonialfade.next = function(elements, settings, current, last) {
		$(elements[last]).fadeOut(settings.speed, function() {
			$(elements[current]).fadeIn(settings.speed);
		});
		if ((current + 1) < elements.length) {
			current = current + 1;
			last = current - 1;
		}
		else {
			current = 0;
			last = elements.length - 1;
		}
		setTimeout((function() {
			$.testimonialfade.next(elements, settings, current, last);
		}), settings.timeout);
	};
})(jQuery);