(function ($){
	/**
	* @author 鲁振兴
	* 手动左右滚动
	* v1.0
	* 2011-9-14
	*/
	$.fn.manualHorizontalScroll = function (options){
		return this.each(function (){
			if (options == null) return this;
			var defaultOpts = {
				count: 1,
				speed: 1000
			};
			var opts = $.extend({}, defaultOpts, options);
			var _list = $(opts.list, this);
			var list_child = _list.find(opts.child).css({'position' : 'relative'});
			var list_length = list_child.length;
			var child_width = list_child.width() * opts.count;
			$(opts.leftBar, this).click(function (e){
				e.preventDefault();
				//：animated得到正在执行动画的元素
				if (! _list.is(':animated')){
					_list.animate({ left : '-=' + child_width }, opts.speed, function (){
						($(opts.child + ':lt(' + opts.count + ')', _list)).appendTo(_list);
						_list.css('left', 0);
					});
				}
			});
			
			$(opts.rightBar, this).click(function (e){
				e.preventDefault();
				//：animated得到正在执行动画的元素
				if (! _list.is(':animated')){
					($(opts.child + ':gt(' + (list_length - opts.count - 1) + ')', _list)).prependTo(_list);
					_list.css('left', - child_width);
					_list.animate({ left : '+=' + child_width }, opts.speed, function (){
					});
				}
			});
		});
	}
})(jQuery);