
smallSizes = new Array(75,50);
mediumSizes = new Array(280,176);
pageName = 'portfolio.htm';
scriptName = 'portfolio.js';
countX = 3;
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('Residential','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','4x8_1.jpg',400,275),
      new Array('Photo 2','4x8_2.jpg',400,275),
      new Array('Photo 3','seminole.jpg',400,275),
      new Array('Photo 4','4x8herringbone.jpg',400,275),
      new Array('Photo 5','claypavers1.jpg',400,275),
      new Array('Photo 6','cobblestone.jpg',246,383),
      new Array('Photo 7','residential1.jpg',400,275),
      new Array('Residential (Before)','residential11before.jpg',400,275),
      new Array('Residential (After)','residential11after.jpg',400,275),
      new Array('Residential 12 (Before)','residential12before.jpg',400,275),
      new Array('Residential 12 (After)','residential12after.jpg',400,275),
      new Array('Photo 12','tumbledmarble1.jpg',400,275)
    )
  ),
  
  new Array('Commercial','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','4x8pavers.jpg',400,275),
      new Array('Photo 2','4x8pavers2.jpg',400,275),
      new Array('Photo 3','commercial1.jpg',400,275),
      new Array('Photo 4','commercial2.jpg',400,275),
      new Array('Photo 5','design1.jpg',400,275),
      new Array('Photo 6','bishophat1.jpg',423,393),
      new Array('Photo 7','endicottclaypavers2.jpg',400,275),
      new Array('Photo 8','lasOlasRiverwalk.jpg',400,275),
      new Array('Photo 9','oldchicago.jpg',400,275),
      new Array('Photo 10','oldetowne3.jpg',400,275),
      new Array('Photo 11','teardrop_precast1.jpg',400,275),
      new Array('Photo 12','teardrop_precast2.jpg',400,275)
    )
  ),

  new Array('Condominium','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Before','before.jpg',400,275),
      new Array('After','after.jpg',400,275),
      new Array('Photo 3','charismapavertop.jpg',400,275),
      new Array('Photo 4','condocobblepavers.jpg',400,275),
      new Array('Photo 5','condoestatepavers.jpg',400,275),
      new Array('Photo 6','design-1.jpg',400,275),
      new Array('Photo 7','design-2.jpg',400,275),
      new Array('Photo 8','design-3.jpg',400,275),
      new Array('Photo 9','flowerdesign.jpg',400,275),
      new Array('Photo 10','guitarpaver.jpg',400,275),
      new Array('Photo 11','oldetownepaver.jpg',400,275)
    )
  )
)

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]);
}
