﻿(function($){
	$.fn.fadeOnce = function(options){
		
		$sibLen = $(this).children().length;
		$myDiv = $(this);
		$cnt = 0;
		$delay = 2;
		if(options){
			$delay = options.delay;
		}
		
		//$(this).children('div:eq(0)').hide("slow");
		$(this).children('div').each(
			function(intIndex){
				
				$(this).css({'z-index' : intIndex, 'position' : 'absolute'});
				$(this).hide();
				
			}
		);
		
		
		
		function startAni(num){
			
			if(num < $sibLen){
				$myDiv.children('div:eq('+num+')').fadeIn(500, function(){
					$cnt++;
					startAni($cnt);
					/*setTimeout(function(){
						startAni($cnt);
					}, 2*1000);*/
				});
			}
		}
		
		startAni($cnt);
		
	}
})(jQuery);