jQuery.fn.listScroller = function(config, mask_config) {
	config = jQuery.extend({
	speed : 10000,
	direction :"left"
	}, config);
	mask_config = jQuery.extend({
	width : false,
	float : false
	}, mask_config);
	return this.each(function(){
		var list = $(this);
		list.css("position", "absolute");
		var childrenWidth = 0;
		list.children().each(function(){
			$(this).css("float", "left");
			childrenWidth += $(this).outerWidth(true);
		});
		list.css("width", childrenWidth+"px");
		
		list.wrap("<div id=\"scroller_mask\"></div>");
		$("#scroller_mask").css("position", "relative");
		if (mask_config.width){
			$("#scroller_mask").css("width", mask_config.width);
		}else{
			$("#scroller_mask").css("width", $("#scroller_mask").parent().width());	
		}
		$("#scroller_mask").css("height", list.outerHeight(true));
		$("#scroller_mask").css("overflow", "hidden");
		if (mask_config.float){
			$("#scroller_mask").css("float", mask_config.float);
		}
		
		totalWidth = list.outerWidth() + $("#scroller_mask").outerWidth();
		list.css(config.direction, $("#scroller_mask").outerWidth());
		
		function scroll_me(speed, totalWidth, direction){
			list.css(direction, $("#scroller_mask").width());
			var animate_to = list.css(direction).replace("px", "") - totalWidth;
			if (direction == "left"){
				list.animate({left : -totalWidth}, speed, "linear", function(){
					scroll_me(speed, totalWidth, direction);
				});				
			}else if(direction == "right"){
				list.animate({right : animate_to}, speed, "linear", function(){
					scroll_me(speed, totalWidth, direction);
				});
			}
		}
		
		scroll_me(config.speed, totalWidth, config.direction);
	});
};