
smallSizes = new Array(77,77);
mediumSizes = new Array(200,170);
pageName = 'photo.html';
scriptName = 'photo.js';
countX = 3;
countY = 3;

var arImages = new Array(

  new Array('Fertilization','fertilization','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','fert-1l.jpg',432,287),
      new Array('Photo 2','fert-2l.jpg',432,286),
      new Array('Photo 3','fert-3l..jpg',432,339)
    )
  ),

  new Array('Hardscape','hardscape','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','land-10l_1.jpg',360,287),
      new Array('Photo 2','pavers-1l.jpg',432,286),
      new Array('Photo 3','pavers-2l.jpg',432,280),
      new Array('Photo 4','pavers-3l.jpg',432,288),
      new Array('Photo 5','pavers-4l.jpg',432,288),
      new Array('Photo 6','pavers-5l.jpg',432,343)
    )
  ),

  new Array('Irrigation','irrigation','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','irri-1l.jpg',432,292),
      new Array('Photo 2','irri-2l.jpg',432,343)
    )
  ),

  new Array('Landscape','landscape','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','land-10l.jpg',360,287),
      new Array('Photo 2','land-11l.jpg',504,400),
      new Array('Photo 3','land-12l.jpg',502,401),
      new Array('Photo 4','land-19l.jpg',432,334),
      new Array('Photo 5','land-20l.jpg',432,341),
      new Array('Photo 6','land-24l.jpg',548,391),
      new Array('Photo 7','land-25l.jpg',553,391),
      new Array('Photo 8','land-7l.jpg',432,345),
      new Array('Photo 9','land-9l.jpg',432,344),
      new Array('Photo 10','land-pl.jpg',538,387),
      new Array('Photo 11','land2-2l.jpg',360,256),
      new Array('Photo 12','land2-3l.jpg',396,282),
      new Array('Photo 13','land2-4l.jpg',360,294),
      new Array('Photo 14','land2-6l.jpg',360,289),
      new Array('Photo 15','land2-7l.jpg',360,265),
      new Array('Photo 16','land2-8l.jpg',360,286),
      new Array('Photo 17','land2-9l.jpg',424,284)
    )
  ),

  new Array('Maintenance','maintenance','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','land-24l_1.jpg',548,391),
      new Array('Photo 2','land-7l_1.jpg',432,345),
      new Array('Photo 3','maintenance-1l.jpg',432,277),
      new Array('Photo 4','maintenance-3l.jpg',432,290),
      new Array('Photo 5','maintenance-4l.jpg',432,340)
    )
  ),

  new Array('Night Lighting','night_lighting','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','night-lite-1l.jpg',432,338)
    )
  )

)

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]);
}

