<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
	<!ENTITY times "&#x00D7;">
	<!ENTITY iuml "&#x00EF;">
	<!ENTITY mdash "&#x2014;">
	<!ENTITY dagger "&#x2020;">
	<!ENTITY Dagger "&#x2021;">
]>
<xsl:stylesheet
	version="1.0"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:svg="http://www.w3.org/2000/svg"
	xmlns:xlink="http://www.w3.org/1999/xlink"
	xmlns:math="http://exslt.org/math"
	extension-element-prefixes="math"
	xmlns:RW="Rune_Words"
	xmlns:RN="Rune"
	xmlns:RI="Rune_Inf"
	xmlns:RC="Rune_Craft"
>
<!-- =================================================================================================== -->
<!-- =============================================== General =========================================== -->
<!-- =================================================================================================== -->
	<xsl:param name="Upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
	<xsl:param name="Lower" select="'abcdefghijklmnopqrstuvwxyz'" />
	<xsl:param name="RInf" select="document('runeinf.xml')" />
	
<!-- =================================================================================================== -->
<!-- =============================================== RuneWord ========================================== -->
<!-- =================================================================================================== -->
	<xsl:template name="RuneWord" match="/RW:RWord">
		<xsl:param name="Runes" select="$RInf/RI:RuneInf/RI:Runes" />
		<xsl:param name="ID" select="@wordid" />
		<xsl:param name="RWord" select="$RInf/RI:RuneInf/RI:Words/RI:Word[@wordid=$ID]" />
		<xsl:param name="Name" select="$RWord/@wordname" />
		<xsl:param name="RuneList" select="$RWord/RI:WordRunes" />
		<xsl:param name="Ttl">
			<xsl:text>Diablo II Rune Word: </xsl:text>
 			<xsl:value-of select="$Name"  />
		</xsl:param>
		<html>
			<head>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
				<meta http-equiv="Content-Style-Type" content="text/css" />
				<link type="text/css" rel="stylesheet" href="../RuneData/runeinf.css" />
				<title><xsl:value-of select="$Ttl" /></title>
			</head>
			<body>
				<h1><xsl:value-of select="$Name" /></h1>
				<div class="runeshow"><xsl:for-each select="$RuneList/RI:WordRune">
					<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="@wrname" /></xsl:call-template>
				</xsl:for-each></div>
				<table id="Runes">
					<caption>Runes</caption>
					<thead><tr>
						<th>Rune</th>
						<th>Name</th>
						<th>Level</th>
						<xsl:choose>
							<xsl:when test="count($RWord/RI:RWItemType) = 1"><th>Effect</th></xsl:when>
							<xsl:otherwise><xsl:for-each select="$RWord/RI:RWItemType">
								<th>
									<xsl:text>Effect (</xsl:text>
									<xsl:value-of select="@base" />
									<xsl:text>)</xsl:text>
								</th>
							</xsl:for-each></xsl:otherwise>

						</xsl:choose>
					</tr></thead>
					<tbody><xsl:for-each select="$RuneList/RI:WordRune">
						<xsl:variable name="WRName" select="@wrname" />
						<xsl:variable name="WRune" select="$Runes/RI:Rune[@rname=$WRName]" />
						<tr>
							<td><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$WRName" /></xsl:call-template></td>
							<td><xsl:call-template name="RuneLink"><xsl:with-param name="RID" select="$WRName" /></xsl:call-template></td>
							<td><xsl:value-of select="$WRune/@lvl" /></td>
							<xsl:for-each select="$RWord/RI:RWItemType"><td><ul>
								<xsl:if test="@base='Armor'">
									<xsl:for-each select="$WRune/*[self::RI:ArmShlds or self::RI:Armor or self::RI:All]">
										<li><xsl:value-of select="." /></li>
									</xsl:for-each>
								</xsl:if>
								<xsl:if test="@base='Shields'">
									<xsl:for-each select="$WRune/*[self::RI:ArmShlds or self::RI:Shields or self::RI:All]">
										<li><xsl:value-of select="." /></li>
									</xsl:for-each>
								</xsl:if>
								<xsl:if test="@base='Weapons'">
									<xsl:for-each select="$WRune/*[self::RI:Weapons or self::RI:All]">
										<li><xsl:value-of select="." /></li>
									</xsl:for-each>
								</xsl:if>
							</ul></td></xsl:for-each>
						</tr>
					</xsl:for-each></tbody>
				</table>
				<h2>Rune Word Information</h2>
				<dl>
					<dt>Items:</dt>
					<dd><xsl:value-of select="count($RWord/RI:WordRunes/RI:WordRune)" />-socketed 
						<xsl:for-each select="$RWord/RI:RWItemType">
							<xsl:if test="position() != 1"><xsl:text>, </xsl:text></xsl:if>
							<xsl:choose>
								<xsl:when test="count(./RI:RWItem) &gt; 1">
									<xsl:for-each select="./RI:RWItem/@type">
										<xsl:if test="position() != 1"><xsl:text>, </xsl:text></xsl:if>
										<xsl:value-of select="." />
									</xsl:for-each>
								</xsl:when>
								<xsl:when test="count(./RI:RWItem/@type) = 1">
									<xsl:value-of select="./RI:RWItem/@type" />
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="./@base" />
								</xsl:otherwise>
							</xsl:choose>
						</xsl:for-each>
					</dd>
					<dt>Word Level:</dt>
					<dd><xsl:value-of select="$Runes/RI:Rune[@rname=$RuneList/RI:WordRune/@wrname][string(number(@lvl)) != 'NaN'][position()=last()]/@lvl" /></dd>
					<xsl:if test="$RWord/@patch">
						<dt>Patch:</dt>
						<dd><xsl:value-of select="$RWord/@patch" /></dd>
					</xsl:if>
					<xsl:if test="$RWord/@intclass">
						<dt>Intended Class:</dt>
						<dd><xsl:value-of select="$RWord/@intclass" /></dd>
					</xsl:if>
					<xsl:if test="$RWord/@restriction">
						<dt>Restriction:</dt>
						<dd><xsl:value-of select="$RWord/@restriction" /></dd>
					</xsl:if>
				</dl>
				<h2>Bonuses</h2>
				<ul><xsl:for-each select="$RWord/RI:Bonuses/RI:Effect">
					<li><xsl:value-of select="." /></li>
				</xsl:for-each></ul>
				<xsl:if test="$RWord/RI:Note">
					<h2>Note(s)</h2>
					<xsl:for-each select="$RWord/RI:Note">
						<p><xsl:value-of select="." /></p>
					</xsl:for-each>
				</xsl:if>
				<div id="Nav">
					<div id="Prev"><xsl:if test="count($RWord/preceding-sibling::*) &gt; 0"><a>
						<xsl:attribute name="href">
							<xsl:text>./</xsl:text>
							<xsl:value-of select="$RWord/preceding-sibling::RI:Word[position()=1]/@wordid" />
							<xsl:text>.xml</xsl:text>
						</xsl:attribute>
						<xsl:value-of select="$RWord/preceding-sibling::RI:Word[position()=1]/@wordname" />
					</a></xsl:if></div>
					<div id="Back"><a href="../RuneData/runeinf.xml">Back To Main</a></div>
					<div id="Next"><xsl:if test="count($RWord/following-sibling::*) &gt; 0"><a>
							<xsl:attribute name="href">
								<xsl:text>./</xsl:text>
								<xsl:value-of select="$RWord/following-sibling::RI:Word[position()=1]/@wordid" />
								<xsl:text>.xml</xsl:text>
							</xsl:attribute>
							<xsl:value-of select="$RWord/following-sibling::RI:Word/@wordname" />
					</a></xsl:if></div>
				</div>
			</body>
		</html>
	</xsl:template>
	
<!-- =================================================================================================== -->
<!-- ================================================= Rune ============================================ -->
<!-- =================================================================================================== -->
	
	<xsl:template name="Rune" match="/RN:Rune">
		<xsl:param name="Runes" select="$RInf/RI:RuneInf/RI:Runes" />
		<xsl:param name="ID" select="@runeid" />
		<xsl:param name="Rune" select="$Runes/RI:Rune[@rname=$ID]" />
		<html>
			<head>
				<meta http-equiv="Content-Style-Type" content="text/css" />
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
				<link type="text/css" rel="stylesheet" href="../RuneData/runeinf.css" />
				<title>Diablo II Rune:  <xsl:value-of select="$ID" /></title>
			</head>
			<body>
				<h1 id="RuneTitle"><xsl:value-of select="$ID" /></h1>
				<div class="runeshow">
					<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$ID" /></xsl:call-template>
					<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$ID" /></xsl:call-template>
					<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$ID" /></xsl:call-template>
					<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$ID" /></xsl:call-template>
				</div>
				<dl>
					<dt>Level:</dt>
					<dd><xsl:value-of select="$Rune/@lvl" /></dd>
					<dt>Effects:</dt>
					<dd><xsl:choose>
						<xsl:when test="count($Rune/*[not(self::RI:UpGrade)]) &gt; 1"><dl>
							<xsl:choose>
								<xsl:when test="$Rune/RI:ArmShlds">
									<dt>Armor and Shields</dt>
									<dd><xsl:value-of select="$Rune/RI:ArmShlds" /></dd>
								</xsl:when>
								<xsl:otherwise>
									<dt>Armor</dt>
									<dd><xsl:value-of select="$Rune/RI:Armor" /></dd>
									<dt>Shields</dt>
									<dd><xsl:value-of select="$Rune/RI:Shields" /></dd>
								</xsl:otherwise>
							</xsl:choose>
							<dt>Weapons:</dt>
							<dd><xsl:value-of select="$Rune/RI:Weapons" /></dd>
							<xsl:if test="$Rune/RI:All">
								<dt>All:</dt>
								<dd><xsl:value-of select="$Rune/RI:All" /></dd>
							</xsl:if>
						</dl></xsl:when>
						<xsl:otherwise><xsl:value-of select="$Rune/RI:All" /></xsl:otherwise>
					</xsl:choose></dd>
					<xsl:if test="$Rune/RI:UpGrade">
						<dt>Upgrade Formula</dt>
						<dd>
							<xsl:value-of select="$Rune/RI:UpGrade/@amount" />
							<xsl:text> &times; </xsl:text>
							<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$ID" /></xsl:call-template>
							<xsl:if test="$Rune/RI:UpGrade/@gemtype">
								<xsl:text> + </xsl:text>
								<xsl:call-template name="GemImg">
									<xsl:with-param name="Qual" select="$Rune/RI:UpGrade/@gemqual" />
									<xsl:with-param name="Type" select="$Rune/RI:UpGrade/@gemtype" />
								</xsl:call-template>
							</xsl:if>
							<xsl:text> = </xsl:text>
							<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$Rune/following-sibling::RI:Rune/@rname" /></xsl:call-template>
						</dd>
					</xsl:if>
				</dl>
				<h2>Rune Words</h2>
				<ol><xsl:for-each select="$RInf/RI:RuneInf/RI:Words/RI:Word[descendant::RI:WordRune[@wrname=$ID]]">
					<xsl:variable name="RunesWord" select="." />
					<li><a>
						<xsl:attribute name="href">
							<xsl:text>../RuneWords/</xsl:text>
							<xsl:value-of select="$RunesWord/@wordid" />
							<xsl:text>.xml</xsl:text>
						</xsl:attribute>
						<xsl:value-of select="$RunesWord/@wordname" />
					</a></li>
				</xsl:for-each></ol>
				<div id="Nav">
					<div id="Prev"><xsl:if test="count($Rune/preceding-sibling::*) &gt; 0">
						<xsl:variable name="PrevRn" select="$Rune/preceding-sibling::RI:Rune[position()=1]/@rname" />
						<xsl:call-template name="RuneLink"><xsl:with-param name="RID" select="$PrevRn" /></xsl:call-template>
						<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$PrevRn" /></xsl:call-template>
					</xsl:if></div>
					<div id="Back"><a href="../RuneData/runeinf.xml">Back To Main</a></div>
					<div id="Next"><xsl:if test="count($Rune/following-sibling::*) &gt; 0">
						<xsl:variable name="NextRn" select="$Rune/following-sibling::RI:Rune[position()=1]/@rname" />
						<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$NextRn" /></xsl:call-template>
						<xsl:call-template name="RuneLink"><xsl:with-param name="RID" select="$NextRn" /></xsl:call-template>
					</xsl:if></div>
				</div>
			</body>
		</html>
	</xsl:template>
	
<!-- =================================================================================================== -->
<!-- =============================================== Crafting ========================================== -->
<!-- =================================================================================================== -->
	
<!-- =================================================================================================== -->
<!-- ================================================= Main ============================================ -->
<!-- =================================================================================================== -->
	<xsl:template name="Main" match="/RI:RuneInf">
		<html>
			<head>
				<meta http-equiv="Content-Style-Type" content="text/css" />
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
				<link type="text/css" rel="stylesheet" href="../RuneData/runeinf.css" />
				<title>Diablo II Runes and Rune Words</title>
			</head>
			<body>
				<h1>Diablo 2: Lord of Destruction Runes and Rune Words</h1>
				<div class="runeshow"><xsl:for-each select="RI:Runes/RI:Rune">
					<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="@rname" /></xsl:call-template>
				</xsl:for-each></div>
				<p>Runes were introduced in <cite>Diablo II: Lord of Destruction</cite> as a way to extend gems into a sort of <q>set</q>, where specific runes could be placed in socketed items and&mdash; if placed in the right order on the right type of equipment&mdash;give extra bonuses to the item in question.  This specific order is known as a <strong>Rune Word</strong>.  Rune words have the following restrictions:</p>
				<ol>
					<li>They must be placed on the right type of item.</li>
					<li>The item must have the exact number of sockets required&mdash;a 3-rune word will not work on an item that has more than three sockets.</li>
					<li>The runes <em>must be in order</em>.</li>
					<li>Lastly, some rune words only work on the Online Ladder.</li>
				</ol>
				<p>Runes can also be used for Crafted Items.</p>
				<p><a href="../../../oddsends.php">(Back to Odds and Ends)</a></p>
				<h2>Runes</h2>
				<p>There are a total of <xsl:value-of select="count(RI:Runes/RI:Rune)" /> runes.  From lowest to highest, they are:</p>
				<table>
					<thead><tr>
						<xsl:for-each select="RI:Runes/RI:Rune[@num mod 11=0]">
							<xsl:if test="@num &gt; 11"><td class="col" /></xsl:if>
							<th>Num</th>
							<th>Name</th>
							<th>Rune</th>
							<th>Level</th>
						</xsl:for-each>
					</tr></thead>
					<tfoot><tr><td>
						<xsl:attribute name="colspan">
							<xsl:value-of select="(count(RI:Runes/RI:Rune[@num mod 11=0]) * 4) + ceiling(count(RI:Runes/RI:Rune) div 11) - 1" />
						</xsl:attribute>
						<p>* - These can only be upgraded on Single-Player, Open, or Ladder realms.</p>
						<p>&dagger; - The Hel rune has no level requirement.</p>
					</td></tr></tfoot>
					<tbody><xsl:for-each select="RI:Runes/RI:Rune[@num &lt;= 11]"><tr>
						<xsl:variable name="RName1" select="@rname" />
						<td><xsl:value-of select="@num" /></td>
						<td>
							<xsl:if test="@num &gt; 13"><xsl:text>* </xsl:text></xsl:if>
							<xsl:if test="$RName1 = 'Hel'"><xsl:text>&dagger; </xsl:text></xsl:if>
							<xsl:call-template name="RuneLink"><xsl:with-param name="RID" select="$RName1" /></xsl:call-template>
						</td>
						<td><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$RName1" /></xsl:call-template></td>
						<td><xsl:value-of select="@lvl" /></td>
						
						<td class="col" />
						
						<xsl:variable name="Rune2" select="following-sibling::RI:Rune[position()=11]" />
						<xsl:variable name="RName2" select="$Rune2/@rname" />
						<td><xsl:value-of select="$Rune2/@num" /></td>
						<td>
							<xsl:if test="$Rune2/@num &gt; 13"><xsl:text>* </xsl:text></xsl:if>
							<xsl:if test="$RName2 = 'Hel'"><xsl:text>&dagger; </xsl:text></xsl:if>
							<xsl:call-template name="RuneLink"><xsl:with-param name="RID" select="$RName2" /></xsl:call-template>
						</td>
						<td><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$RName2" /></xsl:call-template></td>
						<td><xsl:value-of select="$Rune2/@lvl" /></td>
						
						<td class="col" />
						
						<xsl:variable name="Rune3" select="following-sibling::RI:Rune[position()=22]" />
						<xsl:variable name="RName3" select="$Rune3/@rname" />
						<td><xsl:value-of select="$Rune3/@num" /></td>
						<td>
							<xsl:if test="$Rune3/@num &gt; 13"><xsl:text>* </xsl:text></xsl:if>
							<xsl:if test="$RName3 = 'Hel'"><xsl:text>&dagger; </xsl:text></xsl:if>
							<xsl:call-template name="RuneLink"><xsl:with-param name="RID" select="$RName3" /></xsl:call-template>
						</td>
						<td><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="$RName3" /></xsl:call-template></td>
						<td><xsl:value-of select="$Rune3/@lvl" /></td>
						
					</tr></xsl:for-each></tbody>
				</table>
				<p>It is the runes themselves that dictate what level you have to be to use a runeword (that is, you have to be able to use the highest-level rune to use the full word.</p>
				<p>A little fun fact for you:  here are the rankings of runes according to how many words use them:</p>
				<dl>
					<dt>1<sup>st</sup> Place</dt>
					<dd><xsl:call-template name="RuneImg">
						<xsl:with-param name="RID" select="'Tir'" />
						<xsl:with-param name="Named" select="'yes'" />
						<xsl:with-param name="Linked" select="'yes'" />
					</xsl:call-template> (14 words)</dd>
					<dt>2<sup>nd</sup> Place</dt>
					<dd><xsl:call-template name="RuneImg">
						<xsl:with-param name="RID" select="'Mal'" />
						<xsl:with-param name="Named" select="'yes'" />
						<xsl:with-param name="Linked" select="'yes'" />
					</xsl:call-template> (13 words)</dd>
					<dt>3<sup>rd</sup> Place</dt>
					<dd>
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Eth'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Amn'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>
						(12 words)
					</dd>
					<dt>5<sup>th</sup> Place</dt>
					<dd><xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Sol'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template> (11 words)</dd>
					<dt>6<sup>th</sup> Place</dt>
					<dd>
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Ral'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Ko'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Um'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Lo'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Jah'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>
						(10 words)
					</dd>
					<dt>11<sup>th</sup> Place</dt>
					<dd>
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Ort'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Shael'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>
						(9 words)
					</dd>
					<dt>13<sup>th</sup> Place</dt>
					<dd>
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'El'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Thul'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Hel'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Lum'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Lem'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Ber'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>
						(8 words)
					</dd>
					<dt>19<sup>th</sup> Place</dt>
					<dd>
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Tal'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Dol'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Pul'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Ist'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Vex'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Ohm'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Sur'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						(7 words)
					</dd>
					<dt>26<sup>th</sup> Place</dt>
					<dd>
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Eld'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Nef'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Ith'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Io'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Fal'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>,
						<xsl:call-template name="RuneImg">
							<xsl:with-param name="RID" select="'Gul'" />
							<xsl:with-param name="Named" select="'yes'" />
							<xsl:with-param name="Linked" select="'yes'" />
						</xsl:call-template>
						(6 words)
					</dd>
					<dt>32<sup>nd</sup> Place</dt>
					<dd><xsl:call-template name="RuneImg">
						<xsl:with-param name="RID" select="'Cham'" />
						<xsl:with-param name="Named" select="'yes'" />
						<xsl:with-param name="Linked" select="'yes'" />
					</xsl:call-template> (3 words)</dd>
				</dl>
				<p>Unsurprisingly, the highest-ranked run, <xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Zod'" /><xsl:with-param name="Named" select="'yes'" /><xsl:with-param name="Linked" select="'yes'" /></xsl:call-template>, comes in dead last, being used only in <xsl:call-template name="WordLink"><xsl:with-param name="WordId" select="'breath_of_the_dying'" /></xsl:call-template>.</p>
				<p>Five runes are used more than once in a rune word:  
					<xsl:call-template name="RuneImg">
						<xsl:with-param name="RID" select="'Ko'" />
						<xsl:with-param name="Named" select="'yes'" />
					</xsl:call-template> is used twice in <xsl:call-template name="WordLink"><xsl:with-param name="WordId" select="'sanctuary'" /></xsl:call-template>, 
					<xsl:call-template name="RuneImg">
						<xsl:with-param name="RID" select="'Um'" />
						<xsl:with-param name="Named" select="'yes'" />
					</xsl:call-template> (twice in <xsl:call-template name="WordLink"><xsl:with-param name="WordId" select="'bone'" /></xsl:call-template>),
					<xsl:call-template name="RuneImg">
						<xsl:with-param name="RID" select="'Vex'" />
						<xsl:with-param name="Named" select="'yes'" />
					</xsl:call-template> (twice in <xsl:call-template name="WordLink"><xsl:with-param name="WordId" select="'phoenix'" /></xsl:call-template>), 					<xsl:call-template name="RuneImg">
						<xsl:with-param name="RID" select="'Ber'" />
						<xsl:with-param name="Named" select="'yes'" />
					</xsl:call-template> (twice in <xsl:call-template name="WordLink"><xsl:with-param name="WordId" select="'infinity'" /></xsl:call-template>), and 
					<xsl:call-template name="RuneImg">
						<xsl:with-param name="RID" select="'Jah'" />
						<xsl:with-param name="Named" select="'yes'" />
					</xsl:call-template>, which is used <em>thrice</em> in <xsl:call-template name="WordLink"><xsl:with-param name="WordId" select="'last_wish'" /></xsl:call-template>.</p>
				<p>Speaking of Rune Words...</p>
				<h2>Rune Words</h2>
				<p>Below are the <xsl:value-of select="count(RI:Words/RI:Word)" /> Rune Words.</p>
				<ul id="RuneWordList"><xsl:for-each select="RI:Words/RI:Word">
					<xsl:variable name="WordId" select="@wordid" />
					<li>
						<h3><xsl:call-template name="WordLink"><xsl:with-param name="WordEl" select="." /></xsl:call-template></h3>
						<div class="runeshow"><xsl:for-each select="RI:WordRunes/RI:WordRune">
							<xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="@wrname" /></xsl:call-template>
						</xsl:for-each></div>
						<p>Level <xsl:value-of select="/RI:RuneInf/RI:Runes/RI:Rune[@rname = //RI:Word[@wordid=$WordId]/RI:WordRunes/RI:WordRune/@wrname][string(number(@lvl)) != 'NaN'][position() = last()]/@lvl" /></p>
						<p><xsl:for-each select="RI:RWItemType">
							<xsl:if test="position() != 1"><xsl:text>, </xsl:text></xsl:if>
							<xsl:choose>
								<xsl:when test="count(./RI:RWItem/@type) &gt; 1">
									<xsl:for-each select="./RI:RWItem/@type">
										<xsl:if test="position() != 1"><xsl:text>, </xsl:text></xsl:if>
										<xsl:value-of select="." />
									</xsl:for-each>
								</xsl:when>
								<xsl:when test="count(./RI:RWItem/@type) = 1">
									<xsl:value-of select="./RI:RWItem/@type" />
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="./@base" />
								</xsl:otherwise>
							</xsl:choose>
						</xsl:for-each></p>
						<xsl:if test="@restriction = 'Online Ladder Only'"><p>Online Ladder Only</p></xsl:if>
						<xsl:if test="@intclass"><p>Intended for the <xsl:value-of select="@intclass" /></p></xsl:if>
					</li>	
				</xsl:for-each></ul>
				<h2>Crafted Items</h2>
				<p>Crafted items are a type of Rare Items that can only be created by The Horadric Cube. Unlike most magic or rare items, they have certain fixed properties, along with random properties on top.</p>
				<p>They are created using a perfect gem, a jewel of any kind, an item of the specified kind, and a rune.</p>
				<table>
					<caption>The Crafted Items</caption>
					<thead><tr>
						<th id="Type" rowspan="2">Type</th>
						<th id="Gem" rowspan="2">Gem</th>
						<th colspan="9">Rune For:</th>
					</tr><tr>
						<th id="Helm"  >Helm</th>
						<th id="Boots" >Boots</th>
						<th id="Gloves">Gloves</th>
						<th id="Belt"  >Belt</th>
						<th id="Shield">Shield</th>
						<th id="Body"  >Body</th>
						<th id="Amulet">Amulet</th>
						<th id="Ring"  >Ring</th>
						<th id="Weapon">Weapon</th>
					</tr></thead>
					<tbody>
						<tr>
							<td header="Type">Hit Power</td>
							<td header="Gem"><xsl:call-template name="GemImg">
								<xsl:with-param name="Qual" select="'Perfect'" />
								<xsl:with-param name="Type" select="'Sapphire'" />
							</xsl:call-template></td>
							<td headers="Helm"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ith'" /></xsl:call-template></td>
							<td headers="Boots" ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ral'" /></xsl:call-template></td>
							<td headers="Gloves"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ort'" /></xsl:call-template></td>
							<td headers="Belt"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Tal'" /></xsl:call-template></td>
							<td headers="Shield"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Eth'" /></xsl:call-template></td>
							<td headers="Body"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Nef'" /></xsl:call-template></td>
							<td headers="Amulet"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Thul'"/></xsl:call-template></td>
							<td headers="Ring"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Amn'" /></xsl:call-template></td>
							<td headers="Weapon"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Tir'" /></xsl:call-template></td>
						</tr>
						<tr>
							<td header="Type">Blood</td>
							<td header="Gem" ><xsl:call-template name="GemImg">
								<xsl:with-param name="Qual" select="'Perfect'" />
								<xsl:with-param name="Type" select="'Ruby'" />
							</xsl:call-template></td>
							<td headers="Helm"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ral'" /></xsl:call-template></td>
							<td headers="Boots" ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Eth'" /></xsl:call-template></td>
							<td headers="Gloves"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Nef'" /></xsl:call-template></td>
							<td headers="Belt"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Tal'" /></xsl:call-template></td>
							<td headers="Shield"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ith'" /></xsl:call-template></td>
							<td headers="Body"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Thul'"/></xsl:call-template></td>
							<td headers="Amulet"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Amn'" /></xsl:call-template></td>
							<td headers="Ring"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Sol'" /></xsl:call-template></td>
							<td headers="Weapon"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ort'" /></xsl:call-template></td>
						</tr>
						<tr>
							<td header="Type">Caster</td>
							<td header="Gem" ><xsl:call-template name="GemImg">
								<xsl:with-param name="Qual" select="'Perfect'" />
								<xsl:with-param name="Type" select="'Amethyst'" />
							</xsl:call-template></td>
							<td headers="Helm"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Nef'" /></xsl:call-template></td>
							<td headers="Boots" ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Thul'"/></xsl:call-template></td>
							<td headers="Gloves"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ort'" /></xsl:call-template></td>
							<td headers="Belt"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ith'" /></xsl:call-template></td>
							<td headers="Shield"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Eth'" /></xsl:call-template></td>
							<td headers="Body"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Tal'" /></xsl:call-template></td>
							<td headers="Amulet"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ral'" /></xsl:call-template></td>
							<td headers="Ring"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Amn'" /></xsl:call-template></td>
							<td headers="Weapon"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Tir'" /></xsl:call-template></td>
						</tr>
						<tr>
							<td header="Type">Safety</td>
							<td header="Gem" ><xsl:call-template name="GemImg">
								<xsl:with-param name="Qual" select="'Perfect'" />
								<xsl:with-param name="Type" select="'Emerald'" />
							</xsl:call-template></td>
							<td headers="Helm"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ith'" /></xsl:call-template></td>
							<td headers="Boots" ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ort'" /></xsl:call-template></td>
							<td headers="Gloves"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Ral'" /></xsl:call-template></td>
							<td headers="Belt"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Tal'" /></xsl:call-template></td>
							<td headers="Shield"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Nef'" /></xsl:call-template></td>
							<td headers="Body"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Eth'" /></xsl:call-template></td>
							<td headers="Amulet"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Thul'"/></xsl:call-template></td>
							<td headers="Ring"  ><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Amn'" /></xsl:call-template></td>
							<td headers="Weapon"><xsl:call-template name="RuneImg"><xsl:with-param name="RID" select="'Sol'" /></xsl:call-template></td>
						</tr>
					</tbody>
				</table>
			</body>
		</html>
	</xsl:template>
	
	<!--  Images -->
	
	<xsl:template name="RuneImg">
		<xsl:param name="RID" />
		<xsl:param name="Named" select="'no'" />
		<xsl:param name="Linked" select="'no'" />
		<a>
			<xsl:if test="$Linked = 'yes'"><xsl:attribute name="href">
				<xsl:text>../Runes/</xsl:text>
				<xsl:value-of select="translate($RID, $Upper, $Lower)" />
				<xsl:text>.xml</xsl:text>
			</xsl:attribute></xsl:if>
			<xsl:if test="$Named = 'yes'">
				<xsl:value-of select="$RID" />
				<xsl:text> </xsl:text>
			</xsl:if>
			<img>
				<xsl:attribute name="src">
					<xsl:text>../RuneImage/rune</xsl:text>
					<xsl:value-of select="$RID" />
					<xsl:text>.gif</xsl:text>
				</xsl:attribute>
				<xsl:attribute name="alt">
					<xsl:value-of select="$RID" />
				</xsl:attribute>
				<xsl:attribute name="title">
					<xsl:value-of select="$RID" />
					<xsl:text> rune</xsl:text>
				</xsl:attribute>
			</img>
		</a>
	</xsl:template>
	
	<xsl:template name="GemImg">
		<xsl:param name="Qual" />
		<xsl:param name="Type" />
		<img>
			<xsl:attribute name="src">
				<xsl:text>../GemImage/</xsl:text>
				<xsl:value-of select="translate($Qual, $Upper, $Lower)" />
				<xsl:value-of select="translate($Type, $Upper, $Lower)" />
				<xsl:text>.gif</xsl:text>
			</xsl:attribute>
			<xsl:attribute name="alt">
				<xsl:value-of select="$Qual" />
				<xsl:text> </xsl:text>
				<xsl:value-of select="$Type" />
			</xsl:attribute>
			<xsl:attribute name="title">
				<xsl:value-of select="$Qual" />
				<xsl:text> </xsl:text>
				<xsl:value-of select="$Type" />
			</xsl:attribute>
		</img>
	</xsl:template>
	
	<xsl:template name="ItemImg">
		<xsl:param name="Item" />
		<xsl:param name="Exclude" select="'none'" />
	</xsl:template>

	<!-- Links -->

	<xsl:template name="WordLink">
		<xsl:param name="WordId" />
		<xsl:param name="WordEl" select="$RInf/descendant::RI:Word[@wordid=$WordId]" />
		<a>
			<xsl:attribute name="href">
				<xsl:text>../RuneWords/</xsl:text>
				<xsl:value-of select="$WordEl/@wordid" />
				<xsl:text>.xml</xsl:text>
			</xsl:attribute>
			<xsl:value-of select="$WordEl/@wordname" />
		</a>
	</xsl:template>
	<xsl:template name="RuneLink">
		<xsl:param name="RID" />
		<a>
			<xsl:attribute name="href">
				<xsl:text>../Runes/</xsl:text>
				<xsl:value-of select="translate($RID, $Upper, $Lower)" />
				<xsl:text>.xml</xsl:text>
			</xsl:attribute>
			<xsl:value-of select="$RID" />
		</a>
	</xsl:template>
</xsl:stylesheet>