﻿<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ 
    <!ENTITY laquo "&#171;"> 
    <!ENTITY raquo "&#187;"> 
    ]> 
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml">

<xsl:output method="xml" encoding="UTF-8" indent="yes"/> 


	<xsl:template match="/">



		<xsl:for-each select="//xhtml:div[@class='page']">
			<xsl:variable name="slideFile">slide_<xsl:value-of select="position()"/>.html</xsl:variable>
			
			<xsl:value-of select="$slideFile"/>
			
			<xsl:document href="{$slideFile}" encoding="UTF-8" indent="yes" method="xml" >
			
			
			
			<html>
				<head>
					<title><xsl:value-of select="xhtml:h1"/></title>
					<link rel="stylesheet" href="slide.css" type="text/css" />
					<meta content="text/html; charset=UTF-8" http-equiv="Content-type" />
					
					<script language="javascript"><xsl:comment>

              document.onkeypress = flipslide;
              function flipslide(evt) {
     
              var key = (evt) ? evt.which : window.event.keyCode;
                if (key == 32 || key == 29 || key == 30 || key == 11) {
                  
					<xsl:if test="(position()=last())">
						location.href="slide_0.html";
					</xsl:if>
					<xsl:if test="(position() != last())">
						location.href="<xsl:value-of select="concat('slide_', position()+1, '.html')"/>";					</xsl:if>
                    
                  
                }
              } //  </xsl:comment> </script>					
				</head>
				<body marginheight="0" marginwidth="0">


				<xsl:element name="a">
					<xsl:attribute name="id">navBack</xsl:attribute>
					<xsl:attribute name="class">nav</xsl:attribute>
					<xsl:attribute name="href"><xsl:value-of select="concat('slide_', position()-1, '.html')"/></xsl:attribute>
				&laquo;
				</xsl:element>

				<xsl:element name="a">
					<xsl:attribute name="id">navForward</xsl:attribute>
					<xsl:attribute name="class">nav</xsl:attribute>
					<xsl:if test="(position()=last())">
						<xsl:attribute name="href">slide_0.html</xsl:attribute>
					</xsl:if>
					<xsl:if test="(position() != last())">
						<xsl:attribute name="href"><xsl:value-of select="concat('slide_', position()+1, '.html')"/></xsl:attribute>
					</xsl:if>
					
				&raquo;
				</xsl:element>
				

			
	
				
				
				

				
					<xsl:copy-of select="*"/>
					
					<div class="footer">
					<xsl:value-of select="position()"/> / <xsl:value-of select="last()"/>
					</div>
				
				</body>
			</html>
			
			
			
			
			
			
			
			
			
			</xsl:document>
		</xsl:for-each>
	</xsl:template>
	
	
	
	
	



	<xsl:template match="text()">
		<xsl:apply-templates/>
	</xsl:template>
</xsl:stylesheet>
