
smallSizes = new Array(66,66);
mediumSizes = new Array(280,176);
pageName = 'gallery.htm';
scriptName = 'photos.js';
countX = 2;
countY = 4;

// sections: name, small images path, medium images path, big images path
// images: name, src, big width, big height
var arImages = new Array(
  new Array('','images/small/','images/medium/','images/big/',
    new Array(
      new Array('Photo 1 Before','1.jpg',400,300),
      new Array('Photo 2 Before','2.jpg',400,300),
      new Array('Photo 3 Before','3.jpg',400,229),
      new Array('Photo 4 Before','4.jpg',400,250),
      new Array('Photo 1 After','5.jpg',400,300),
      new Array('Photo 2 After','6.jpg',400,300),
      new Array('Photo 3 After','7.jpg',378,200),
      new Array('Photo 4 After','8.jpg',400,241),
      new Array('Photo 5 Before','9.jpg',395,232),
      new Array('Photo 6 Before','10.jpg',397,246),
      new Array('Photo 7 Before','11.jpg',400,300),
      new Array('Photo 8 Before','12.jpg',400,300),
      new Array('Photo 5 After','13.jpg',400,227),
      new Array('Photo 6 After','14.jpg',400,224),
      new Array('Photo 7 After','15.jpg',400,300),
      new Array('Photo 8 After','16.jpg',400,300),
      new Array('Photo 9 Before','17.jpg',400,300),
      new Array('Photo 10 Before','18.jpg',400,300),
      new Array('Photo 11 Before','19.jpg',400,300),
      new Array('Photo 12 Before','20.jpg',400,300),
      new Array('Photo 9 After','21.jpg',400,300),
      new Array('Photo 10 After','22.jpg',400,300),
      new Array('Photo 11 After','23.jpg',400,300),
	  new Array('Photo 12 After','24.jpg',400,300),
	  new Array('Photo 13 Before','BHome1.jpg',400,300),
      new Array('Photo 14 Before','BHome2.jpg',400,300),
      new Array('Photo 15 Before','BKitchen1.jpg',400,300),
      new Array('Photo 16 Before','BKitchen2.jpg',300,400),
      new Array('Photo 13 After','AHome2.jpg',400,300),
      new Array('Photo 14 After','AHome1.jpg',300,400),
      new Array('Photo 15 After','AKitchen1.jpg',400,300),
      new Array('Photo 16 After','AKitchen2.jpg',300,400),
      new Array('Photo 21 Before','BKitchen3.jpg',400,300),
      new Array('Photo 22 Before','AHall1.jpg',300,400),
      new Array('Photo 23 Before','ADinning1.jpg',400,300),
      new Array('Photo 21 After','ABath1.jpg',300,400),
      new Array('Photo 22 After','AKitchen3.jpg',400,300),
      new Array('Photo 23 After','AHall2.jpg',300,400),
      new Array('Photo 27 After','ALiving1.jpg',400,300),
	  new Array('Photo 28 After','ABath2.jpg',300,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]);
}
