// create popup window for images on the fly 
// script by Michael Paige (http://www.treetrybe.com/imm/)
// edited for Mac by Mark Howells (http://www.mark.ac/journal/) 

var imgWindow = new Object;
var imgWindow = null;

function popImg(thepic,w,h) {
	var specs 	= 'width=' + w + ', height=' + h;
	if (!imgWindow || imgWindow.closed) {
		//imgWindow = window.open(thepic,'',specs); 

		imgWindow = window.open('','','width=' + w + ', height=' + h + ', location=0, toolbar=0, menubar=0, directories=0, scrollbars=0, status=0, resizable=0');

		imgWindow.document.write('<?xml version="1.0" encoding="UTF-8"?\>'); 
		imgWindow.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'); 
		imgWindow.document.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">'); 
		imgWindow.document.write('<head><title>BWG &#8212; Image pop-up</title>'); 
		imgWindow.document.write('<base href="http://bigwhiteguy.com/" />'); 
		imgWindow.document.write('<style type="text/css"><!--'); 
 		
		// Works in NN4 to achieve zero margins
 		imgWindow.document.write('body {margin:-10px 0 0 -10px;padding:0}');

		// Works in real browsers to achieve zero margins
		imgWindow.document.write('html body {margin:0}'); 
		imgWindow.document.write('img {display:block;border:0}'); 
		imgWindow.document.write('\/\/--></style></head>'); 
		imgWindow.document.write('<body onblur="self.close()">'); 
		imgWindow.document.write('<div><img src="' + thepic + '" width="' + w + '" height="' + h + '" alt="" /></div>'); 
		imgWindow.document.write('</body></html>');
		imgWindow.document.close(); /*added by me*/
	/*	gowidth=(screen.width/2-(w/2))
		goheight=(screen.height/2-(h/2))
		imgWindow.moveTo(gowidth,goheight)
		imgWindow.focus() */
	}
	else {
		imgWindow.focus();
	}
}