
smallSizes = new Array(77,77);
mediumSizes = new Array(250,250);
pageName = 'homes.htm';
scriptName = 'homes.js';
countX = 2;
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('West Caldwell','images/homes/small/','images/homes/medium1/','images/homes/big/',
    new Array(
      new Array('Photo 1','Scaglione 1.jpg',534,400),
      new Array('Photo 2','Scaglione 2.jpg',534,400),
      new Array('Photo 3','Scaglione 3.jpg',534,400)
    )
  ),

  new Array('Caldwell','images/homes/small/','images/homes/medium1/','images/homes/big/',
    new Array(
      new Array('Photo 1','Tierney 1.jpg',534,400),
      new Array('Photo 2','Tierney 2.jpg',300,400),
      new Array('Photo 3','Tierney 3.jpg',534,400),
      new Array('Photo 4','Tierney 4.jpg',534,400)
    )
  ),

  new Array('Wayne','images/homes/small/','images/homes/medium1/','images/homes/big/',
    new Array(
      new Array('Photo 1','group1-1.jpg',500,375),
      new Array('Photo 2','group1-2.jpg',500,375),
      new Array('Photo 3','group1-3.jpg',500,375),
      new Array('Photo 4','group1-4.jpg',500,375),
      new Array('Photo 5','group1-5.jpg',500,375),
      new Array('Photo 6','group1-6.jpg',500,375),
      new Array('Photo 7','group1-7.jpg',500,375)
    )
  ),

  new Array('West Milford 1','images/homes/small/','images/homes/medium1/','images/homes/big/',
    new Array(
      new Array('Photo 1','group9-1.jpg',500,375),
      new Array('Photo 2','group9-7.jpg',300,400),
      new Array('Photo 3','group9-8.jpg',300,400)
    )
  ),

  new Array('West Milford 2','images/homes/small/','images/homes/medium1/','images/homes/big/',
    new Array(
      new Array('Photo 1','group8-1.jpg',500,375),
      new Array('Photo 2','group8-2.jpg',500,375),
      new Array('Photo 3','group8-3.jpg',500,375),
      new Array('Photo 4','group8-4.jpg',500,375)
    )
  ),

  new Array('Pequannock 1','images/homes/small/','images/homes/medium1/','images/homes/big/',
    new Array(
      new Array('Photo 1','group7-1.jpg',500,375),
      new Array('Photo 2','group7-2.jpg',500,375)
    )
  ),

  new Array('Pequannock 2','images/homes/small/','images/homes/medium1/','images/homes/big/',
    new Array(
      new Array('Photo 1','group6-1.jpg',500,375),
      new Array('Photo 2','group6-2.jpg',500,375)
    )
  )

/*
  new Array('Home 2','images/homes/small/','images/homes/medium/','images/homes/big/',
    new Array(
      new Array('Photo 1','group2-1.jpg',500,375)
    )
  ),

  new Array('Home 3','images/homes/small/','images/homes/medium/','images/homes/big/',
    new Array(
      new Array('Photo 1','group3-1.jpg',500,375),
      new Array('Photo 2','group3-2.jpg',500,375)
    )
  ),

  new Array('Home 4','images/homes/small/','images/homes/medium/','images/homes/big/',
    new Array(
      new Array('Photo 1','group4-1.jpg',500,375),
      new Array('Photo 2','group4-2.jpg',300,400)
    )
  ),

  new Array('Home 5','images/homes/small/','images/homes/medium/','images/homes/big/',
    new Array(
      new Array('Photo 1','group5-1.jpg',500,375),
      new Array('Photo 2','group5-2.jpg',500,375)
    )
  )
*/
)

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]);
}

