jQuery.fn.extend(
{
	drag: function(params)
	{
		var jQ = jQuery;
		return this.each(function()
		{
			var clicked = false;
			var start_y = 0;	
			var drag_div = this;
			var div_height = 488;
			
			$(this).mousemove(function(e)
			{
				var stoff = $(this).css('background-image');
				stoff = stoff.replace(/url\(/, "");
				stoff = stoff.replace(/\)/g, "");
				stoff = stoff.replace(/\"/g, "");		
				var newImg = new Image();
				newImg.src = stoff;
				
				var imgy = newImg.height;
				var result = stoff.search(/stoffe.+/);
				
				if (result == -1)
				{
					var bg = $(this).css('backgroundPosition');				
					bg = bg.replace("px", "").replace("px", "").split(" ");
					var toppos = parseInt(bg[1]);
					var mouse_y = Math.round(e.pageY - $(this).eq(0).offset().top - start_y);
					var y = toppos + (mouse_y);
					
					start_y = Math.round(e.pageY - $(this).eq(0).offset().top);
					
					if (y > 0) y=0;
					if (y < (div_height - imgy)) y=-imgy + div_height;
					$(drag_div).css('backgroundPosition', "0px " + y + "px");
				}
			});
	    });
	}
});