;(function($) {
	
$.fn.inverisImageCycle = function(options) {
	var defaults = {
		speed : 2000,
		interval : 5000
	},
	settings = $.extend({}, defaults, options),
	$self = this;
	
	$self.find('a').css({
		position: 'absolute',
		top : 0
	});

	$self.find('a:first')
		.addClass('active')
		.css({
			top : 0,
			zIndex : 1  
		})
	;
	
	cycle = function() {
		var $current = $self.find('a.active');
		var $next = $current.next();
		if($next.length == 0)
		{
			$next = $self.find('a:first');
		}
		
		$next.hide();
		$next.css({ zIndex : 2 });
		
		$next.fadeIn(settings.speed, function(){
			$current.hide();
			$next.css({ zIndex : 1 });
			$next.addClass('active');
			$current.removeClass('active');
		});
	};

	if($self.find('a').length > 1)
	{
		playing = setInterval(cycle, settings.interval);
	}
}; // inverisImageCycle

})(jQuery);
