smallSizes = new Array(77,77);
mediumSizes = new Array(200,170);
pageName = 'photos.htm';
scriptName = 'photos.js';
countX = 5;
countY = 3;

// sections: name, small images path, medium images path, big images path
// images: name, src, big width, big height
var arImages = new Array(
  new Array('Photo Gallery','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('Photo 1','photos_01.jpg',392,400,''), 
		new Array('Photo 2','photos_02.jpg',600,400,''), 
		new Array('Photo 3','photos_03.jpg',285,230,''), 
		new Array('Photo 4','photos_04.jpg',600,400,''), 
		new Array('Photo 5','photos_05.jpg',700,312,''), 
		new Array('Photo 6','photos_06.jpg',474,400,''), 
		new Array('Photo 7','photos_07.jpg',600,400,''), 
		new Array('Photo 8','photos_08.jpg',498,400,''), 
		new Array('Photo 9','photos_09.jpg',494,400,''), 
		new Array('Photo 10','photos_10.jpg',492,400,''), 
		new Array('Photo 11','photos_11.jpg',600,400,''), 
		new Array('Photo 12','photos_12.jpg',600,400,''), 
		new Array('Photo 13','photos_14.jpg',600,400,''),
		new Array('Photo 14','photos_15.jpg',261,400,''),
		new Array('Photo 15','photos_17.jpg',260,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]);
}
