
smallSizes = new Array(77,77);
mediumSizes = new Array(200,170);
pageName = 'photos.htm';
scriptName = 'photos.js';
countX = 4;
countY = 3;

// sections: name, small images path, medium images path, big images path
// images: name, src, big width, big height
var arImages = new Array(
  new Array('Bathrooms','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('','baths_001.jpg',533,400,'','',''), 
		new Array('','baths_002.jpg',533,400,'','',''), 
		new Array('','baths_003.jpg',533,400,'','',''), 
		new Array('','baths_004.jpg',533,400,'','',''),
		new Array('','marble-bathroom-1.jpg',446,400,'','','')
    )
  ),
  new Array('Kitchens','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('','kitchens_001.jpg',379,400,'','',''), 
		new Array('','kitchens_003.jpg',568,400,'','',''), 
		new Array('','kitchens_009.jpg',575,400,'','',''), 
		new Array('','kitchens_010.jpg',570,400,'','',''), 
		new Array('','kitchens_012.jpg',507,400,'','','')
    )
  ),
  new Array('Roofing','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('','roofing_001.jpg',533,400,'','',''), 
		new Array('','roofing_002.jpg',533,400,'','',''),
		new Array('','012611_tile_roofing.jpg',360,360,'','',''), 
		new Array('','gaf-grand-canyon-sedona-sun.jpg',557,400,'','',''), 
		new Array('','roofing-tampa.jpg',490,320,'','','')
    )
  ),
  new Array('Pavers','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('','p1010341_0336_336.jpg',533,400,'','',''), 
		new Array('','p1010342_0337_337.jpg',533,400,'','',''), 	
		new Array('','ad_photo.jpg',274,400,'','',''), 	
		new Array('','0.jpg',402,400,'','',''), 
		new Array('','2.jpg',400,400,'','',''), 
		new Array('','24.jpg',398,400,'','',''), 
		new Array('','49.jpg',501,401,'','',''), 
		new Array('','51.jpg',318,400,'','','')
    )
  ),
  new Array('Framing','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('','StairsFraming_i.jpg',400,300,'','',''), 
		new Array('','framing_002.jpg',601,400,'','',''),
		new Array('','framing.jpg',640,480,'','',''), 
		new Array('','framing2.jpg',533,400,'','',''), 
		new Array('','Wall%20Framing.jpg',621,400,'','','')
    )
  ),
  new Array('Painting','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('','paint_001.jpg',450,338,'','',''), 
		new Array('','paint_002.jpg',533,400,'','',''), 
		new Array('','paint_003.jpg',514,370,'','',''), 
		new Array('','paint_004.jpg',560,400,'','',''), 
		new Array('','paint_005.jpg',500,375,'','','')
    )
  ),
  new Array('Basements','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('','basements.jpg',588,400,'','',''), 
		new Array('','basements_609.jpg',546,400,'','',''), 
		new Array('','finished-basement-5.jpg',440,290,'','',''), 
		new Array('','House0069.jpg',533,400,'','',''), 
		new Array('','theater_room_entrance2.jpg',590,390,'','','') 
    )
  ),
  new Array('Drywall','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('','dry66_lg.jpg',430,330,'','',''), 
		new Array('','drywall.jpg',601,400,'','',''), 
		new Array('','drywall7-5.jpg',533,400,'','',''), 
		new Array('','Drywall_Repair.jpg',533,400,'','',''), 
		new Array('','drywall_res5.jpg',432,288,'','','')
    )
  ),
  new Array('Flooring','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('Flooring at Ace Hardware in Springboro','p1010337_0332_332.jpg',533,400,'','',''), 
		new Array('Flooring at Ace Hardware in Springboro','p1010338_0333_333.jpg',533,400,'','','')
    )
  ),
  new Array('Rock Patio','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('Rock patio, and fire pit after photo','img009.jpg',616,400,'','',''), 
		new Array('Rock patio, and fire pit before photo','p1010366_0356_356.jpg',533,400,'','',''), 
		new Array('Rock patio, and fire pit before photo','p1010367_0357_357.jpg',533,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 preloadphotos() {
  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 menu_portfolio() {
  var jp;
  document.write('<table border="0" cellspacing="0" cellpadding="0">');
  document.write('<tr><td>Choose a category:&nbsp;<select name="cat" class="select1" onChange="if (this.value.length!=0) window.location=this.value" style="font-size:9px;">');
  document.write('<option value="portfolio.htm">Please select...</option>');
  for (jp=0;jp<arImages.length;jp++) {
    document.write('<option value="'+pageName+'?section='+jp+'"'+((jp==section)?' selected':'')+'>'+arImages[jp][0]+'</option>');
  }  
  document.write('</select></td></tr>')
  document.write('</table>');
}  
  
function showImageMedium(number) {
  showImage('imagemedium',arImages[section][2]+arImages[section][4][number][1]);
  if (arImages[section][4][number][0]!='')
   showMessage('imagemediumname',arImages[section][4][number][0]);   
  else
   showMessage('imagemediumname','Photo '+Number(Number(number)+1));
}

function showImageBig(number) {
  showImagePopup(scriptName,section,number,arImages[section][4][number][2],
   arImages[section][4][number][3]);
}
