
function ShowPhotoPopup(gallery,id,wpx,hpx,bgpx)
{
   document.getElementById('displayphoto').style.borderWidth = "1px";
   document.getElementById('photopopup').style.display = "block";
   document.getElementById('displayphoto').style.background = "url(/photos/photostrip"+gallery+".jpg)";
   document.getElementById('displayphoto').style.width = wpx+"px";
   document.getElementById('displayphoto').style.height = hpx+"px";
   document.getElementById('displayphoto').style.backgroundPosition = "left -"+bgpx+"px";
   //alert (document.getElementById('displayphoto').style.backgroundPosition);
   document.getElementById('displayphoto').style.visibility = "visible";
   document.getElementById('displayAll').style.display = "none";
   document.getElementById('caption0').style.display = "none";
	// for (initial; condition; increment) { statements; }
  // problem with IE 7 and captions...?
  if(indexOf.navigator.userAgent('MSIE 7')==-1){
		for (j = 1; j <= photomax1; j++) {
			// print the below with each loop
			if (j == id) {document.getElementById('caption'+gallery+id).style.display = "block";}
				else {document.getElementById('caption1'+j).style.display = "none";}
		}
		for (j = 1; j <= photomax2; j++) {
			// print the below with each loop
			if (j == id) {document.getElementById('caption'+gallery+id).style.display = "block";}
				else {document.getElementById('caption2'+j).style.display = "none";}
		}
		for (j = 1; j <= photomax3; j++) {
			// print the below with each loop
			if (j == id) {document.getElementById('caption'+gallery+id).style.display = "block";}
				else {document.getElementById('caption3'+j).style.display = "none";}
		}
  }
  // remove any img that still may be in the foreground from ajx
  var page_objects = document.getElementById('displayphoto').getElementsByTagName('img');
  for (j=0; j < page_objects.length; j++) page_objects[j].style.display = "none";
}
