Ok, I see your point now. In your case, I would add 5 img tags to the html page. Each tag includes one image and has its own ID:
<img border="0" src="/images/image1.jpg" alt="Image1" id="image1"/>
<img border="0" src="/images/image2.jpg" alt="Image2" id="image2"/>
var images = document.getElementsByTagName("img").innerHTML;
for(var i=0; i<images.length; i++)
images[i].style.display = "none";
document.getElementById(imgID).style.display = "";
The problem here is that images and flash are embedded into the same page. You may i.e. accomplish your goal by embedding swf into a div and hide this div into the showImage function. I'm perfectly conscious that these snippets are not a solution but they may give you a start point.. Hope it helps.
// image ID depends on which image you have clicked into flash...