<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:rss="http://purl.org/rss/1.0/"
  xmlns="http://www.w3.org/1999/xhtml">

<xsl:output method = "html" />



<xsl:template match="scoTP">
	<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<title><xsl:apply-templates select="scoTitle/en"/></title>
			<script language="JavaScript" type="text/JavaScript" src="scripts1.js"></script>
			<link rel="stylesheet" type="text/css" href="style1.css" title="paul" />
		</head>

		<body onLoad="loaded()">
			
			<!-- Ugly hack for Firefox -->
			<xsl:text disable-output-escaping="yes">.</xsl:text>

			<div id="scoTitle">
				<h1><xsl:apply-templates select="scoTitle/en"/></h1>
				<h2><xsl:apply-templates select="scoSubTitle/en"/></h2>
			</div>


		<!-- Menu -->

			<div id="picci" style="position:absolute"></div>
			<div id="piccb" style="position:absolute"></div>
			<div id="piccc" style="position:absolute"></div>
			<div id="list-menu">
				<ul class="menu">
				<xsl:apply-templates select="scoSection">
					<xsl:with-param name = "A" >menu</xsl:with-param>
				</xsl:apply-templates>
			</ul></div>

			<xsl:apply-templates select="scoSection">
				<xsl:with-param name = "A" >text</xsl:with-param>
			</xsl:apply-templates>

		</body>
	</html>
</xsl:template>



<xsl:template match="scoSection">
	<xsl:param name="A">undefined</xsl:param>
	<xsl:choose>
         <xsl:when test="$A = 'menu'">
				<li>
					<xsl:attribute name="onmouseover">dSM(<xsl:number />)</xsl:attribute>
					<xsl:attribute name="onmouseout">hSM(<xsl:number />)</xsl:attribute>


					<ul>
						<xsl:attribute name="class">subMenu</xsl:attribute>
						<xsl:attribute name="id">subMenu<xsl:number /></xsl:attribute>
						<xsl:apply-templates select="scoPage">
							<xsl:with-param name = "A" >
								<xsl:value-of select="$A" />
							</xsl:with-param>
							<xsl:with-param name = "secnum" >
								<xsl:number />
							</xsl:with-param>

						</xsl:apply-templates>
					</ul>

					<a>
						<xsl:attribute name="href">#</xsl:attribute>
						<xsl:attribute name="onClick">return makePage('<xsl:number />-1')</xsl:attribute>
						<xsl:apply-templates select="scomenuTitle/en"/>
					</a>




				</li>
			 </xsl:when>
          <xsl:otherwise>

					<xsl:apply-templates select="scoPage">
							<xsl:with-param name = "A" >
								<xsl:value-of select="$A" />
							</xsl:with-param>
							<xsl:with-param name = "secnum" >
								<xsl:number />
							</xsl:with-param>
							<xsl:with-param name = "sectit" >
								<xsl:apply-templates select="scomenuTitle/en"/>
							</xsl:with-param>
							<xsl:with-param name = "B" >
								<xsl:value-of select='count(scoPage)' />
							</xsl:with-param>
						</xsl:apply-templates>

			 </xsl:otherwise>
	</xsl:choose>

</xsl:template>

<xsl:template match="scomenuTitle/en">
	<xsl:value-of select="text()"/>
</xsl:template>

<xsl:template match="scoPage">
	<xsl:param name="A">undefined</xsl:param>
	<xsl:param name="secnum">undefined</xsl:param>
	<xsl:param name="sectit">undefined</xsl:param>
	<xsl:param name="B">undefined</xsl:param>

	<xsl:choose>
		<xsl:when test="$A = 'menu'">
			<li>
				<a>
					<xsl:attribute name="href">#</xsl:attribute>
					<xsl:attribute name="onClick">return getDiv('page<xsl:value-of select="$secnum" />-<xsl:number />')</xsl:attribute>
			Page <xsl:number />
				</a>
			</li>
		</xsl:when>
		<xsl:otherwise>
<xsl:value-of select="@jpgURL"/>
			<!-- Page Paragraph Content -->
			<div style="display:none">
				<xsl:attribute name="ID">page<xsl:value-of select="$secnum" />-<xsl:number /></xsl:attribute>
				<xsl:for-each select="scoPara/en">
					<p>
					<xsl:value-of disable-output-escaping="yes" select="."/>
					</p>
				</xsl:for-each>
			</div>

			<!-- Page Sco Info Content -->
			<div style="display:none">
				<xsl:attribute name="ID">info<xsl:value-of select="$secnum" />-<xsl:number /></xsl:attribute>
				<xsl:for-each select="scoInfo/en">
					<p>
					<xsl:value-of disable-output-escaping="yes" select="."/>
					</p>
				</xsl:for-each>

			</div>

			<!-- Page Turner Content -->
			<div style="display:none">
				<xsl:attribute name="ID">turn<xsl:value-of select="$secnum" />-<xsl:number /></xsl:attribute>

				<!-- Left Arrow -->
				<xsl:choose>
					<xsl:when test="position() = 1">	<!-- At page 1, no link -->
						<img src="arr_l_g.gif"/>
					</xsl:when>				
					<xsl:otherwise>				<!-- At any other page, link -->
						<a>
							<xsl:attribute name="href">#</xsl:attribute>
							<xsl:attribute name="class">left</xsl:attribute>
							<xsl:attribute name="onClick">return makePage('<xsl:value-of select="$secnum" />-<xsl:value-of select="(position()-1)"/>')</xsl:attribute>
							<img src="arr_l_b.gif" border="0"/>
						</a>
					</xsl:otherwise>
				</xsl:choose>

				<!-- Page number -->
				Page <b><xsl:number /> - <xsl:value-of select="$B" /></b>

				<!-- Right Arrow -->
				<xsl:choose>					<!-- Last page 1, no link -->
					<xsl:when test="position() = last()">
						<img src="arr_r_g.gif"/>
					</xsl:when>
					<xsl:otherwise>				<!-- At any other page, link -->
						<a>
							<xsl:attribute name="href">#</xsl:attribute>
							<xsl:attribute name="class">right</xsl:attribute>
							<xsl:attribute name="onClick">return makePage('<xsl:value-of select="$secnum" />-<xsl:value-of select="(position()+1)"/>')</xsl:attribute>
							<img src="arr_r_b.gif" border="0"/>
						</a>		
					</xsl:otherwise>
				</xsl:choose>
			</div>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template match="scoTitle/en">
	<xsl:value-of select="text()"/>
</xsl:template>


</xsl:stylesheet>


