var newWindow = null;
function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}
function popUpWin(url, winName, strWidth, strHeight){
	closeWin();
	var tools="width="+strWidth+",height="+strHeight+",left=0,top=0,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=no,toolbar=no";
	newWindow = window.open(url, winName, tools);
	newWindow.focus();
}
function openPictureWindow(imageName,imageWidth,imageHeight,alt) {  // v4.01
	if (imageWidth < 310) {
		var winWidth = 360;
	} else {
		var winWidth = imageWidth + 30;
	}
	var winHeight = imageHeight + 40;
	newWindow = window.open("","newWindow","width="+winWidth+",height="+winHeight+",scrollbars=no,resizable=1,,left=0,top=0");
	newWindow.document.open();
	newWindow.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n');
	newWindow.document.write('<html xmlns="http://www.w3.org/1999/xhtml">\n');
	newWindow.document.write('<head>\n');
	newWindow.document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n');
	newWindow.document.write('<title>'+alt+'</title>\n');
	newWindow.document.write('<link href="/pictures.css" rel="stylesheet" type="text/css" />\n');
	newWindow.document.write('</head>\n');
	newWindow.document.write('<body onBlur="self.close()">\n'); 
	newWindow.document.write('<div id="wrap">\n');
	newWindow.document.write('<p><img src="'+imageName+'" width="'+imageWidth+'" height="'+imageHeight+'" alt="'+alt+'" /></p>\n');
	newWindow.document.write('<p>'+alt+'</p>\n');
	newWindow.document.write('</div>\n');
	newWindow.document.write('</body>\n');
	newWindow.document.write('</html>\n');
	newWindow.document.close();
	newWindow.focus();
}
