That's a pretty old version ... 
If that's what you want to do, try this...
Code:
<html>
<head>
<SCRIPT type="text/javascript"> <!-- archaic format: LANGUAGE="JavaScript" -->
var baseURL = 'image-viewer/';
var imgList = ['','image1.jpg','image2.jpg','image3.jpg','image4.jpg'];
function changeImage(ptr) {
document.getElementById('mainimage').src = baseURL+imgList[ptr];
document.getElementById('mainimage').alt = imgList[ptr];
}
</script>
</head>
<body>
<p>
<a href="#" onclick="changeImage(1)">Image 1</a>
<a href="#" onclick="changeImage(2)">Image 2</a>
<a href="#" onclick="changeImage(3)">Image 3</a>
<a href="#" onclick="changeImage(4)">Image 4</a>
</p>
<p>
<img id="mainimage" src="image-viewer/blank.jpg" alt="blank.jpg"></p>
</body>
</html>
BTW: You should enclose your script between [ code] and [ /code] tags (without the spaces)
to make it easier to read, copy, test your programs.
Bookmarks