// JavaScript Document
// confirm there's at least one image to zoom
function generateGallery(){
// loop for initializing thumb cells
for (i=0; i<=NewImg.length-1; i++) {
if (NewImg[i]){
// img has no thumb? assign itself
if (!(Thumbs[i])||(Thumbs[i]=="")) Thumbs[i] = NewImg[i];
document.getElementById("thumbCell_"+i).innerHTML = '
';
}
else
document.getElementById("thumbCell_"+i).style.display = 'none';
}
if (NewImg[0] && NewImg[0]!="") {
displayImage(0); // display first image
}
else {
if (document.getElementById("imageGallery"))
document.getElementById("imageGallery").style.display='none';
}
}
var current_image=0; // global var stores image being showed
function displayImage(id) {
if (id < NewImg.length) {
current_image = id; // keeps 'num id' of image showed
document.getElementById('mainImage').innerHTML = "
";
for (i=0; i < NewImg.length; i++) {
document.getElementById('thumb_'+i).className = (current_image!=i)?'thumb-off':'thumb-on';
}
}
}
// initialize the image gallery
generateGallery();