(function($) 
{
	jQuery.fn.scrollbg = function(options) 
	{
		var defaults = {
			speed: 1
		};

		options = $.extend(defaults, options);
		
		return this.each(function() 
		{
			
			var scrolly = $(this);
			var offset = 0;
			var backgroundWidth = 1024;	
	
			var doScroll = function()
			{				
				offset = (offset < 1) ? offset + (backgroundWidth - 1) : offset - 1;

				$(scrolly).css("background-position", offset + "px");			
			};
			
			setInterval(doScroll, options.speed * 25 );

		});
	};
})(jQuery);