newwinopened=null;

table_cellspacing = 8;
table_cellpadding = 8;
thumbMaxSize = 150;

dir = 'Images';
dirThumbs = dir + 'Thumbs/';
ext = '.jpg';

currentImg = new Image;

cols_800x600 = 4;
cols_1024x768 = 5;
cols_1280x1024 = 7;

if (screen.width<=800) {colNmbr = cols_800x600}
else
 { if (screen.width<=1024) {colNmbr = cols_1024x768}
    else{colNmbr = cols_1280x1024}
 };

//________________________________________________________________________________


function PhotoTableStart()
{

 tableWidth = (thumbMaxSize+2*table_cellpadding+table_cellspacing)*colNmbr + table_cellspacing;

 document.writeln('<table cellspacing="' + table_cellspacing + '" cellpadding="' + table_cellpadding + '" border="0" width="' + tableWidth + '">');

};

//________________________________________________________________________________


function showPhoto(id_photo)
{
  var x=50;
  var y=50;
  
  var corr = 100;
  var corrText = 50;
  
//  currentImg.src = dir + photo[0] + ext;

// размеры окна:
//  var w=600;
//  var h=400;
  var w = 500;
  var h = 530;

  var x = (screen.availWidth-w)*0.5;
  var y = (screen.availHeight-h)*0.5;
  
  x=100;
  y=100;
   
  if (newwinopened!=null) {newwinopened.close()}; 
  
  newwinopened = window.open('large_photo.php?n='+id_photo,'photo','width='+w+',height='+h+',top='+y+',left='+x+',status=0,toolbar=0,menubar=0,resizable=1,location=0,directories=0,scrollbars=1');
/*
  setTimeout('w=dir',1000);

  newwinopened.document.writeln('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><title>Фотоархив</title><style type="text/css">body,td {font-family: Arial, Helvetica, sans-serif; font-size: 9pt}</style></head><body><div align="center">');
  newwinopened.document.writeln('<img src="' + dir + photo[0] + ext + '"><p>'); 
  newwinopened.document.writeln(photo[1] + '</div></body></html>');
*/

};

// __________________________________________________________________________________________________

function sh(id,displ)
// для показа/скрытия элемента с указанным ID
{
  m = document.getElementById(id);
  m.style.display = displ;
};


