How to link to images:

<a href="required/big.jpg" onclick="'required/image_viewer.htm?big.jpg',null,1); return false;">
<img src="required/small.jpg" border="0" alt="click"></a>

In this part of the above code "'required/image_viewer.htm?big.jpg',null,1); you need to change the query string (after the ?) to point to the file you want to open relative to the image_viewer.htm file.

Code for image_viewer.htm

<title>Image Viewer</title>

<script language="javascript" type="text/javascript">

document.oncontextmenu = IE; //IE
if (!document.all) { //NN & Mozilla
document.captureEvents(Event.MOUSEDOWN);document.onclick = NN;

function IE() { //IE
if (document.all) {
return false;

function NN(e) { //NN & Mozilla
if (e.which==2||e.which==3) {
return false;

function resizePage() {
if (!window.innerWidth) {
else {
window.innerWidth = document.images[0].width;
window.innerHeight = document.images[0].height;

<body style="margin:0px;" onload="resizePage();">
<script language="javascript" type="text/javascript">

pic = unescape(;
document.write ('<img name="myimg" src="'+pic+'" border="0" galleryimg="no">');



Tested in: IE6, Opera 7, NN4.7, NN7, and Mozilla 1.2.
Works in: IE6, NN7, and Mozilla 1.2.
Doesn't work in: Opera 7, NN4.7

Copyright© 2003, Infinity Web Design