
smallSizes = new Array(75,50);
mediumSizes = new Array(280,176);
pageName = 'products.htm';
scriptName = 'products.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('Special Products','images/products/small/','images/products/medium/','images/products/big/',
    new Array(
      new Array('Photo 1','sp_smt4.jpg',400,351),
      new Array('Photo 2','sp_smt3.jpg',400,358),
      new Array('Photo 3','sp_smt2.jpg',400,358),
      new Array('Photo 4','sp_s3.jpg',400,272),
      new Array('Photo 5','sp_c1.jpg',400,436),
      new Array('Photo 6','sp_c1_4.jpg',400,315),
      new Array('Photo 7','sp_c1_3.jpg',400,565),
      new Array('Photo 8','sp_c1_2.jpg',400,533),
      new Array('Photo 9','sp_sc2.jpg',400,397)
    )
  ),
  
  new Array('Retaining Walls','images/products/small/','images/products/medium/','images/products/big/',
    new Array(
      new Array('Photo 1','rt6.jpg',400,398),
      new Array('Photo 2','rt5_6.jpg',400,592),
      new Array('Photo 3','rt4.jpg',400,271),
      new Array('Photo 4','rt3.jpg',400,196),
      new Array('Photo 5','rt2_2.jpg',400,309),
      new Array('Photo 6','rt1.jpg',400,269)
    )
  ),

  new Array('Design','images/products/small/','images/products/medium/','images/products/big/',
    new Array(
      new Array('Photo 1','d8.jpg',400,268),
      new Array('Photo 2','d7.jpg',400,547),
      new Array('Photo 3','d6.jpg',400,269),
      new Array('Photo 4','d6_2.jpg',400,594),
      new Array('Photo 5','d5.jpg',400,234),
      new Array('Photo 6','d5_2.jpg',400,273),
      new Array('Photo 7','d4_2.jpg',400,268),
      new Array('Photo 8','d3.jpg',380,328),
      new Array('Photo 9','d2.jpg',400,447),
      new Array('Photo 10','d1.jpg',400,370)
    )
  )
)

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]);
}
