(function($){
	
	jQuery.fn.bannerMouseMove = function(settings){
		var defaults = {
			duration: 1000,
			width: 600
		}
		settings = jQuery.extend(defaults, settings);
		return this.each(function(){
		
			var panoImg   = $(this).find('img:first'),
			w         = panoImg.width(),
			panoWidth = settings.width, // this is the width of the container in pixels
			cx        = (w-panoWidth)/panoWidth,
			lastx     = 0;
			
			$(this).css({
			 width  : panoWidth,
			 height : panoImg.height(),
			 overflow : 'hidden'
			}).mousemove(function(e){
				var x = e.pageX - $(this).offset().left; // mouse x coordinate relative to the container
				if (Math.abs(lastx-x)<=1) return; // only do something if the mouse X coordinate moved more than 1 pixel
				lastx = x;
				panoImg.stop(true)
					   .animate({ marginLeft : -cx*x }, settings.duration, 'linear');
			});
		
		});
	
	}
	
})(jQuery)
