<?xml version="1.0"?>
<!--@+leo-->

<!--@+node:0::@file sbx_sbookt.xsl-->
<!--@+body-->
<!--@@first <?xml version="1.0"?>-->
<!--@@language html-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>

<xsl:variable name="pageCount" select="count(/screenbook/pages/page)"/>

<!--@<< main template >>-->
<!--@+node:1::<< main template >>-->
<!--@+body-->
<!--@@code-->

<xsl:template match="/">

  <html>
    
<!--@<< head >>-->
	<!--@+node:1::<< head >>-->
	<!--@+body-->
	<!--@@code-->
	  
	<head>
	  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> 
	  <meta name="keywords" content="{../../keywords}" />
	  <meta name="description" content="{../../description}"/>
	  <title>
	  <xsl:value-of select="../../title"/> : <xsl:value-of select="title"/>
	  </title>
	  <link rel='stylesheet' type='text/css' href='../../../../sbook1.css'/>
	  <script src='../../../../sbook.js'></script>
	  <script>init2()</script>
	  <style type="text/css">
		BODY {margin-top:0}
	  </style>
	 </head>
	<!--@-body-->
	<!--@-node:1::<< head >>-->

    
<!--@<< body >>-->
	<!--@+node:2::<< body >>-->
	<!--@+body-->
	<!--@@code-->
	
	<body topmargin="0" leftmargin="0" rightmargin="0" marginheight="0" marginwidth="0">
	<div id='Layer2' class="layer2" style="position:absolute; width:640px; z-index:2; left: 10px; top: 4px"> 
	  <table width='660' border='0' align='left' bgcolor='#999999'>
	    <tr>
	    <td class='txt2'>&#160;
	      <span class='txt1'>&#160;<xsl:value-of select="/screenbook/category"/> : <xsl:value-of select="/screenbook/subcategory"/></span>
	      <span class='txt3'>&#160; &#160;<xsl:value-of select="/screenbook/title"/></span> &#160;
	    </td>
	    </tr>
	  </table>
	</div>
	
	<div id='Layer3' style='position:absolute; width:640px; z-index:2; left: 10px; top: 35px'> 
	<span class='txt4'>Screenbook Thumbnail View: Click on an image to go to the page.</span>
	<br/>
	<br/>
	<xsl:apply-templates select="//pages" />
	
	</div>
	</body>

	<!--@-body-->
	<!--@-node:2::<< body >>-->

  </html>
  
</xsl:template>


<!--@-body-->
<!--@-node:1::<< main template >>-->


<!--@<< call-templates >>-->
<!--@+node:2::<< call-templates >>-->
<!--@+body-->
<!--@@code-->


 <!-- The template for the items to be printed into a table. This is where the <table> tag gets printed. --> 
 <xsl:template match="pages">
   <!-- table rows are built with general purpose table routine: "makeRows"
       "c" is the number of columns
       "content" is the nodeset of items to be put in cells
       "counter" is always 1 --> 
   <table border="0" cellspacing="2" cellpadding="6" bgcolor="slate">
   <xsl:call-template name="makeRows">
     <xsl:with-param name="content" select="page" /> 
     <xsl:with-param name="c" select="4" /> 
     <xsl:with-param name="counter" select="1" />
	 <xsl:with-param name="myIndex" select="1"/> 
   </xsl:call-template>
   </table>
</xsl:template>

 <!--  The template for printing the table rows  --> 
 <xsl:template name="makeRows">
   <xsl:param name="content" /> 
   <xsl:param name="c" /> 
   <xsl:param name="myIndex" />
   <!--  print c cols (one row)  --> 
   <tr>
   <xsl:call-template name="makeCols">
     <xsl:with-param name="content" select="$content[position() &lt; ($c + 1)]" /> 
     <xsl:with-param name="c" select="$c" /> 
     <xsl:with-param name="counter" select="1" />
	 <xsl:with-param name="myIndex" select="$myIndex" /> 
   </xsl:call-template>
   </tr>
   <!--  recurse to print the remaining rows  --> 
   <xsl:if test="$content[position() > $c]">
   <xsl:call-template name="makeRows">
     <xsl:with-param name="content" select="$content[position() &gt; $c]" /> 
     <xsl:with-param name="c" select="$c" />
	 <xsl:with-param name="myIndex" select="$myIndex + $c" /> 
   </xsl:call-template>
   </xsl:if>
 </xsl:template>
 
 <!--  The template for printing the table columns --> 
 <xsl:template name="makeCols">
   <xsl:param name="content" /> 
   <xsl:param name="c" /> 
   <xsl:param name="counter" />
   <xsl:param name="myIndex" /> 
   <!-- print out c (number of) cells --> 
   <xsl:if test="not($counter > $c)">
   <td class='cpblack' valign='top' bgcolor="white">
     <xsl:if test="$content">
     <xsl:call-template name="pageCell">
	   <xsl:with-param name="myIndex" select="$myIndex"/>
	   <xsl:with-param name="page" select="$content[1]"/>
	 </xsl:call-template>
     </xsl:if>
   </td>
   <!--  if there are any left, recurse  --> 
   <xsl:call-template name="makeCols">
     <xsl:with-param name="content" select="$content[position() != 1]" /> 
     <xsl:with-param name="c" select="$c" /> 
     <xsl:with-param name="counter" select="$counter + 1" /> 
     <xsl:with-param name="myIndex" select="$myIndex + 1" />
   </xsl:call-template>
   </xsl:if>
 </xsl:template>
 
 <!-- one page -->
 <xsl:template name="pageCell">
   <xsl:param name="myIndex"/>
   <xsl:param name="page"/>
   <b>
   <a>
   <xsl:attribute name="href">slide<xsl:if test="$myIndex &lt; 10">0</xsl:if><xsl:value-of select="$myIndex"/>.htm</xsl:attribute>
   <xsl:value-of select="$myIndex"/>
   </a>
   </b>&#160; <xsl:value-of select="$page/title" disable-output-escaping="yes"/>
   <br/>
   <xsl:choose>
   <xsl:when test="$page/picture='[Empty]'">
   </xsl:when>  
   <xsl:otherwise>
     <a>
	 <xsl:attribute name="href">slide<xsl:if test="$myIndex &lt; 10">0</xsl:if><xsl:value-of select="$myIndex"/>.htm</xsl:attribute>
	 <img border="0" src="{$page/picture}" width="{$page/picture/@width div 4}" height="{$page/picture/@height div 4}" vspace="6" />
     </a>
   </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
 <xsl:template name="pageLink">
 
 </xsl:template>


<!--@-body-->
<!--@-node:2::<< call-templates >>-->

</xsl:stylesheet>



<!--@-body-->
<!--@-node:0::@file sbx_sbookt.xsl-->
<!--@-leo-->