
smallSizes = new Array(80,80);
mediumSizes = new Array();
pageName = 'patterns.html';
scriptName = 'patterns.js';
countX = 2;
countY = 5;

// sections: name, small images path, medium images path, big images path
// images: name, src, big width, big height
var arImages = new Array(
  new Array('Bergerac Pavers','images/patterns/bergerac/small/','','images/patterns/bergerac/big/',
    new Array(
      new Array('Pattern 1','bergerac1.gif',133,133),
      new Array('Pattern 2','bergerac2.gif',133,133),
      new Array('Pattern 3','bergerac3.gif',133,133),
      new Array('Pattern 4','bergerac4.gif',133,133)
    )
  ),
  new Array('Dublin Cobble Pavers','images/patterns/dublincobble/small/','','images/patterns/dublincobble/big/',
    new Array(
      new Array('Pattern 1','dublin1.gif',133,133),
      new Array('Pattern 2','dublin2.gif',133,133),
      new Array('Pattern 3','dublin3.gif',133,133),
      new Array('Pattern 4','dublin4.gif',133,133),
      new Array('Pattern 5','dublin5.gif',133,133),
      new Array('Pattern 6','dublin6.gif',133,133)
    )
  ),
  new Array('Holland Pavers','images/patterns/holland/small/','','images/patterns/holland/big/',
    new Array(
      new Array('Pattern 1','holland1.gif',133,133),
      new Array('Pattern 2','holland2.gif',133,133),
      new Array('Pattern 3','holland3.gif',133,133),
      new Array('Pattern 4','holland4.gif',133,133)
    )
  )
)

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]);
}
