jQuery.fn.liScroll = function(settings) {
		settings = jQuery.extend({
		travelocity: 0.02
		}, settings);		
		return this.each(function(){
				var $strip = jQuery(this);
				$strip.addClass("newsticker")
				var stripWidth = 0;
				var $mask = $strip.wrap("<div class='mask'></div>");
				var $tickercontainer = $strip.parent().wrap("<div class='tickercontainer'></div>");
				$strip.parent().parent().parent().prepend("<div id='controller' class='stop'></div>");								
				var containerWidth = $strip.parent().parent().width();	//a.k.a. 'mask' width 	
				$strip.find("li").each(function(i){
				stripWidth += jQuery(this, i).width();
				});
				$strip.width(stripWidth);			
				var defTiming = stripWidth/settings.travelocity;
				var totalTravel = stripWidth+containerWidth;								
				
				function scrollnews(spazio, tempo){
					$strip.animate({left: '-='+ spazio}, tempo, "linear", function(){$strip.css("left", containerWidth); scrollnews(totalTravel, defTiming);});
				}
				
				$('#controller').click(function(){
						if($('#controller').hasClass("stop")){
						$strip.stop();
						jQuery(this).toggleClass("play");
						jQuery(this).toggleClass("stop");
					}else{
						var offset = jQuery(this).offset();
						var residualSpace = offset.left + stripWidth;
						var residualTime = residualSpace/settings.travelocity;
						scrollnews(residualSpace, residualTime);
						jQuery(this).toggleClass("play");
						jQuery(this).toggleClass("stop");
					}
				});
				
				function play(){
					var offset = jQuery(this).offset();
					var residualSpace = offset.left + stripWidth;
					var residualTime = residualSpace/settings.travelocity;
					scrollnews(residualSpace, residualTime);
				}	

				scrollnews(totalTravel, defTiming);	
				//stop();
				//playCon();
				
		});	
};