
smallSizes = new Array(77,77);
mediumSizes = new Array(200,170);
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('Before and After','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
new Array('Before 1','1-before 001.jpg',532,400),
new Array('After 1','1-after 002.jpg',533,400),
new Array('Before 2','2-before 004.jpg',532,400),
new Array('After 2','2-after 003.jpg',533,400),
new Array('Before 3','3-before 006.jpg',532,400),
new Array('After 3','3-after 005.jpg',533,400),
new Array('Before 4','4-before1 008.jpg',539,400),
new Array('Before 4','4-before2 009.jpg',539,400),
new Array('After 4','4-after 007.jpg',533,400)
    )
  ),

  new Array('Landscape','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
new Array('Photo 1','McNeill Landscape 012.jpg',533,400),
new Array('Photo 2','McNeill Landscape 013.jpg',533,400),
new Array('Photo 3','McNeill Landscape 014.jpg',532,400),
new Array('Photo 4','McNeill Landscape 015.jpg',533,400),
new Array('Photo 5','McNeill Landscape 016.jpg',533,400),
new Array('Photo 6','McNeill Landscape 017.jpg',533,400),
new Array('Photo 7','McNeill Landscape 018.jpg',532,400),
new Array('Photo 8','McNeill Landscape 019.jpg',532,400),
new Array('Photo 9','McNeill Landscape 020.jpg',532,400),
new Array('Photo 10','McNeill Landscape 021.jpg',539,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]);
}
