$.fn.scrollBox = function(data) {
	var $this = this,autoMove;
	if ( this.find("li").length > data.liCount ) {
		var step = this.find("li").outerWidth(true);
		this.css("overflow","hidden").find("ul:first").css("width",( this.find("li").length * step ) + "px");
		function moveLeft() {
			$this.find("li:first").animate( { "marginLeft" : -step + "px" } , { queue: false, duration: data.one, complete: function() {
				$(this).insertAfter($this.find("li:last")).css("marginLeft",0);
			} } );
		}
		function moveRight() {
			$this.find("li:last").css("marginLeft",-step + "px").insertBefore($this.find("li:first")).animate( { "marginLeft" : 0 } , { queue: false, duration: data.one } );
		}
		function restartMove() {
			autoMove = setInterval( function() {
				if ( data.forward == "left" ) {
					moveLeft();
				}
				else if ( data.forward == "right" ) {
					moveRight();
				}
			} , data.speed );
		}
		if ( data.auto ) {
			restartMove();
			if ( data.stop ) {
				this.hover( function() {
					clearInterval(autoMove);
				}, function() {
					restartMove();
				} );				
			}
		}
		if ( data.control ) {
			$("." + data.ctrlClass).eq(0).click( function() {
				clearInterval(autoMove);
				data.forward = "left";
				moveLeft();
				restartMove();
			} ).end().eq(1).click( function() {
				clearInterval(autoMove);
				data.forward = "right";
				moveRight();
				restartMove();
			} )
		}
	}
	else if ( this.find("li").length == 0 ) {
		this.html(data.noRecord);
	}
	return this;
};
