JavaScript: Open Image Links in Popup
The following script makes all links to images open in a popup window. No inline JavaScript required. Modern browser required (i.e. IE5+, NS 6+, Mozilla Firefox). Save into scripts directory and include on page by adding into page <head> tags:
example.html
<html>
<head>
<title>Popup Image Example</title>
<script type="text/javascript" src="scripts/imagepop.js"></script>
</head>
<body>
<p><a href="images/foo.gif" title="Foo Title" width="120" height="300">Foo</a>
| <a href="images/bar.jpg" width="140" height="280">Bar</a>
| <a href="page.html">Baz</a></p>
</body>
</html>
scripts/imagepop.js
function imagepop(url,title) {
// new window title
var contents = '<html><head><title>' + ((title)?title:'Image Popup') + '...