/*
 * responsive-carousel autoplay extension
 * https://github.com/filamentgroup/responsive-carousel
 *
 * Copyright (c) 2012 Filament Group, Inc.
 * Licensed under the MIT, GPL licenses.
 */

(function( $, undefined ) {
	var pluginName = "carousel",
		initSelector = "." + pluginName,
		interval = 4000,
		autoPlayMethods = {
			play: function(){
				var $self = $( this ),
					intAttr = $self.attr( "data-interval" ),
					thisInt = parseFloat( intAttr ) || interval;
				return $self.data(
					"timer", 
					setInterval( function(){
						$self[ pluginName ]( "next" );
					},
					thisInt )
				);
			},
			
			stop: function(){
				clearTimeout( $( this ).data( "timer" ) );
			},
			
			_bindStopListener: function(){
				return $(this).bind( "mousedown", function(){
					$( this )[ pluginName ]( "stop" );
				} );
			},
			
			_initAutoPlay: function(){
				var autoplay = $( this ).attr( "data-autoplay");
				if( autoplay === true || ( autoplay !== null && autoplay !== false ) ){
					$( this )
						[ pluginName ]( "_bindStopListener" )
						[ pluginName ]( "play" );
				}
			}
		};
			
	// add methods
	$.extend( $.fn[ pluginName ].prototype, autoPlayMethods ); 
	
	// DOM-ready auto-init
	$( document ).on( "create." + pluginName, initSelector, function(){
		$( this )[ pluginName ]( "_initAutoPlay" );
	} );

}(jQuery));
@@ -248,43 +248,8 @@
 l%22,%0A
-%09%09initSelector = %22.%22 + pluginName,%0A
 %09%09in
@@ -465,17 +465,16 @@
 %22timer%22,
- 
 %0A%09%09%09%09%09se
@@ -565,27 +565,24 @@
 %09%09%09);%0A%09%09%09%7D,%0A
-%09%09%09
 %0A%09%09%09stop: fu
@@ -640,27 +640,24 @@
  ) );%0A%09%09%09%7D,%0A
-%09%09%09
 %0A%09%09%09_bindSto
@@ -784,19 +784,16 @@
 ;%0A%09%09%09%7D,%0A
-%09%09%09
 %0A%09%09%09_ini
@@ -1051,19 +1051,16 @@
 %09%7D%0A%09%09%7D;%0A
-%09%09%09
 %0A%09// add
@@ -1131,11 +1131,9 @@
 s );
- %0A%09
+%0A
 %0A%09//
@@ -1168,19 +1168,22 @@
 ument ).
-on(
+bind( 
  %22create
@@ -1202,22 +1202,8 @@
 ame,
- initSelector,
  fun
@@ -1212,16 +1212,19 @@
 ion(
+ e 
 )%7B%0A%09%09$( 
 this
@@ -1215,28 +1215,32 @@
 ( e )%7B%0A%09%09$( 
-this
+e.target
  )%5B pluginNa
@@ -1266,17 +1266,16 @@
 y%22 );%0A%09%7D
- 
 );%0A%0A%7D(jQ

support autoplay for libraries that mimic jquery but lack the 3-arg event syntax support