
smallSizes = new Array(77,77);
mediumSizes = new Array(200,170);
pageName = 'portfolio.htm';
scriptName = 'portfolio.js';
countX = 3;
countY = 3;

// sections: name, small images path, medium images path, big images path
// images: name, src, big width, big height
var arImages = new Array(

  new Array('Beecroft Residence - Sandy, Utah','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','Beecroft-IMG_1679.jpg',534,400),
      new Array('Photo 2','Beecroft-IMG_1682.jpg',534,400),
      new Array('Photo 3','Beecroft-IMG_1683.jpg',534,400),
      new Array('Photo 4','Beecroft-IMG_1684.jpg',534,400),
      new Array('Photo 5','Beecroft-IMG_1685.jpg',534,400),
      new Array('Photo 6','Beecroft-IMG_1687.jpg',534,400)
    )
  ),

  new Array('Collins Residence - Alpine, Utah','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','collins1.jpg',534,400),
      new Array('Photo 2','collins2.jpg',534,400),
      new Array('Photo 3','collins3.jpg',534,400),
      new Array('Photo 4','collins4.jpg',300,400)
    )
  ),

  new Array('Hiatt Residence - Alpine, Utah','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','hyatt1.jpg',534,400),
      new Array('Photo 2','hyatt2.jpg',534,400),
      new Array('Photo 3','hyatt3.jpg',534,400),
      new Array('Photo 4','hyatt4.jpg',534,400)
    )
  ),

  new Array('Riggs Residence - Lehi, UT','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Photo 1','Riggs-Pondless_Pic.jpg',599,400),
      new Array('Photo 2','Riggs-pondless_pic2.jpg',601,400),
      new Array('Photo 3','Riggs-pondless_pic3.jpg',599,400)
    )
  ),
  
new Array('Bluemel Residence - Orem, UT','images/portfolio/small/','images/portfolio/medium/','images/portfolio/big/',
    new Array(
      new Array('Backyard Before','Backyard_Before.jpg',534,400),
      new Array('Construction Foaming in Rock','construction_foaming_in_rock.jpg',534,400),
      new Array('During Construction Liner and Rock','During_construction_liner_and_rock.jpg',534,400),
      new Array('During Construction','During_Construction.jpg',534,400),
      new Array('During Construction Plywood Sheeting','during_construction_plywood_sheeting.jpg',534,400),
      new Array('Backyard','backyard_015[1].jpg',534,400),
      new Array('Finished Feature Running','Finished_feature_running.jpg',534,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]);
}
