function newWin(foto)
  {
  nImage = new Image();
  nImage.src = foto;
  width = screen.width;
  height = screen.height;
  i = nImage.width;
  j = nImage.height;
  k = 'no';
    if (i > screen.width)
      {
        k = 'yes';
       }
     if (j > screen.height)
       {
         k = 'yes';
       }
     if (width == 0 || height == 0)
       {
         i = 640;
         j = 480;
         k = 'yes';
       }
  myWin= open("", "_blank", 
  "width="+i+",height="+j+",status=no,toolbar=no,menubar=no,scrollbars="+k+",resizable="+k+"");
  myWin.document.open();
  myWin.document.write("<html><head><title>Увеличенное изображение</title></head><body bgcolor='white' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' OnClick='javascript:window.close();' OnLoad=self.resizeTo(document['pics'].width+10,document['pics'].height+29);self.focus();><p align='center'><img border='0' src='");
  myWin.document.write(foto);
  myWin.document.write("' name='pics'></p></body></html>");
  myWin.document.close();}