function tbnext(button,iImageRef,iLastImage,imgArray,capId,capArray,picnumId,oftxt) { 
   var iUse = null;
   iImage = eval(iImageRef);
   iImage++;
   if (iImage > iLastImage)
      iImage = 0;
   iUse = iImage;
   newindex = iImageRef + " = " + iImage;
   eval(newindex);
   thePix = "document." + button + ".src = " + imgArray + "[iUse].src";
   eval(thePix);
   theCap = "caption = " + capArray + "[iImage]";
   eval(theCap);
   thePicnum = "picnum = '" + (iImage+1) + " " + oftxt + " " + (iLastImage+1) + "'";
   eval(thePicnum);
   if (document.getElementById) document.getElementById(capId).innerHTML= caption;
   if (document.getElementById) document.getElementById(picnumId).innerHTML= picnum;
}

function tbprevious(button,iImageRef,iLastImage,imgArray,capId,capArray,picnumId) { 
   var iUse = null;
   iImage = eval(iImageRef);
   iImage--;
   if (iImage < 0)
      iImage = iLastImage;
   iUse = iImage;
   newindex = iImageRef + " = " + iImage;
   eval(newindex);
   thePix = "document." + button + ".src = " + imgArray + "[iUse].src";
   eval(thePix);
   theCap = "caption = " + capArray + "[iImage]";
   eval(theCap);
   thePicnum = "picnum = '" + (iImage+1) + " of " + (iLastImage+1) + "'";
   eval(thePicnum);
   if (document.getElementById) document.getElementById(capId).innerHTML= caption;
   if (document.getElementById) document.getElementById(picnumId).innerHTML= picnum;
}



