
smallSizes = new Array(77,77);
mediumSizes = new Array(200,170);
pageName = 'photos.html';
scriptName = 'photos.js';
countX = 4;
countY = 2;

// sections: name, small images path, medium images path, big images path
// images: name, src, big width, big height
var arImages = new Array(

  new Array('Sample Centerpieces','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
      new Array('Photo 1','balloons.jpg',149,400),
      new Array('Photo 2','bubble_bowl_with_sand_and_shells.jpg',267,400),
      new Array('Photo 3','class_year_in_balloons.jpg',700,352),
      new Array('Photo 4','floating_candles.jpg',603,400),
      new Array('Photo 5','hurricane_lamp.jpg',267,400),
      new Array('Photo 6','square_vases_with_sunflowers.jpg',241,400),
      new Array('Photo 7','tall_floating_candle_glass.jpg',174,400),
      new Array('Photo 8','tall_flower_vase.jpg',147,400)
    )
  ),

  new Array('Photo Invites','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
      new Array('Photo 1','class_photo_invite.jpg',518,400),
      new Array('Photo 2','school_photo_invite.jpg',569,400)
    )
  ),

  new Array('People Photos','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
      new Array('Photo 1','58GlendaleCandids077.jpg',502,400),
      new Array('Photo 2','78EdisonCandid001.jpg',553,400),
      new Array('Photo 3','78EdisonCandid050.jpg',530,400),
      new Array('Photo 4','88 Candid 45_resize.jpg',638,401),
      new Array('Photo 5','88 Candid 54_resize.jpg',602,400),
      new Array('Photo 6','98BreaCandids050.jpg',639,400),
      new Array('Photo 7','98BreaCandids059.jpg',559,400),
      new Array('Photo 8','98BreaCandids089.jpg',535,400)
    )
  )

)

section = getParameter(self.document.location.href, 'section');
if (isNaN(section) || (section=='') || (section<0) || (section>arImages.length))
  section = 0; 

ind = getParameter(self.document.location.href, 'ind');
if (isNaN(ind) || (ind=='') || (ind<0) || (ind>arImages[section][4].length))
  ind = 0; 

var arPreloadImages = new Array();
function preload() {
  if (arImages[section][2]!='') {
    for (i=ind;(i<(Number(ind)+Number(countX*countY))) && (i<arImages[section][4].length);i++) {
      arPreloadImages[i] = new Image(mediumSizes[0],mediumSizes[1]);
      arPreloadImages[i].src = arImages[section][2]+arImages[section][4][i][1];
    }
  }
}
  
function showImageMedium(number) {
  showImage('imagemedium',arImages[section][2]+arImages[section][4][number][1]);
  showMessage('imagemediumname',arImages[section][4][number][0]);
}

function showImageBig(number) {
  showImagePopup(scriptName,section,number,arImages[section][4][number][2],
   arImages[section][4][number][3]);
}
