function imgwin(Imgn,Cap_str) // get width of large image that was pre loaded above
            {
             img_w=eval(Imgn+".width")
             if(img_w<100)
               {img_w=100} 
             img_w=img_w+40
             img_h=eval(Imgn+".height") // get height of large image that was pre loaded above
             if(img_h<100)  // cannot open window less than 100  by 100 pixels
               {img_h=100}
             img_h=img_h+100
             picgif=eval(Imgn+".src")  // build image source 
             if(ImgWin.open)  //  if the window is open close it
               {ImgWin.close()}
             if (window.screen)
   				{
       			var avht = screen.availHeight - 30;
       			var avwd = screen.availWidth - 10;
       			var xcen = (avwd - img_w) / 2;
       			var ycen = (avht - img_h) / 2;
       			var args = ",left=" + xcen + ",screenX=" + xcen;
       			args += ",top=" + ycen + ",screenY=" + ycen + ",resizable=yes";    
   				} 

             WinProps="width="+img_w+",height="+img_h+",location=no,status=no,directories=no,toolbar=no,scrollbars=no,menubar=no,resize=no,"+args
             ImgWin=window.open("","winimg",config=WinProps);
             ImgWin.document.write("<HTML>")
             ImgWin.document.write("<HEAD><TITLE>Large Image View</TITLE>")
             ImgWin.document.write("<link rel='stylesheet' href='template.css' type='text/css'></HEAD>")
             ImgWin.document.write("<BODY>")
             ImgWin.document.write("<CENTER><IMG SRC="+picgif+" BORDER='0' HSPACE=2 VSPACE=2><BR></CENTER>")
             ImgWin.document.write("<div class='popwintext'>"+Cap_str+"</div><br><br>")
             ImgWin.document.write("<div class='popwin'><A HREF='#' onClick='self.close()'>Close window</A><br><br><a href='javascript:window.print()'>Print</a></div>")
             ImgWin.document.write("</BODY>")
             ImgWin.document.write("</HTML>")    
             ImgWin.document.close()
             ImgWin.focus()
            }
