(function($) {
	
	$.fn.contentfade = function(options) {
		
		options = $.extend({
			duration: 5000,
			transTime: 1000,
			showControls: true
		}, options)
		
		return this.each(function(){
			
			var slider = $(this),
			nextCol,
			oldSlideCol,
			children = slider.children('.slide'),
			childData = new Array(),
			z = 100,
			index = 0;
			
			slider.css('position', 'relative');
			
			children.each(function(index, elm){
				if(index > 0) z = 0;
				
				jQuery(this).css({'z-index' : z, 'position' : 'absolute', 'top' : 0, 'left' : 0});
			});
			
			setInterval(function() {
				next = ((index+1) > (children.length-1)) ? 0 : index+1;
				
				children.eq(next).css('z-index', 1);
				
				children.eq(index).fadeOut(options.transTime, function() {
					
					children.eq(next).css('z-index', 100);
					jQuery(this).css({'z-index' : 0, 'display' : 'block'});
				});
				
				index = next;
			}, options.duration);
			
		});
	}
	
})(jQuery);
