function popupimg(tag, width, height, title) {
  LeftPosition = (screen.width) ? (screen.width - width) / 2 : 100;
  TopPosition = (screen.height) ? (screen.height - height - 30) / 2 : 100;
  settings = 'width=' + width + ',height=' + height + ',top=' + TopPosition + ', left=' + LeftPosition +
    ',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
  win = window.open("", tag.target, settings);
  win.document.write("<html><head><title>" + title + "</title>" +
    "<scrip" + "t language='JavaScript' type='text/JavaScript'>\n" +
    "document.onmousedown = function(mouseEvent) { if (!mouseEvent && document.all && (event.button == 2)) window.close() }\n" +
    "document.onmouseup = function(mouseEvent) { if (mouseEvent && (mouseEvent.which == 3)) window.close() }\n" +
    "</scri" + "pt>" +
    "</head><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>" +
    "<table cellpadding='0' cellspacing='0' border='0'><tr><td>" +
    "<img src='" + tag.href + "' border='0'></tr></td></table></body></html>");
  win.document.close();
  return false;
}

