
smallSizes = new Array(50,50);
mediumSizes = new Array(170,170);
pageName = 'colors.htm';
scriptName = 'colors.js';
countX = 3; 
countY = 4;

// sections: name, small images path, medium images path, big images path
// images: name, src, big width, big height
var arImages = new Array(
  new Array('Stippled','images/colors/small/','images/colors/medium/','images/colors/big/',
    new Array(
      new Array('Iceberg Green 505','Iceberg Green 505.jpg',439,379), 
      new Array('French Gray 504','French Gray 504.jpg',424,366),
      new Array('Malibu 509','Malibu 509.jpg',170,170),
      new Array('Sante Fe Buff 503','Sante Fe Buff 503.jpg',170,170),
      new Array('Granada White 501','Granada White 501.jpg',170,170),  
      new Array('Brick Red 516','516-Brick-Red.jpg',480,300),
      new Array('Cafe Brown 507','Cafe Brown 507.jpg',107,107),
      new Array('Almond 506','Almond 506.jpg',170,170),
      new Array('Espresso Brown 508','Espresso Brown 508.jpg',170,170),
      new Array('Caramel 510','Caramel 510.jpg',400,400),
      new Array('Porcelain 513','Porcelain 513.jpg',432,400),
      new Array('Agave Green 512','Agave Green 512.jpg',476,400)
    )
  ),

  new Array('Sandblast Colors with Slag','images/colors/small/','images/colors/medium/','images/colors/big/',
    new Array(
      new Array('Iceberg Green 1405','Iceberg Green 1405.jpg',180,180),
      new Array('French Gray 1404','French Gray 1404.jpg',180,180),
      new Array('Malibu 1409','Malibu 1409.jpg',180,180),
      new Array('Sante Fe Buff 1403','Sante Fe Buff 1403.jpg',180,180),
      new Array('Granada White 1401','Granada White 1401.jpg',349,400),
      new Array('Brick Red 1416','1416-Brick-Red.jpg',400,400),
      new Array('Cafe Brown 1407','Cafe Brown 1407.jpg',180,180),
      new Array('Almond 1406','Almond 1406.jpg',180,180),
      new Array('Espresso Brown 1408','Espresso Brown 1408.jpg',180,180),
      new Array('Caramel 1410','Caramel 1410.jpg',400,400),
      new Array('Porcelain 1413','Porcelain 1413.jpg',400,400),
      new Array('Agave Green 1412','Agave Green 1412.jpg',400,400)
    )
  ),

  new Array('Sandblast Colors without Slag','images/colors/small/','images/colors/medium/','images/colors/big/',
    new Array(
      new Array('Iceberg 1805','Iceberg1805.jpg',400,400),
      new Array('French Gray 1804','FrenchGray1804.jpg',400,400),
      new Array('Malibu 1809','Malibu1809.jpg',400,400),
      new Array('Santa Fe Buff 1803','SantaFeBuff1803.jpg',400,400),
      new Array('Granada White 1801','GranadaWhite1801.jpg',400,400),
      new Array('Brick Red 1816','BrickRed1816.jpg',400,400),
      new Array('Cafe Brown 1807','CafeBrown1807.jpg',400,400),
      new Array('Almond 1806','Almond1806.jpg',400,400),
      new Array('Espresso Brown 1808','EspressoBrown1808.jpg',400,400),
      new Array('Caramel 1810','Caramel1810.jpg',400,400),
      new Array('Porcelain 1813','Porcelain1813.jpg',400,400),
      new Array('Agave 1812','Agave1812.jpg',400,400) 
    )
  ),

  new Array('Sonorastone&reg;','images/colors/small/','images/colors/medium/','images/colors/big/',
    new Array(
      new Array('Agave Verde','Agave Verde.jpg',385,400),
      new Array('Desert','Desert_1.jpg',380,400),
      new Array('Terra','Terra_1.jpg',400,400),
      new Array('Kahlua','Kahlua.jpg',382,400),
      new Array('Sterling Gray','Sterling Gray.jpg',380,400),
      new Array('Tuscan Amber','Tuscan Amber.jpg',400,400),
      new Array('Wheat','Wheat_1.jpg',400,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]);
}
