var newWindow;

function display(strImg,strCap) {
  var newContent = "";
  newContent += "<html>\n<head>\n<link rel='stylesheet' type='text/css' href='style.css'>\n<title>Image Viewer</title>\n</head>\n";
  newContent += "<body marginheight='0' marginwidth='0' style='margin-top:0; margin-left:0; margin-right:0;' onload='setSize()'>\n";
  newContent += "<p align='center'><br /><a href='javascript:self.close();' style='color:rgb(0,0,0);text-decoration:none;'><img title='" + strCap + "' alt='" + strCap + "' src='images/" + strImg + "' style='border:2px solid rgb(0,0,0);' name='objImage' /><br />";
  newContent += "close window</a></p>\n";
  newContent += "<script language='JavaScript' type='text/javascript'>\n function setSize(){\n var intW=document.objImage.width + 70; \n var intH=document.objImage.height + 100;\n";
  newContent += "if (document.layers) { intH -= 30; intW -= 30; } \n";
  newContent += "if (intW > screen.width){ \n intW = screen.width - 50; \n } \n if (intH > screen.height) { \n intH = screen.height - 65; \} \n"
  newContent += "self.resizeTo(intW,intH);\n}";
  newContent += "<\/script></body>\n</html>";
  if (!newWindow || newWindow.closed) {
    newWindow = window.open("","", "top=0,left=0,height=10,width=10,toolbar=0,menubar=0,resizable=1,scrollbars=1");
    if (!newWindow.opener) {
      newWindow.opener = window;
    }

    newWindow.document.write(newContent);
    newWindow.document.close();
  }else{
    newWindow.focus();
    //newWindow.resizeTo(550,5);
    newWindow.document.open();
    newWindow.document.write(newContent);
    newWindow.document.close();
  }
}
