<!--
PWin = null;
//width should exceed widest image in gallery, and height should exceed tallest
PWinHeight = 500;
PWinWidth = 500;
//make sure this one is kept synchronised with the page margins in gallery_item.asp
PWinMargin = 5;

function pictureOpen(pcat,pname)
{
  if (PWin)
    PWin.close();

  PWin = window.open('gallery_item.asp?c='+pcat+'&n='+pname+'&resize=true','PWin','width='+PWinWidth+',height='+PWinHeight+',scrollbars=0,toolbars=0,resizable=1');
  PWin.focus();
  return false;
}

function FitPic() {
//iWidth and iHeight are window height and width specified in gallery.js, minus page margins
  iWidth = PWinWidth - (2 * PWinMargin);
  iHeight = PWinHeight - (2 * PWinMargin);
  iWidth = document.images[0].width - iWidth;
  iHeight = document.images[0].height - iHeight;
  window.resizeBy(iWidth, iHeight);
  self.focus();
};
//-->
