<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/">
<head>
<title>${page.title}</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.3.0
build: 3167
*/
html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}

@font-face {
font-family: "Courier";
font-style: normal;
font-weight: normal;
src: url(fonts/Courier.ttf);
}

div.fs {
  height: ${page.height}px;
  width: ${page.width}px;
  position: relative;
  background-image:url('${img_src}');
  background-size:${page.width}px ${page.height}px;
  background-repeat:no-repeat;
}

div.fs a {
  display: block;
  width : 100%;
  height: 100%;
}

div.fs div {
  position: absolute;
}

img.singlePage {
  position: absolute;
  height: ${page.height}px;
  width: ${page.width}px;

}

div.target-mag {
  position: absolute;
  display: block; /* default hidden */
  overflow: hidden;
  /* UI Styling */
  border: 5px solid  #000000;
  background-color: #FFFFEF;
}

/* !!COMICS!!
 Parent container that hosts both the light box and the image.
 Is required as the light box needs an opacity independent of the the image.
*/
div.target-mag-parent {
	width:100%;
	height:100%;
	display:none;
}

/* !!COMICS!!
  Light box only.
*/
div.target-mag-lb {
	width:100%;
	height:100%;
	background: #333333;
	opacity:.8;
}
${page.style}

<py:for each="mag in page">

#${mag.target_id} {
  top: ${mag.top}%;
  left: ${mag.left}%;
  height: ${mag.height}%;
  width: ${mag.width}%;
}


#${mag.target_id} img {
  top: ${mag.img_top}%;
  left: ${mag.img_left}%;
}

</py:for>
</style>
</head>
<body>
<div class="fs">
<py:for each="mag in page">
  <div id="${mag.target_id}">
    <py:choose>
    <py:when test="mag.txt">
      <a class="app-amzn-magnify" data-app-amzn-magnify='{targetId:&auot;${mag.target_id_parent}", "sourceId":"${mag.target_id}_source", "ordinal":${mag.ordinal}}'>
        <div id="${mag.target_id}_source">
          ${mag.txt}
        </div>
    </a>
    </py:when>
    <py:otherwise>
      <a class="app-amzn-magnify" data-app-amzn-magnify='""{targetId:&quot;${mag.target_id_parent}&quot;foo, ordinal:${mag.ordinal}}'></a>
    </py:otherwise>
    </py:choose>
  </div>
</py:for>
<py:for each="mag in page">
  <div id="${mag.target_id_parent}" class="target-mag-parent">
    <div class="target-mag-lb"></div>
    <div id="${mag.target_id}" class="target-mag">
      <img src="${img_src}" alt=""/>
    </div>
  </div>
</py:for>
${body}
</div>
</body>
</html>
