function bigPhoto(indx, hght, wdth, img_tag, date_str, desc_str) {
  win_width = wdth + 20;
  win_heght = hght + 200;

  if ( wdth == 0 && hght == 0) {
    win_width = 520;
    win_heght = 600;
  }

  // ALT
  alt = 'Фото пресс-службы Президента России';
  if (img_tag.indexOf('alt="') >= 0) {
    alt = img_tag.substring(img_tag.indexOf('alt="')+5);
    alt = alt.substring(0, alt.indexOf('"'));
  }

  now = new Date();
  newWindow=window.open('',now.getTime(),'width=' + win_width + ', height=' + win_heght );
  newWindow.document.writeln('<html><head>');
  newWindow.document.writeln('<title>' + alt + '</title>');
  newWindow.document.writeln('<link href="/style.css" rel="stylesheet">');
  newWindow.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">');
  newWindow.document.writeln('</head>');
  newWindow.document.writeln('<body bgcolor=' + window.document.bgColor + ' leftmargin=10 rightmargin=10 topmargin=10 marginwidth=0 marginheight=0>');
  newWindow.document.writeln('<center>');
  newWindow.document.writeln('<table width=100% cellspacing=0 cellpadding=0 border=0>');
  newWindow.document.writeln('<tr><td>' + img_tag + '<div align=right class=photo_text>' + alt + '</div></td></tr>');
  newWindow.document.writeln('<tr><td><br>');
  newWindow.document.writeln('  <SPAN class="time">' + date_str + '</SPAN>');
  newWindow.document.writeln('  <br><br>' + desc_str);
  newWindow.document.writeln('</td></tr>');
  newWindow.document.writeln('</table>');
  newWindow.document.writeln('</center>');
  newWindow.document.writeln('</body></html>');
}


function getImgTag(file, alt) {
  return '<IMG src="' + file + '" border=1 alt="' + alt + '" />';

}

function getImgTagWSize(file, alt,  hght, wdth) {
  return '<IMG src="' + file + '" border=1 alt="' + alt + '" HEIGHT="' + hght + '"  WIDTH="' + wdth + '" />';
}

function getFileTag(file_url, ext, size) {
  return '<A href="' + file_url + '" target="_blank"><IMG border=0 hspace=1 vspace=3 align=absmiddle alt="изображение высокого разрешения" SRC="/images/file.gif" height=10 width=6 class=nob><SPAN class=photo_text> ' + ext + ' (' + size + ' kb)</SPAN></A>';
}

function bigPhotoGallery(indx, hght, wdth, img_tag, date_str, desc_str, file_str) {
  win_width = wdth + 20;
  win_heght = hght + 200;

  if (wdth == 0 && hght == 0) {
    win_width = 520;
    win_heght = 600;
  }

  // ALT
  alt = 'Фото пресс-службы Президента России';
  if (img_tag.indexOf('alt="') >= 0) {
    alt = img_tag.substring(img_tag.indexOf('alt="')+5);
    alt = alt.substring(0, alt.indexOf('"'));
  }

  now = new Date();
  newWindow=window.open('',now.getTime(),'width=' + win_width + ', height=' + win_heght );
  newWindow.document.writeln('<html><head>');
  newWindow.document.writeln('<title>' + alt + '</title>');
  newWindow.document.writeln('<link href="/style.css" rel="stylesheet">');
  newWindow.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">');
  newWindow.document.writeln('</head>');
  newWindow.document.writeln('<body bgcolor=' + window.document.bgColor + ' leftmargin=10 rightmargin=10 topmargin=10 marginwidth=0 marginheight=0>');
  newWindow.document.writeln('<center>');
  newWindow.document.writeln('<table width=100% cellspacing=0 cellpadding=0 border=0>');
  newWindow.document.writeln('<tr><td>' + img_tag + '<div align=right class=photo_text>' + alt + '</div></td></tr>');
  newWindow.document.writeln('<tr><td><br>');
  newWindow.document.writeln('  <!--A href="#" onclick="self.print();">');
  newWindow.document.writeln('  <IMG src="/images/print_ver.gif" align="right" width="16" height="14" border="0" alt="распечатать" class="nob"></A-->');
  newWindow.document.writeln('  <SPAN class="time">' + date_str + '</SPAN>');
  newWindow.document.writeln('  <br><br>' + desc_str + '<br><br>' + file_str);
  newWindow.document.writeln('</td></tr>');
  newWindow.document.writeln('</table>');
  newWindow.document.writeln('</center>');
  newWindow.document.writeln('</body></html>');
  //onclick="javascript:window.print(); return false;"
}
