The document.target.src throws an error. I didn't test it, I've just updated the code here, but now that I've tested on my machine, it works; so here's what you need to change in your code:
#1: give an ID to each image placeholder. you can use the name for the ID too ( so it will look like this: <img name="mainimage" id="mainimage" src="1.gif">)
#2 change the function to this:
Code:
<script type="text/javascript">
function changeImage(filename, target)
{
//document.target.src = filename;
document.getElementById(target).src = filename;
}
</script>