
var cmscroller = function ( target, options ) {
		var defaults = {
			animDelay: 40,		// Pause entre appels de la fonction (en ms)
			animScroll: 3,		// Nbr de pixels scrolles a chaque fois
			direction: 1		// NESW
		};
		options = jQuery.extend( {}, defaults, options );
		target.each( function () {
			var self = this;
			var cfg = jQuery.extend( {}, options );
			cfg.posInitial = parseInt( $(this).css( 'marginTop' ) );
			if ( !cfg.posInitial ) cfg.posInitial=0;
			cfg.scrollerPos = cfg.posInitial;
			cfg.scrollerMax = parseInt( $(this).height() ); 
			$(this).data( 'scroller', cfg )
				.mouseover( function () {  $(this).data( 'hovered', 1 ); } )
				.mouseout(  function () {  $(this).data( 'hovered', 0 ); } );

			cfg.scrollerTimer = window.setInterval( function () {
				if ( $(self).data( 'hovered' ) ) return;
				cfg.scrollerPos += cfg.animScroll;
				if ( cfg.scrollerPos >= cfg.scrollerMax ) {
					cfg.scrollerPos = cfg.posInitial;
				}
				var pos = parseInt( 0 - cfg.scrollerPos );
				$(self).css( 'marginTop', (0-cfg.scrollerPos) + 'px' );
			}, cfg.animDelay );
		} );
			

};

