I needed a way to make a photo display script show a photo when clicked in a new window. I didn't write the original photo display script myself but I did modify it. Including adding the popup window effect.
This is what I started with: echo "<td align=center><a href=\"$images[$i]\">$images[$i]<BR><BR><img border=0 src=\"thumbs/$thumb[$i]\"></a><BR><BR></td>";
This example would only open the image in the same browser window. So then I would have to hit the back button to return and then wait for all the pictures to be redrawn again.
This is what I came up with: echo "<td align=center><a href=\"$images[$i]\" onclick=\"window.open(this.href, 'popupwindow', 'height=500,width=655,scrollbars,resizable'); return false;\"><BR><img border=0 src=\"thumbs/$thumb[$i]\"><br /> </a></td>";
You can replace $images[$i] with your actual page or image name. And the same is true for img src.
Important Note: Figuring out the correct placement of the quotes was the hard part! Watch for the placement of quotes (")!