<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Contact Sheet Preview</title>
	<style type="text/css">
		* { margin: 0; padding: 0; }
		html {
			width: 100%;
			height: 100%;
		}
		body {
			text-align: center;
			background-color: #707070;
			margin: 10px 10px 10px 10px;
		}
	</style>
	<script>
		var ratio = 1;
		var zoom = 1;
		function bodyLoad() {
			ratio = img.width / img.height;
			bodyResize();
		}
		function bodyResize() {
			var h = window.innerHeight - 20;
			var w = window.innerWidth - 20;
			if (h <= 0 || w <= 0)
			{
				img.width = 0;
				img.height = 0;
				return;
			}
			
			if (ratio * h > w) {
				img.width = w * zoom;
			}
			else {
				img.width = h * ratio * zoom;
			}
		}
		function imgClick() {
			if (!event.altKey && !event.shiftKey) {
				if (zoom >= 5)
					return;
				zoom = zoom * 1.5;
				img.width = img.width * 1.5;
			}
			else {
				if (zoom <= 0.2)
					return;
				zoom = zoom / 1.5;
				img.width = img.width / 1.5;
			}
		}
	</script>
</head>

<body onload="javascript:bodyLoad()" onresize="javascript:bodyResize()">
	<img style="cursor:pointer" id="img" src="preview.jpg" onclick="javascript:imgClick()"/>
</body>
</html>
