(function($) {

$.fn.newsScroll = function(options) {
	
	return this.each(function() {	
	
		var
			$this = $(this), 
		  
			defaults = {
		  		speed: 400, 
		  		delay: 3000, 
		  		list_item_height: $this.children('div').outerHeight() 
	     	},
	     
			settings = $.extend({}, defaults, options); 
		 
		 	$this
  		 		.children('li:first')
  		 		.next('li')
  		 		.css('zIndex', 2);
		 
			setInterval(function() {
				
				if ($this.children().size() > 1) {
			
	  	    	$this.children('li:first')
	  	    		.fadeOut(
	  	    		
	  	    		  	settings.speed,

	  	  				function() {
	  	 					$this
	  	 					  .children('li:first')
	  	 					  .appendTo($this)
	  	 					  .css('zIndex', 1)
	  	 					  .fadeIn(300); 
	  	 					  
	  	 					$this
	  	 						.children('li:first')
  		 						.css('zIndex', 3);
  		 					
  		 					$this
  		 						.children('li:first')
  		 						.next('li')
  		 						.css('zIndex', 2);
  		 				}
 	 				); // end animate
 	 			}
			}, settings.delay); // end setInterval
	});
}

})(jQuery);
