function hangpic(n) {
	var i = new Image();
	i.src = n;
	i.name = n.replace(/[\W_]/g, ' ');
	
	// compute the window width and height, and create attribute strings for them
	h = (i.height+150 >= screen.height ? screen.height-75 : i.height+50);
	w = (i.width+150 >= screen.width  ? screen.width-75 : i.width+50);
	hstring = ', height=' + h + 'px';
	wstring = ', width=' + w + 'px';

	// the window feature string; this describes the visible attributes of the newly made window
	features = 'location=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no';

	// the following describes the stylesheet rules for the new window document; the "hanging picture"
	img_style = 'img { border: solid 2px #033734; margin: 20px auto 20px auto; display: block; }';

	// a constant to define the default text for the status bar
	status_msg = '<script type=\'text/javascript\'>defaultStatus = \'click image to close window\'</script>';

	// build the window
	var win = window.open('', 'wallart', features + wstring + hstring);

	var d = win.document;
	d.open();
	d.write('<html><head><title>', n, '</title><style type=\'text/css\'>', img_style, '</style>', status_msg, '</head>');
	d.write('<body><a href=\'\' onclick=\'window.close()\'>');
	d.write('<img src=\'', i.src, '\' title=\'click image to close window\' /></a>');
	d.write('</body></html>');
	d.close();

	return true;
}

