smallSizes = new Array(77,77);
mediumSizes = new Array(200,170);
pageName = 'Photo_Imaging.html';
scriptName = 'Photo_Imaging.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('Before & After','before_and_after','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','1.jpg',480,360),
	  new Array('Photo 2','2.jpg',480,360),
	  new Array('Photo 3','3.jpg',480,360),
      new Array('Photo 4','4.jpg',480,360),
      new Array('Photo 5','5.jpg',480,360),
      new Array('Photo 6','6.jpg',480,352),
      new Array('Photo 7','7.jpg',480,360),
      new Array('Photo 8','8.jpg',480,360),
      new Array('Photo 9','9.jpg',480,360),
      new Array('Photo 10','10.jpg',428,337),
      new Array('Photo 11','11.jpg',480,360),
      new Array('Photo 12','12.jpg',480,360),
      new Array('Photo 13','13.jpg',480,360),
      new Array('Photo 14','14.jpg',480,360),
      new Array('Photo 15','15.jpg',480,360),
      new Array('Photo 16','16.jpg',480,360),
      new Array('Photo 17','17.jpg',480,360),
      new Array('Photo 18','18.jpg',480,360),
      new Array('Photo 19','19.jpg',480,360),
      new Array('Photo 20','20.jpg',480,360),
      new Array('Photo 21','21.jpg',480,360),
      new Array('Photo 22','22.jpg',480,360),
      new Array('Photo 23','23.jpg',480,360),
      new Array('Photo 24','24.jpg',480,360),
      new Array('Photo 25','A Wall Before.jpg',480,360),
      new Array('Photo 26','A Wall CAD.jpg',480,360),
      new Array('Photo 27','atterberry B4.jpg',534,400),
      new Array('Photo 28','atterberry.jpg',534,400),
      new Array('Photo 29','Bene Wall Before.jpg',480,360),
      new Array('Photo 30','Bene Wall CAD.jpg',480,360),
      new Array('Photo 31','burton before.jpg',534,400),
      new Array('Photo 32','Burton1.jpg',534,400),
      new Array('Photo 33','Davis Before.jpg',480,360),
      new Array('Photo 34','Davis CAD.jpg',480,360),
      new Array('Photo 35','front.jpg',500,400),
	  new Array('Photo 36','FRONT RIGHT.jpg',500,400),
      new Array('Photo 37','Funkhauser Front Before.jpg',480,360),
      new Array('Photo 38','Funkhauser Front CAD.jpg',480,360),
      new Array('Photo 39','hale.jpg',600,400),
	  new Array('Photo 40','Hale Right.jpg',600,400),
      new Array('Photo 41','higdon.jpg',534,400),
	  new Array('Photo 42','Higdon Revisioon.jpg',534,400),
      new Array('Photo 43','huels.jpg',534,400),
	  new Array('Photo 44','huels complete.jpg',534,401),
      new Array('Photo 45','Keiper Patio Before.jpg',480,360),
      new Array('Photo 46','Keiper Patio CAD.jpg',480,360),
      new Array('Photo 47','kuhn before.jpg',534,400),
      new Array('Photo 48','kuhn.jpg',534,400),
      new Array('Photo 49','l1.jpg',534,400),
      new Array('Photo 50','l2.jpg',534,400),
      new Array('Photo 51','lammers before.jpg',600,400),
      new Array('Photo 52','Lammers Main Wall.jpg',600,400),
      new Array('Photo 53','lenard.jpg',534,400),
	  new Array('Photo 54','lenard complete.jpg',534,400),
      new Array('Photo 55','long1.jpg',534,400),
      new Array('Photo 56','long2.jpg',534,400),
      new Array('Photo 57','nash 1.jpg',534,400),
      new Array('Photo 58','nash.jpg',534,400),
      new Array('Photo 59','pohlmann.jpg',534,400),
      new Array('Photo 60','Pohlmann1.jpg',534,400),
      new Array('Photo 61','schroeder.jpg',534,400),
	  new Array('Photo 62','Shroeder back.jpg',534,401),
      new Array('Photo 63','Schwartz Front Before.jpg',480,360),
	  new Array('Photo 64','Schwartz Front CAD.jpg',480,360),
      new Array('Photo 65','todd white before.jpg',534,400),
      new Array('Photo 66','Todd White Wall.jpg',534,400),
      new Array('Photo 67','werts before.jpg',500,400),
      new Array('Photo 68','Werts Front 1.jpg',501,401),
      new Array('Photo 69','werts side 1.jpg',500,400),
      new Array('Photo 70','werts SIDE.jpg',501,401),
      new Array('Photo 71','Wright Front Before.jpg',480,360),
      new Array('Photo 72','Wright Front CAD.jpg',480,360)
	  
    )
  )
)
section = getParameter(self.document.location.href, 'section');
var sectionIndex = 0;

if (section != '') {
  for (var i=0; i<arImages.length; i++) {
    if (arImages[i][1] == section) {
	  sectionIndex = i;
	  break;
	}
  }
}
section = arImages[sectionIndex][1];

ind = getParameter(self.document.location.href, 'ind');
if (isNaN(ind) || (ind=='') || (ind<0) || (ind>arImages[sectionIndex][5].length))
  ind = 0;

var arPreloadImages = new Array();
function preload() {
  if (arImages[sectionIndex][3]!='') {
    for (i=ind;(i<(Number(ind)+Number(countX*countY))) && (i<arImages[sectionIndex][5].length);i++) {
      arPreloadImages[i] = new Image(mediumSizes[0],mediumSizes[1]);
      arPreloadImages[i].src = arImages[sectionIndex][3]+arImages[sectionIndex][5][i][1];
    }
  }
}

function showImageMedium(number) {
  showImage('imagemedium',arImages[sectionIndex][3]+arImages[sectionIndex][5][number][1]);
  showMessage('imagemediumname',arImages[sectionIndex][5][number][0]);
}
