function popImg(imageURL,h,w,d) {
var filename;
filename="popup.asp?fileimage="+imageURL 
	var imgWin = window.open(filename,'','toolbars=no,maximize=no,resize=no,width=374,height=315,location=no,directories=no,scrollbars=auto');
	with (imgWin.document) {
		writeln('<html><head><title>Loading...</title>');
		writeln('<style type="text/css"><!-- body { margin: 0px; } --></style></head>');
		writeln('<body onload="self.focus();"><img id="pic" style="display:none" /></body></html>');
		close();		
		}
	var img = new Image();
	img.src = imageURL;
	img.onload = function() { sizeImgWin(imgWin, img) };
	}
	
function sizeImgWin(win, img) {
   	var new_w = img.width;
	var new_h = img.height;
	var old_w = self.innerWidth || document.body.offsetWidth;
	var old_h = self.innerHeight || document.body.offsetHeight;
	if (!new_w) { new_w = old_w; }
	if (!new_h) { new_h = old_h; }
	new_w -= old_w; new_h -= old_h;

	win.document.title = img.src.substring(img.src.lastIndexOf("/")+1);
	var pic = win.document.getElementById('pic');
	pic.src = img.src;
	pic.style.display = 'block';
	}



