
// script to open new window with image within it

function ViewImage(ifile,ix,iy,ititle) { 
var win;
var sWidth;
var sHeight;
var NS = (document.layers) ? 1 : 0;
win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
if (NS) {
sWidth = win.innerWidth;
sHeight = win.innerHeight;
} else {
sWidth = win.document.body.clientWidth;
sHeight = win.document.body.clientHeight;
}
if(sWidth!=ix || sHeight!=iy) {
win.close();
setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"')", 250);
return;
}
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title>");
win.document.write("</head><body>");
win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px;screenX:0px;screenY:0px">');
win.document.write("<img src="+ifile+"></div></body></html>");
win.document.close();
}
   // added pop-up window code
          function makeWin(url) {
              agent = navigator.userAgent;
              windowName = "Main";
              params  = "";
                  params += "toolbar=0,";
              params += "location=0,";
              params += "directories=0,";
              params += "status=0,";
              params += "menubar=0,";
              params += "scrollbars=yes,";
              params += "resizable=yes,";
              params += "width=520,";
              params += "height=400";
              win = window.open(url, windowName , params);
                  win.focus([true]);
              if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
                  win = window.open(url, windowName , params);
                  win.focus([true]);
              }

              if (!win.opener) {
                  win.opener = window;
              }

          }

       // added pop-up window code
          function makeWin2(url) {
              agent = navigator.userAgent;
              windowName = "Main";
              params  = "";
                  params += "toolbar=0,";
              params += "location=0,";
              params += "directories=0,";
              params += "status=0,";
              params += "menubar=0,";
              params += "scrollbars=yes,";
              params += "resizable=yes,";
              params += "width=510,";
              params += "height=450";
              win = window.open(url, windowName , params);
                  win.focus([true]);
              if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
                  win = window.open(url, windowName , params);
                  win.focus([true]);
              }

              if (!win.opener) {
                  win.opener = window;
              }

          }		  

