(function($) {
	
	$.fn.contentSlider = function(options) {
		// Default options that are used sans parameters
		var defaults = {
			speed: 1500,
			duration: 3000
		};
		
		// Find the intersection of options, overriding 
		// the default with the user's input
		var settings = $.extend({}, defaults, options);
		
		this.each(function() {
			var $this = $(this);
			
			$this.wrap( '<div class="content-wrapper"></div>' );
			
			// $( '#left' ).click( function() {
			// 	$this.animate( { left: '300px' }, settings.speed, function() {
			// 		$this.children( ':last' ).remove().prependTo( $this );
			// 		$this.css( { left: '0px' } );
			// 	} );
			// } );
			// 
			// $( '#right' ).click( function() {
			// 	$this.animate( { left: '-300px' }, settings.speed, function() {
			// 		$this.css( { left: '0px' } ).children( ':first' ).remove().appendTo( $this );
			// 	} );
			// } );
			
			var timer = window.setInterval( function() {
				$this.animate( { left: '-310px' }, settings.speed, function() {
					$this.css( { left: '0px' } ).children( ':first' ).remove().appendTo( $this );
				} );
			}, settings.duration );
		});
		
		// Return the jQuery object for chainability
		return this;
	}
	
	$( '.slider' ).contentSlider( {
		speed: 1500,
		duration: 6000
	} );
	
})(jQuery);
