
smallSizes = new Array(100,75);
mediumSizes = new Array(160,120);
pageName = 'gallery_show.htm';
scriptName = 'gallery.js';
countX = 4;
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('Before/After','before_after','images/beforeafter/small/','images/beforeafter/medium/','images/beforeafter/big/',
    new Array(
      new Array('Before','1.jpg',250,188),
      new Array('After','2.jpg',250,188),
      new Array('Before','3.jpg',250,188),
      new Array('After','4.jpg',250,188),
      new Array('Before','5.jpg',250,188),
      new Array('After','6.jpg',250,188),
      new Array('Before','7.jpg',250,188),
      new Array('After','8.jpg',250,188),
      new Array('Before','9.jpg',250,188),
      new Array('After','10.jpg',250,188),
      new Array('Before','11.jpg',250,188),
      new Array('After','12.jpg',250,188),
      new Array('Before','13.jpg',250,188),
      new Array('After','14.jpg',250,188),
      new Array('Before','15.jpg',250,188),
      new Array('After','16.jpg',250,188),
      new Array('Before','17.jpg',250,188),
      new Array('After','18.jpg',250,188),
      new Array('Before','19.jpg',250,188),
      new Array('After','20.jpg',250,188)
    )
  ),
/*
  new Array('Residental','images/residential/small/','images/residential/medium/','images/residential/big/',
    new Array(
      new Array('Photo 1','DSC01689.jpg',800,600),
      new Array('Photo 2','DSC01690.jpg',800,600),
      new Array('Photo 3','DSC01691.jpg',800,600),
      new Array('Photo 4','DSC01692.jpg',800,600),
      new Array('Photo 5','DSC01693.jpg',800,600),
      new Array('Photo 6','DSC01694.jpg',800,600),
      new Array('Photo 7','DSC01695.jpg',800,600),

      new Array('Photo 8','DSC01228.jpg',800,600),
      new Array('Photo 9','DSC01231.jpg',800,600),
      new Array('Photo 10','DSC01232.jpg',800,600),
      new Array('Photo 11','DSC01235.jpg',800,600),
      new Array('Photo 12','DSC01247.jpg',800,600),
      new Array('Photo 13','DSC01320.jpg',800,600),
      new Array('Photo 14','DSC01414.jpg',800,600),
      new Array('Photo 15','DSC01416.jpg',800,600),
      new Array('Photo 16','DSC01417.jpg',800,600),
      new Array('Photo 17','DSC01421.jpg',800,600),
      new Array('Photo 18','DSC01422.jpg',800,600),
      new Array('Photo 19','DSC01423.jpg',800,600),
      new Array('Photo 20','DSC01438.jpg',800,600),
      new Array('Photo 21','DSC01447.jpg',800,600),
      new Array('Photo 22','DSC01448.jpg',800,600),
      new Array('Photo 23','DSC01449.jpg',800,600),
      new Array('Photo 24','DSC01450.jpg',800,600),
      new Array('Photo 25','DSC01451.jpg',800,600),
      new Array('Photo 26','DSC01452.jpg',800,600),
      new Array('Photo 27','DSC01453.jpg',800,600),
      new Array('Photo 28','DSC01454.jpg',800,600),
      new Array('Photo 29','DSC01455.jpg',800,600),
      new Array('Photo 30','res001.jpg',250,188),
      new Array('Photo 31','res002.jpg',500,375),
      new Array('Photo 32','res003.jpg',500,375),
      new Array('Photo 33','res004.jpg',500,375),
      new Array('Photo 34','res005.jpg',500,375),
      new Array('Photo 35','res006.jpg',500,375),
      new Array('Photo 36','res007.jpg',500,375),
      new Array('Photo 37','res008.jpg',500,375),
      new Array('Photo 38','res009.jpg',500,375),
      new Array('Photo 39','res010.jpg',500,375),
      new Array('Photo 40','res011.jpg',500,375),
      new Array('Photo 41','res012.jpg',500,375),
      new Array('Photo 42','res013.jpg',500,375),
      new Array('Photo 43','res016.jpg',500,375),
      new Array('Photo 44','res017.jpg',500,375),
      new Array('Photo 45','res018.jpg',500,375),
      new Array('Photo 46','res019.jpg',500,375),
      new Array('Photo 47','res025.jpg',500,375),
      new Array('Photo 48','res026.jpg',640,480),
      new Array('Photo 49','res027.jpg',640,480),
      new Array('Photo 50','res028.jpg',640,480),
      new Array('Photo 51','res029.jpg',640,480),
      new Array('Photo 52','res030.jpg',640,480),
      new Array('Photo 53','res031.jpg',640,480),
      new Array('Photo 54','res032.jpg',640,480),
      new Array('Photo 55','res033.jpg',640,480),
      new Array('Photo 56','res034.jpg',640,480),
      new Array('Photo 57','DSC00721.jpg',800,600),
      new Array('Photo 58','DSC00723.jpg',800,600),
      new Array('Photo 59','DSC00724.jpg',800,600),
      new Array('Photo 60','DSC00726.jpg',800,600),
      new Array('Photo 61','DSC00728.jpg',800,600),
      new Array('Photo 62','DSC00738.jpg',800,600),
      new Array('Photo 63','DSC00787.jpg',800,600),
      new Array('Photo 64','DSC00825.jpg',800,600),
      new Array('Photo 65','DSC00826.jpg',800,600),
      new Array('Photo 66','DSC00877.jpg',800,600),
      new Array('Photo 67','DSC00953.jpg',800,600),
      new Array('Photo 68','IMGP1594.jpg',800,600),
      new Array('Photo 69','IMGP1598.jpg',800,600),
      new Array('Photo 70','IMGP1599.jpg',800,600),
      new Array('Photo 71','IMGP1602.jpg',800,600),
      new Array('Photo 72','job pictures 1032.jpg',800,600),
      new Array('Photo 73','job pictures 311.jpg',800,600),
      new Array('Photo 74','job pictures 744.jpg',800,600),
      new Array('Photo 75','poolpatiopic.jpg',556,339),
      new Array('Photo 76','stooppic.jpg',556,339)
    )
  ),
*/
  new Array('Commercial','commercial','images/commercial/small/','images/commercial/medium/','images/commercial/big/',
    new Array(
      new Array('Photo 1','com001.jpg',500,375),
      new Array('Photo 2','com002.jpg',500,375),
      new Array('Photo 3','com003.jpg',500,375),
      new Array('Photo 4','com004.jpg',500,375),
      new Array('Photo 5','com005.jpg',500,375),
      new Array('Photo 6','com006.jpg',500,375),
      new Array('Photo 7','com007.jpg',500,375),
      new Array('Photo 8','com008.jpg',500,375),
      new Array('Photo 9','com009.jpg',500,375),
      new Array('Photo 10','com010.jpg',500,375),
      new Array('Photo 11','com011.jpg',500,375),
      new Array('Photo 12','com012.jpg',500,375),
      new Array('Photo 13','com013.jpg',500,375),
      new Array('Photo 14','com014.jpg',500,375),
      new Array('Photo 15','com015.jpg',500,375),
      new Array('Photo 16','com017.jpg',500,375),
      new Array('Photo 17','com018.jpg',500,375),
      new Array('Photo 18','com019.jpg',500,375),
      new Array('Photo 19','com020.jpg',500,375),
      new Array('Photo 20','com021.jpg',500,375),
      new Array('Photo 21','com022.jpg',500,375),
      new Array('Photo 22','com023.jpg',500,375),
      new Array('Photo 23','com024.jpg',500,375),
      new Array('Photo 24','com025.jpg',500,375),
      new Array('Photo 25','IMGP0261.jpg',350,263),
      new Array('Photo 26','IMGP0262.jpg',350,263),
      new Array('Photo 27','IMGP0263.jpg',350,263),
      new Array('Photo 28','IMGP0264.jpg',350,263),
      new Array('Photo 29','IMGP0265.jpg',350,263),
      new Array('Photo 30','IMGP0266.jpg',350,263),
      new Array('Photo 31','IMGP0267.jpg',350,263),
      new Array('Photo 32','IMGP0268.jpg',350,263),
      new Array('Photo 33','IMGP0269.jpg',350,263),
      new Array('Photo 34','IMGP0270.jpg',350,263),
      new Array('Photo 35','IMGP0271.jpg',350,263),
      new Array('Photo 36','IMGP0272.jpg',350,263),
      new Array('Photo 37','IMGP0273.jpg',350,263),
      new Array('Photo 38','IMGP0274.jpg',350,263),
      new Array('Photo 39','IMGP0275.jpg',350,263),
      new Array('Photo 40','IMGP0276.jpg',350,263),
      new Array('Photo 41','IMGP0277.jpg',350,263),
      new Array('Photo 42','IMGP0278.jpg',350,263),
      new Array('Photo 43','IMGP0279.jpg',350,263),
      new Array('Photo 44','IMGP0280.jpg',350,263),
      new Array('Photo 45','IMGP0281.jpg',350,263),
      new Array('Photo 46','IMGP0282.jpg',350,263),
      new Array('Photo 47','IMGP0283.jpg',350,263),
      new Array('Photo 48','IMGP0284.jpg',350,263),
      new Array('Photo 49','IMGP0285.jpg',350,263),
      new Array('Photo 50','IMGP0286.jpg',350,263),
      new Array('Photo 51','IMGP0287.jpg',350,263),
      new Array('Photo 52','IMGP0288.jpg',350,263),
      new Array('Photo 53','IMGP0289.jpg',350,263),
      new Array('Photo 54','IMGP0291.jpg',350,263),
      new Array('Photo 55','IMGP0292.jpg',350,263),
      new Array('Photo 56','IMGP0293.jpg',350,263),
      new Array('Photo 57','IMGP0294.jpg',350,263),
      new Array('Photo 58','IMGP0295.jpg',350,263),
      new Array('Photo 59','IMGP0296.jpg',350,263),
      new Array('Photo 60','IMGP0297.jpg',350,263),
      new Array('Photo 61','IMGP0298.jpg',350,263),
      new Array('Photo 62','IMGP0299.jpg',350,263),
      new Array('Photo 63','IMGP0300.jpg',350,263),
      new Array('Photo 64','IMGP0302.jpg',350,263),
      new Array('Photo 65','IMGP0303.jpg',350,263),
      new Array('Photo 66','IMGP0304.jpg',350,263),
      new Array('Photo 67','IMGP0305.jpg',350,263),
      new Array('Photo 68','IMGP0306.jpg',350,263),
      new Array('Photo 69','IMGP0307.jpg',350,263),
      new Array('Photo 70','IMGP0308.jpg',350,263),
      new Array('Photo 71','IMGP0309.jpg',350,263),
      new Array('Photo 72','IMGP0310.jpg',350,263),
      new Array('Photo 73','IMGP0311.jpg',350,263),
      new Array('Photo 74','IMGP0312.jpg',350,263),
      new Array('Photo 75','IMGP0313.jpg',350,263),
      new Array('Photo 76','IMGP0314.jpg',350,263),
      new Array('Photo 77','IMGP0315.jpg',350,263),
      new Array('Photo 78','IMGP0316.jpg',350,263),
      new Array('Photo 79','IMGP0317.jpg',350,263),
      new Array('Photo 80','IMGP0318.jpg',350,263),
      new Array('Photo 81','IMGP0320.jpg',350,263),
      new Array('Photo 82','IMGP0321.jpg',350,263),

      new Array('Photo 83','IMGP0199.jpg',800,600),
      new Array('Photo 84','IMGP0203.jpg',800,600),
      new Array('Photo 85','IMGP0257.jpg',800,600),
      new Array('Photo 86','job pictures 021.jpg',800,600),
      new Array('Photo 87','job pictures 1051.jpg',800,600),
      new Array('Photo 88','job pictures 1057.jpg',800,600),
      new Array('Photo 89','job pictures 1074.jpg',800,600),
      new Array('Photo 90','job pictures 1075.jpg',800,600),
      new Array('Photo 91','job pictures 1104.jpg',800,600),
      new Array('Photo 92','job pictures 1106.jpg',800,600),
      new Array('Photo 93','job pictures 1113.jpg',800,600),
      new Array('Photo 94','job pictures 1119.jpg',800,600),
      new Array('Photo 95','job pictures 115.jpg',800,600),
      new Array('Photo 96','job pictures 116.jpg',800,600),
      new Array('Photo 97','job pictures 1169.jpg',800,600),
      new Array('Photo 98','job pictures 1170.jpg',800,600),
      new Array('Photo 99','job pictures 130.jpg',800,600),
      new Array('Photo 100','job pictures 1316.jpg',800,600),
      new Array('Photo 101','job pictures 1341.jpg',800,600),
      new Array('Photo 102','job pictures 1342.jpg',800,600),
      new Array('Photo 103','job pictures 1343.jpg',800,600),
      new Array('Photo 104','job pictures 1344.jpg',800,600),
      new Array('Photo 105','job pictures 1353.jpg',800,600),
      new Array('Photo 106','job pictures 1460.jpg',800,600),
      new Array('Photo 107','job pictures 1475.jpg',800,600),
      new Array('Photo 108','job pictures 1526.jpg',800,600),
      new Array('Photo 109','job pictures 1532.jpg',800,600),
      new Array('Photo 110','job pictures 1540.jpg',800,600),
      new Array('Photo 111','job pictures 1541.jpg',800,600),
      new Array('Photo 112','job pictures 1545.jpg',800,600),
      new Array('Photo 113','job pictures 1555.jpg',800,600),
      new Array('Photo 114','job pictures 1559.jpg',800,600),
      new Array('Photo 115','job pictures 1560.jpg',800,600),
      new Array('Photo 116','job pictures 1562.jpg',800,600),
      new Array('Photo 117','job pictures 1563.jpg',800,600),
      new Array('Photo 118','job pictures 1565.jpg',800,600),
      new Array('Photo 119','job pictures 1566.jpg',800,600),
      new Array('Photo 120','job pictures 1567.jpg',800,600),
      new Array('Photo 121','job pictures 1568.jpg',800,600),
      new Array('Photo 122','job pictures 1570.jpg',800,600),
      new Array('Photo 123','job pictures 1606.jpg',800,600),
      new Array('Photo 124','job pictures 1671.jpg',450,600),
      new Array('Photo 125','job pictures 1733.jpg',800,600),
      new Array('Photo 126','job pictures 185.jpg',800,600),
      new Array('Photo 127','job pictures 186.jpg',800,600),
      new Array('Photo 128','job pictures 200.jpg',800,600),
      new Array('Photo 129','job pictures 226.jpg',800,600),
      new Array('Photo 130','job pictures 230.jpg',800,600),
      new Array('Photo 131','job pictures 244.jpg',800,600),
      new Array('Photo 132','job pictures 257.jpg',800,600),
      new Array('Photo 133','job pictures 259.jpg',800,600),
      new Array('Photo 134','job pictures 416.jpg',800,600),
      new Array('Photo 135','job pictures 429.jpg',800,600),
      new Array('Photo 136','job pictures 774.jpg',800,600),
      new Array('Photo 137','job pictures 777.jpg',800,600),
      new Array('Photo 138','job pictures 781.jpg',800,600),
      new Array('Photo 139','job pictures 784.jpg',800,600),
      new Array('Photo 140','job pictures 791.jpg',800,600),
      new Array('Photo 141','job pictures 794.jpg',800,600),
      new Array('Photo 142','job pictures 820.jpg',800,600),
      new Array('Photo 143','job pictures 834.jpg',800,600),
      new Array('Photo 144','job pictures 884.jpg',800,600),
      new Array('Photo 145','job pictures 887.jpg',800,600),
      new Array('Photo 146','Roslyn Estates 020.jpg',800,600)
	)
  ),

  new Array('Home Makeover','homemakeover','images/homemakeover/small/','images/homemakeover/medium/','images/homemakeover/big/',
    new Array(
      new Array('Photo 1','DSC00668.jpg',800,532),
      new Array('Photo 2','DSC00688.jpg',800,532),
      new Array('Photo 3','DSC00690.jpg',800,532),
      new Array('Photo 4','DSC00696.jpg',800,532),
      new Array('Photo 5','DSC00698.jpg',800,532),
      new Array('Photo 6','DSC00702.jpg',800,532),
      new Array('Photo 7','DSC00708.jpg',800,532),
      new Array('Photo 8','DSC00714.jpg',800,532),
      new Array('Photo 9','DSC00727.jpg',800,532),
      new Array('Photo 10','DSC00728.jpg',800,532),
      new Array('Photo 11','DSC00732.jpg',800,532),
      new Array('Photo 12','DSC00736.jpg',800,532)
	)
  )

)

section = getParameter(self.document.location.href, 'section');
var sectionIndex = 0;

if (section != '') {
  for (var i=0; i<arImages.length; i++) {
    if (arImages[i][1] == section) {
	  sectionIndex = i;
	  break;
	}
  }
}
section = arImages[sectionIndex][1];

ind = getParameter(self.document.location.href, 'ind');
if (isNaN(ind) || (ind=='') || (ind<0) || (ind>arImages[sectionIndex][5].length))
  ind = 0;

var arPreloadImages = new Array();
function preload() {
  if (arImages[sectionIndex][3]!='') {
    for (i=ind;(i<(Number(ind)+Number(countX*countY))) && (i<arImages[sectionIndex][5].length);i++) {
      arPreloadImages[i] = new Image(mediumSizes[0],mediumSizes[1]);
      arPreloadImages[i].src = arImages[sectionIndex][3]+arImages[sectionIndex][5][i][1];
    }
  }
}

function showImageMedium(number) {
  showImage('imagemedium',arImages[sectionIndex][3]+arImages[sectionIndex][5][number][1]);
  showMessage('imagemediumname',arImages[sectionIndex][5][number][0]);
}

