function imgOpen(imgpath, natWidth, natHeight)
{
	/* get viewport rect */
	if (typeof window.innerWidth != 'undefined') {
		/* compliant browsers */
		viewPortWidth = window.innerWidth;
		viewPortHeight = window.innerHeight;
	} else if (typeof document.documentElement != 'undefined'
		&& typeof document.documentElement.clientWidth != 'undefined'
		&& document.documentElement.clientWidth != 0) {
		/* IE6 in standards compliant mode */
		viewPortWidth = document.documentElement.clientWidth;
		viewPortHeight = document.documentElement.clientHeight;
	} else {
		/* older versions of IE */
		viewPortWidth = document.getElementsByTagName('body')[0].clientWidth;
		viewPortHeight = document.getElementsByTagName('body')[0].clientHeight;
	}
	/* work out img coords */
	aspectRatio = natHeight / natWidth;
	if (aspectRatio > (viewPortHeight / viewPortWidth)) {
		photoHeight = viewPortHeight * 0.9;
		photoWidth = viewPortHeight * 0.9 / aspectRatio;
	} else {
		photoWidth = viewPortWidth * 0.9;
		photoHeight = viewPortWidth * 0.9 * aspectRatio;
	}
	/* avoid expanding */
	if ((photoWidth > natWidth) || (photoHeight > natHeight)) {
		photoWidth = natWidth;
		photoHeight = natHeight;
	}
	photoLeft = (viewPortWidth - photoWidth) / 2.0;
	photoTop = (viewPortHeight - photoHeight) / 2.0;
	/* update elements */
	theCover = document.getElementById("imgCover");
	theCover.style.display = "block";
	thePlate = document.getElementById("imgPlate");
	thePlate.src = imgpath;
	thePlate.style.display = "block";
	thePlate.style.left = Math.round(photoLeft-5) + "px";
	thePlate.style.top = Math.round(photoTop-5) + "px";
	thePlate.style.width = Math.round(photoWidth) + "px";
	thePlate.style.height = Math.round(photoHeight) + "px";
	return false;
}

function imgClose()
{
	thePlate = document.getElementById("imgPlate");
	thePlate.style.display = "none";
	thePlate.src = "";
	theCover = document.getElementById("imgCover");
	theCover.style.display = "none";
}

function showPhotoInfo(on)
{
	theInfo = document.getElementById("photoinfo");
	theInfo.style.display = on ? "block" : "none";
}

function showHint(id, on)
{
	theHint = document.getElementById(id);
	theHint.style.display = on ? "inline" : "none";
}


