
smallSizes = new Array(77,77);
mediumSizes = new Array(230,150);
pageName = 'photos.htm';
scriptName = 'photos.js';
countX = 1;
countY = 7;

// sections: name, small images path, medium images path, big images path
// images: name, src, big width, big height
var arImages = new Array(
  new Array('Commercial','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
      new Array('Photo 1','9538471-R01-007.jpg',267,400),
      new Array('Photo 2','9538471-R01-011.jpg',599,400),
      new Array('Photo 3','9538471-R02-014-5A.jpg',267,400),
      new Array('Photo 4','9538471-R02-050-23A.jpg',599,400),
      new Array('Photo 5','IMG_0010.jpg',600,400),
      new Array('Photo 6','IMG_0013.jpg',267,400),
      new Array('Photo 7','IMG_0014.jpg',267,400),
      new Array('Photo 8','9538471-R01-002.jpg',267,400),
      new Array('Photo 9','IMG_0014sm.jpg',267,400),
      new Array('Photo 10','IMG_0019.jpg',600,400),
      new Array('Photo 11','IMG_0023.jpg',267,400),
      new Array('Photo 12','Multifamily.jpg',598,400),
      new Array('Photo 13','SCAN_2_1.jpg',500,400)
    )
  ),

  new Array('Residential','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
      new Array('Photo 1','6_.jpg',533,400),
      new Array('Photo 2','8_dsc00248.jpg',533,400),
      new Array('Photo 3','APGHouse.jpg',268,400),
      new Array('Photo 4','DSC00259.jpg',533,400),
      new Array('Photo 5','DSC00271.jpg',533,400),
      new Array('Photo 6','DSC00274.jpg',533,400),
      new Array('Photo 7','DSC00353.jpg',533,400),
      new Array('Photo 8','2002_01_A-copy.jpg',504,400),
      new Array('Photo 9','DSC00354.jpg',533,400),
      new Array('Photo 10','DSC00355.jpg',533,400),
      new Array('Photo 11','duff-1-05.jpg',294,400),
      new Array('Photo 12','duff-1-07b.jpg',230,150),
      new Array('Photo 13','duff-1-08.jpg',391,400),
      new Array('Photo 14','duff-1-09x.jpg',598,400),
      new Array('Photo 15','duff-1-10x.jpg',602,400),
      new Array('Photo 16','duff-1-11x.jpg',515,400),
      new Array('Photo 17','duff-1-14x.jpg',381,400),
      new Array('Photo 18','duff-1-15.jpg',324,400),
      new Array('Photo 19','duff-2-01.jpg',327,400),
      new Array('Photo 20','duff-2-02.jpg',268,400),
      new Array('Photo 21','duff-2-03x.jpg',502,400),
      new Array('Photo 22','duff-2-05.jpg',388,400),
      new Array('Photo 23','duff-2-08x.jpg',293,400),
      new Array('Photo 24','duff-3-01x.jpg',493,400),
      new Array('Photo 25','duff-3-02.jpg',574,400),
      new Array('Photo 26','duff-3-03x.jpg',322,400),
      new Array('Photo 27','duff-3-04.jpg',511,400),
      new Array('Photo 28','duff-3-05x.jpg',501,400),
      new Array('Photo 29','duff-3-06x.jpg',398,400),
      new Array('Photo 30','duff-3-07.jpg',395,400),
      new Array('Photo 31','page-15-16.jpg',574,400),
      new Array('Photo 32','ParadeShot-(10).jpg',533,400),
      new Array('Photo 33','ParadeShot-(11).jpg',300,400),
      new Array('Photo 34','ParadeShot-(15).jpg',533,400),
      new Array('Photo 35','ParadeShot-(16).jpg',533,400)
    )
  ),

  new Array('Outside Structures','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
      new Array('Photo 1','arch.jpg',719,400),
      new Array('Photo 2','Arch2.jpg',533,400),
      new Array('Photo 3','DSC00358.jpg',533,400),
      new Array('Photo 4','DSC00366.jpg',533,400),
      new Array('Photo 5','Fountain.jpg',533,400),
      new Array('Photo 6','LivingRoom_X.jpg',510,400),
      new Array('Photo 7','Arch&Foyer.jpg',533,400)
    )
  ),

  new Array('Fireplaces','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
      new Array('Photo 1','DSC00364.jpg',533,400),
      new Array('Photo 2','duff-1-06.jpg',312,400),
      new Array('Photo 3','DSC00182.jpg',300,400)
    )
  ),

  new Array('Chimneys','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
      new Array('Photo 1','DSCF0104.jpg',533,400),
      new Array('Photo 2','DSC00275.jpg',300,400)
    )
  ),

  new Array('Wine Cellar','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
      new Array('Photo 1','duff-1-12.jpg',267,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]);
}
