
smallSizes = new Array(69,66);
mediumSizes = new Array(261,174);
pageName = 'colors.htm';
scriptName = 'colors.js';
countX = 1;
countY = 6; 

// sections: name, small images path, medium images path, big images path
// images: name, src, big width, big height
var arImages = new Array(
  new Array('Eastern States','images/colors/thumbs/','images/colors/display/','images/colors/popups/',
    new Array(
      new Array('Orleans Grey','duff-1-02.jpg',600,400),
      new Array('Lennox Grey','duff-1-03.jpg',600,400),
      new Array('Chambly Beige','duff-1-04.jpg',600,400)
    )
  ),

  new Array('Western States','images/colors/thumbs/','images/colors/display/','images/colors/popups/',
    new Array(
      new Array('Lennox Grey','duff-1-03.jpg',600,400),
      new Array('Cashmere Blend','duff-1-04.jpg',600,400)
    )
  ),
  new Array('Texas','images/colors/thumbs/','images/colors/display/','images/colors/popups/',
    new Array(
      new Array('Hill Country','hill_country.jpg',208,208),
      new Array('Brazos Blend','brazos_blend.jpg',208,208),
      new Array('Rio Grande','rio_grande.jpg',208,208),
      new Array('Brazos Blend/Rio Grande','brazos_blend_rio_grande.jpg',208,208),
      new Array('Brazos Blend/Hill Country','brazos_blend_hill_country.jpg',208,208),
      new Array('Hill Country/Rio Grande','hill_country_rio_grande.jpg',208,208)
    )
  )
)

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]);
}

