   function ImageView(title, src, text, orient) {
      img = new Image();
      img.src = src;

      if(orient == null) orient = "vert";
      if((orient != "vert") && (orient != "horiz")) orient == "vert";
      if (src == "gallery/_02.jpg") orient = "horiz";

      // orient = (img.width > img.height)?"horiz":"vert";
      width = (orient == "vert")?"525":"660";
      height = (orient == "vert")?"651":"525";
      bgimage = "img/gallery"+((orient == "vert")?"2":"")+".gif";

      bodyleft = (orient == "vert")?"90":"25";
      bodytop = (orient == "vert")?"25":"25";
      ptop = (orient == "vert")?"15":"0"; ;
      pleft = (orient == "vert")?"40":"0";


      win = window.open('','','top=0,left=' +
             (screen.width/5) + ',width='+width+',height='+height+','+
             'status=no,toolbar=no,menubar=no,scrollbars=no');

      win.document.write("<html><html><head><title>" + title +
                         "</title></head><body background='" + bgimage + "' style='background-repeat:no-repeat;margin-left:" + bodyleft + "px; margin-top:" + bodytop + "px; background-color:#e98400;'><img src='" + img.src +
                         "' border='0' style='cursor:hand' onclick='{window.close();}' alt='Закрыть окно' name='img'>"+
                         "<p style='font-size:12px;font-family:verdana;color:#333333;padding-left:" + pleft + "px; padding-top:" +
                         ptop + "px;'>"+text+"</p>"+"</body></html>");

      win.focus();
   }