If it could be both in bigger pictures I am not sure it can be done using simple JavaScript but may need a little more complicated one.

Have 2 Hidden Divs. One for Image and one for Flash and when clicked show the right one at the right place.