>>1
The only reason you would be interested in doing something like this is to stop people from highjacking your stolen content. You eill need to be more clever than that. Scripting is your privelige, and not normally secure in this way.
A common trick I see is to make put the real image as a background, and then put an invisible gif over it. That way people will right click and steal a blank gif. Or you could split the gif into sections. And I know that there are things you can do with your server to prevent hotlinking, etc.