// photo_gallery_2.js - javascript for presentation of photos - all one type

var mtmax = 6;
var mmax = 40;
var mmore = true;
var mblock = 1;

// this routine displays a sequence of thumbnail pics on the LHS
// the first pic displayed is pointed at by nstart
// ntmax is the maximum number of spaces available
// nmax is the maximum number of thumbnails of this type
// n pics are displayed followed by blanks if there are not enough to fill the available spaces

function showThumbsm ()
   {
   var m, mii;
   if (!mmore) mblock = 0;
//alert('mblock='+mblock);
   var mn = mblock + 1;
   var mstart = ((mn-1) * mtmax) + 1;
   if (mstart > mmax)
      {
      m = 0;
      details.location = "gallery_2/pm_msg1.html";
      mmore = false;
      }
   else
      {
      m = mmax - mstart + 1;
      if (m > mtmax) { m = mtmax; }
      details.location = "gallery_2/pm_msg0.html";
      mmore = true;
      }
   mblock++;
   for (var mi=1; mi<=mtmax; mi++)
      {
      if (mi <= m)
         {
         mii = mstart + mi - 1;
         eval ('document.gm' + mi + '.src = "gallery_2/pmt_pic' + mii + '.jpg"');
         }
      else { eval ('document.gm' + mi + '.src = "gallery_2/pmt_pic00.gif"'); }
      }
   return false;
   }

// this routine displays the large picture on the RHS
// it relies on the current type (encoded in typechar) and is passed the id

function showPicm (mid)
   {
   var n = (mblock-1) * mtmax + Math.abs(mid);

   if (n > 0 && n <= mmax)
      {
      var s = 'gallery_2/pm_pic' + n + '.jpg';
      document.bigpicm.src = s;
      var t = 'gallery_2/pm_pic' + n + '.html';
      details.location = t;
      }
   return false;
   }

