  function popup (popBody, caption, width, height) {
  var windowTop = 5;
  var windowLeft = 5;
  var defaultWidth = 800;
  var defaultHeight = 600;
  var defaultScrollbars = "yes";
  var defaultResize = "yes";
  var onLoseFocusExit = false;
  var onMouseClick = true;
  var undefined;
  var Options = "width=" + defaultWidth + ",height=" + defaultHeight + ",top=" + windowTop + ",left=" + windowLeft + ", scrollbars=" + defaultScrollbars + ", resizable=" + defaultResize;
  var myScript = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n" +
    "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n" +
    "<head>\n" +
    "<title>" + caption + "\</title>\n" +
    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n" +
    "<meta http-equiv=\"Content-Language\" content=\"en\">\n" +
    "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n" +
    "<script language=\"JavaScript\" type=\"text/javascript\">\n" +
	"function window_onload()\n" +
	"{\n" +
	"imgw = " + width + "+17;\n" +
	"imgh = " + height + "+5;\n";
 if (navigator.appName.indexOf("Netscape") != -1) {
    myScript = myScript +  "if(screen.width < imgw) imgw = screen.width-20;"+
	"if(screen.height < imgh) imgh = screen.height-80;"+
	"  window.innerHeight = imgh;\n  window.innerWidth = imgw;\n"
  }
  else if (navigator.appName.indexOf("Opera") != -1) {
    myScript = myScript +  "if(screen.width < imgw) imgw = screen.width-15;"+
	"if(screen.height < imgh) imgh = screen.height-115;"+
	"  window.resizeTo (imgw, imgh+50);\n"
  }
  else if (navigator.appName.indexOf("Microsoft") != -1) {
    myScript = myScript + "if(screen.width < imgw) imgw = screen.width;"+
	"if(screen.height < imgh) imgh = screen.height;"+
	"  window.resizeTo (imgw+12, imgh+55);\n"
  }
  else {
 myScript = myScript + "  window.resizeTo (w+14, h+34);\n"
 }
	myScript = myScript + "}\n" +
/* "function resizewindow () {\n" +
 "  var doc = document.getElementById('tabContent');"+
    "  var width = doc.offsetWidth;\n" +
    "  var height = doc.offsetHeight;\n";
  if (navigator.appName.indexOf("Netscape") != -1) {
    myScript = myScript +  "  window.innerHeight = height;\n  window.innerWidth = width;\n"
  }
  else if (navigator.appName.indexOf("Opera") != -1) {
    myScript = myScript +  "  window.resizeTo (width+12, height+31);\n"
  }
  else if (navigator.appName.indexOf("Microsoft") != -1) {
    myScript = myScript + "  window.resizeTo (width+12, height+31);\n"
  }
  else {
 myScript = myScript + "  window.resizeTo (width+14, height+34);\n"
 }
 myScript = myScript + "}\n" + "window.onload = resizewindow();\n" +*/
    "</script>\n</head>\n" + "<body onload=\"window_onload();\"";
  if (onLoseFocusExit) {myScript = myScript + "onblur=\"window.close()\" onmousedown=\"window.close()\" ";}
  if (onMouseClick) {myScript = myScript + "onclick=\"window.close()\" ";}
  myScript = myScript + "style=\"margin: 0px; padding: 0px;\">\n" +
    "" + popBody + "" +
    "</body>\n" +  "</html>\n";
  var imageWindow = window.open ("","imageWin",Options);
  imageWindow.document.write (myScript)
  imageWindow.document.close ();
  if (window.focus) imageWindow.focus();
  return false;
}
