
smallSizes = new Array(77,77);
mediumSizes = new Array(200,170);
pageName = 'photos.htm';
scriptName = 'photos.js';
countX = 5;
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('Photo Gallery','photos','images/photos/small/','images/photos/medium/','images/photos/big/',
    new Array(
		new Array('','0.jpg',402,400),
		new Array('','1.jpg',400,400),
		new Array('','10.jpg',510,400),
		new Array('','11.jpg',509,400),
		new Array('','12.jpg',390,400),
		new Array('','13.jpg',400,400),
		new Array('','14.jpg',405,400),
		new Array('','15.jpg',398,400),
		new Array('','16.jpg',418,400),
		new Array('','17.jpg',399,400),
		new Array('','18.jpg',400,400),
		new Array('','2.jpg',400,400),
		new Array('','20.jpg',511,400),
		new Array('','21.jpg',393,400),
		new Array('','22.jpg',397,400),
		new Array('','23.jpg',512,400),
		new Array('','24.jpg',398,400),
		new Array('','25.jpg',343,433),
		new Array('','26.jpg',502,400),
		new Array('','27.jpg',444,354),
		new Array('','28.jpg',323,400),
		new Array('','29.jpg',305,400),
		new Array('','3.jpg',400,400),
		new Array('','30.jpg',398,400),
		new Array('','31.jpg',515,400),
		new Array('','32.jpg',400,400),
		new Array('','33.jpg',393,400),
		new Array('','34.jpg',398,400),
		new Array('','35.jpg',313,400),
		new Array('','36.jpg',400,400),
		new Array('','37.jpg',319,400),
		new Array('','38.jpg',507,400),
		new Array('','39.jpg',398,400),
		new Array('','4.jpg',520,400),
		new Array('','40.jpg',515,401),
		new Array('','41.jpg',313,400),
		new Array('','42.jpg',396,400),
		new Array('','43.jpg',520,400),
		new Array('','44.jpg',313,400),
		new Array('','45.jpg',515,400),
		new Array('','46.jpg',424,426),
		new Array('','47.jpg',326,420),
		new Array('','48.jpg',318,400),
		new Array('','49.jpg',501,401),
		new Array('','5.jpg',398,400),
		new Array('','50.jpg',404,400),
		new Array('','51.jpg',318,400),
		new Array('','52.jpg',400,400),
		new Array('','53.jpg',400,400),
		new Array('','54.jpg',325,400),
		new Array('','55.jpg',504,400),
		new Array('','6.jpg',398,400),
		new Array('','7.jpg',318,400),
		new Array('','8.jpg',321,400),
		new Array('','9.jpg',541,436)
    ),0
  )
)
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 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;">');
  for (jp=0;jp<arImages.length;jp++) {
    document.write('<option value="'+pageName+'?section='+arImages[jp][1]+'"'+((jp==sectionIndex)?' selected':'')+'>'+arImages[jp][0]+'</option>');
  }  
  document.write('</select></td></tr>')
  document.write('</table>');
}

function showImageMedium(number) {
  showImage('imagemedium',arImages[sectionIndex][3]+arImages[sectionIndex][5][number][1]);
  if (arImages[sectionIndex][5][number][0]!='')
   showMessage('imagemediumname',arImages[sectionIndex][5][number][0]);
  else
   showMessage('imagemediumname','Photo '+Number(Number(number)+1));

}

