Panning image effect

I am using the panning image effect from the URL below:

http://www.kirupa.com/developer/flash8/interactive_image_pan.htm

I am using it on this site: http://www.alexconner.co.uk/union_42/union42.html

The problem i have is that I only want the image to start panning left and right at the point the mouse reaches the edge of the table. At the moment you get movement no matter where you are on the screen. Is this possible?