var photoRootDir = "../images"; //not yet used
var oneMomentSrc = "";

function showPhoto(strSource) {
	var pl = document.getElementById("photoLayer");
	var p = document.getElementById("photoLayerPhoto");
	/*alert(strSource);*/
	oneMomentSrc = p.src;
	pl.className = "visible";
	var newPic = new Image();
	newPic.src = strSource;
	/*alert(strSource);*/
	//alert(newPic.readyState);
	if(newPic.readyState == 'complete') {
		//if(document != top.document && strSource.substring(0,3) == "../") strSource = strSource.substring(1,strSource.length);
		p.className = "";
		p.src = strSource;
	} else {
		newPic.onload = function() {
			//if(document != top.document && strSource.substring(0,3) == "../") strSource = strSource.substring(1,strSource.length);
			p.className = "";
			p.src = strSource;
		}
	}
}

function closePhoto() {
	var pl = document.getElementById("photoLayer");
	var p = document.getElementById("photoLayerPhoto");
	pl.className = "invisible";
	p.src = oneMomentSrc;
	p.className = "noborder";
}

/*window.onload = function () {
	var imgs = document.getElementsByTagName("a");
	for(x=0;x<imgs.length;x++) {
		if(imgs[x].className == "thumbnail") {
			imgs[x].onclick = function (e) {
				var imgThumbnail;
				var e;
				var imgURL;
				if(!e) { // ie
					e = window.event;
					imgThumbnail = e.srcElement.parentNode;
					imgURL = imgThumbnail.getAttribute("href");
				} else { // mozilla
					imgThumbnail = e.target.parentNode;
					imgThumbnail.getAttribute("href");
					imgURL = imgThumbnail.getAttribute("href");
					//alert(imgURL);
				}
				//alert(window.event);
				//alert(imgThumbnail.getAttribute("href"));
				showPhoto(imgURL);
				e.returnValue = false;
				e.cancelBubble = true;
				return false;
			}
		}
	}
}*/