All of the above posted examples are not comlpetely cross-browser.
I'd recommend using this:
function openImage(images, w, h) {
var windowprops = "location=no,scrollbars=no,menubar=no,toolbar=no" + ",left=300,top=100" + ",width=" + w + ",height=" + h + ";"
a = window.open("","popupimage",windowprops);
a.document.open();
a.document.write('<html><body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">');
a.document.write("<a href='javascript:window.close()'><image src='" + images + "' width=" + w + " height=" + h + " border='0' alt=''></a>"

;
a.document.write('</body></html>');
a.document.close();
}
Call it like this:
<a ... onclick="openImage('big1.gif', 120, 90)"><img scr="small1.gif" ... alt="click to see enlarged"></a>
This script works in all browsers (including old ones) and is more flexible: it opens popup window with the size equal to image size.