var imageWnd;

function showImage(name, width, height) {
  if (imageWnd) {
  	imageWnd.close();
  }
  var wndWidth = width + 44;
  var wndHeight = height + 44;
  var x = (window.screen.width - wndWidth) / 2;
  var y = (window.screen.height - wndHeight) / 2;
  imageWnd = window.open("image.htm?img=" + name, "imageWnd", "width=" + wndWidth + ",height=" + wndHeight + ",toolbar=0,status=0,menubar=0,location=0,directories=0,left=" + x + ",top=" + y + ",screenX=" + x + ",screenY=" + y);
  imageWnd.focus();
}