So you would like a facility to page through the photos in the one pop-up, rather than having to close the pop-up then re-open the next image in a new pop-up window?
Say you have a gallery with 20 photos, I click on photo 5, The popup should have, not only the big version of photo 5, but a 'back' link that would take me to the big version of photo 4 and a forward link to take me to the big version of photo 6 without having to close the window.
Do I understand the problem correctly?
If so, here's what I'd do:
On the main page -
▶ Set up an array of all the sources to the big photos:
[tt]var bigPhotoArray = new Array("images/bigPhoto1.jpg","images/bigPhoto2.jpg","images/bigPhoto2.jpg" ... ... ,"images/bigPhoto20.jpg"

;[/tt]
▶ Define a variable to hold the currently clicked photo:
[tt]var currentPhoto = 0;[/tt]
▶ Create a function to set that varible based on it's argument:
[tt]function setCurrentPhoto(intPhotoNumber){
currentPhoto = intPhotoNumber;
}[/tt]
▶ Set each of the links around the thumbnails to call this function as part of the [tt]onclick[/tt] attribute:
[tt]<a href="images/bigPhoto1.jpg" onclick="setCurrentPhoto(0);DoPopupCode();">[/tt]
In the popup page code -
▶ Get the source for the image to display by referencing the currentPhoto variable and using it as a subscript for the photo array:
[tt]var imgSource = opener.bigPhotoArray[opener.currentPhoto];[/tt]
▶ Use this to set the source of the image:
[tt]document.getElementById("MyBigImageID"

.src = imgSrc;[/tt]
▶ Set up a couple of functions which just either increment or decrement the value of [tt]currentPhoto[/tt] then refresh the image for the forward / back buttons:
[tt]function goBack(){
if(opener.currentPhoto > 0){
opener.currentPhoto = opener.currentPhoto - 1;
var imgSource = opener.bigPhotoArray[opener.currentPhoto];
document.getElementById("MyBigImageID"

.src = imgSrc;
}
}
function goForward(){
if(opener.currentPhoto < (opener.bigPhotoArray.length - 2)){
opener.currentPhoto = opener.currentPhoto + 1;
var imgSource = opener.bigPhotoArray[opener.currentPhoto];
document.getElementById("MyBigImageID"

.src = imgSrc;
}
}[/tt]
Hope this is what you're after.
Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.