Change the "baseURL" and filenames in the "imgList" array to match your images.
Code:
<!DOCTYPE HTML>
<html>
<head>
<title> Untitled </title>
<script type="text/javascript">
// For: http://www.codingforums.com/showthread.php?t=231925
var baseURL = 'http://www.nova.edu/hpd/otm/pics/4fun/';
var imgList = [
'11.jpg','12.jpg','13.jpg','14.jpg','15.jpg',
'21.jpg','22.jpg','23.jpg','24.jpg','25.jpg',
'31.jpg','32.jpg','33.jpg','34.jpg','35.jpg',
'41.jpg','42.jpg','43.jpg','44.jpg','45.jpg' // No comma after last entry
];
// If you have BOTH actual image and thumbnail images, could be named '11.jpg' and '_11.jpg'
// where the images with leading '_' would be the thumbnail list, you could change below at the '//'
// and remove the 'height' and 'width' designation in the HTML section for the thumbnail tags
function showMain(Info) {
document.getElementById('mainImg').src = baseURL+imgList[Info];
}
window.onload = function() {
document.getElementById('mainImg').src = baseURL+imgList[0];
for (var i=0; i<imgList.length; i++) {
document.getElementById('img'+i).src = baseURL+imgList[i];
// document.getElementById('img'+i).src = baseURL+'_'+imgList[i];
}
}
</script>
<style type="text/css">
</style>
</head>
<body>
<center>
<img src="" id="mainImg" height="200" width="175">
<p>
<script type="text/javascript">
var str = '';
for (var i=0; i<imgList.length; i++) {
str += '<img src="" id="img'+i+'" height="50" width="35" onclick="showMain(\''+i+'\')">';
// str += '<img src="" id="img'+i+'" onclick="showMain(\''+i+'\')">'; // if thumbnail images available
str += ((i % 10) == 9) ? '<br>' : ''; // optional
}
document.write(str);
</script>
</center>
</body>
</html>
Note the other optional changes you can make in the comments of the script.
Post back if you have questions.
Good Luck!