<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="html" encoding="utf-8" />
	<!--<xsl:output method="html" encoding="Shift_JIS" />-->
	<xsl:variable name="viewmode" />
	<xsl:variable name="figgroup" />
	<xsl:variable name="category" />
	<xsl:variable name="subcategory" />
	<xsl:variable name="figimgfolder" />
	<xsl:variable name="urlparam1" />
	<xsl:variable name="urlparam2" />
	<xsl:variable name="urlparam3" />
	<xsl:variable name="pemparam" />

	<xsl:variable name="Section" />
	<xsl:variable name="SubSection" />
	<xsl:variable name="Title" />
	<xsl:variable name="Outline" />
	<xsl:variable name="figgroup2" />

	<xsl:variable name="JunctionMode" />
		
	<xsl:template match="/">
		<xsl:if test="$viewmode='category'"><xsl:apply-templates select="figlist" mode="category" /></xsl:if>
		<xsl:if test="$viewmode='subcategory'"><xsl:apply-templates select="figlist" mode="subcategory" /></xsl:if>
		<xsl:if test="$viewmode='figure'"><xsl:apply-templates select="figlist" mode="figure" /></xsl:if>
		<xsl:if test="$viewmode='figimg'"><xsl:apply-templates select="figlist" mode="figimg" /></xsl:if>
		<xsl:if test="$viewmode='panmenu'"><xsl:apply-templates select="figlist" mode="pan" /></xsl:if>
	</xsl:template>

	<xsl:template match="figlist" mode="category">

		<div name="title" class="pagetitle"><xsl:value-of select="$Section" /></div>

		<xsl:for-each select="figgroup/category">
		<xsl:if test="$figgroup='Power Source / Grounding / Sneak Path'">
			<xsl:if test="$JunctionMode='Y'">
				<xsl:if test="@id='P'">
					<xsl:if test="name!=''">
						<div class="datalist">
						<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute>
						<xsl:attribute name="onmouseover">List_CateListMouseOver(this,'<xsl:value-of select="$figgroup"/>','<xsl:value-of select="@id"/>','',1,<xsl:value-of select="$pemparam"/>)</xsl:attribute>
						<xsl:attribute name="onclick">List_CateListClick(1)</xsl:attribute>
						<table class="datalisttbl">
						<tr>
							<td class="datalisttd1"><xsl:value-of select="name"/></td>
							<xsl:if test="count(subcategory[@name!=''])>0 or count(fig[@id!=''])>0">
								<td class="datalisttd2"><img name="trimage" src="../../common/image/other/tri.gif"/></td>
							</xsl:if>
							<xsl:if test="count(subcategory[@name!=''])=0 and count(fig[@id!=''])=0">
								<td class="datalisttd2"><img name="spimage" src="../../common/image/other/space.gif" width="15px"/></td>
							</xsl:if>
						</tr>
						</table>
						</div>
					</xsl:if>
				</xsl:if>
			</xsl:if>
			
			<xsl:if test="$JunctionMode!='Y'">
				<xsl:if test="name!=''">
					<div class="datalist">
					<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute>
					<xsl:attribute name="onmouseover">List_CateListMouseOver(this,'<xsl:value-of select="$figgroup"/>','<xsl:value-of select="@id"/>','',1,<xsl:value-of select="$pemparam"/>)</xsl:attribute>
					<xsl:attribute name="onclick">List_CateListClick(1)</xsl:attribute>
					<table class="datalisttbl">
						<tr>
							<td class="datalisttd1"><xsl:value-of select="name"/></td>
							<xsl:if test="count(subcategory[@name!=''])>0 or count(fig[@id!=''])>0">
								<td class="datalisttd2"><img name="trimage" src="../../common/image/other/tri.gif"/></td>
							</xsl:if>
							<xsl:if test="count(subcategory[@name!=''])=0 and count(fig[@id!=''])=0">
								<td class="datalisttd2"><img name="spimage" src="../../common/image/other/space.gif" width="15px"/></td>
							</xsl:if>
						</tr>
					</table>
					</div>
				</xsl:if>
			</xsl:if>
		</xsl:if>

		<xsl:if test="$figgroup!='Power Source / Grounding / Sneak Path'">

			<xsl:if test="name!=''">
				<div class="datalist">
					<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute>
					<xsl:attribute name="onmouseover">List_CateListMouseOver(this,'<xsl:value-of select="$figgroup"/>','<xsl:value-of select="@id"/>','',1,<xsl:value-of select="$pemparam"/>)</xsl:attribute>
					<xsl:attribute name="onclick">List_CateListClick(1)</xsl:attribute>
					<table class="datalisttbl">
						<tr>
							<td class="datalisttd1"><xsl:value-of select="name"/></td>
							<xsl:if test="count(subcategory[@name!=''])>0 or count(fig[@id!=''])>0">
								<td class="datalisttd2"><img name="trimage" src="../../common/image/other/tri.gif"/></td>
							</xsl:if>
							<xsl:if test="count(subcategory[@name!=''])=0 and count(fig[@id!=''])=0">
								<td class="datalisttd2"><img name="spimage" src="../../common/image/other/space.gif" width="15px"/></td>
							</xsl:if>
						</tr>
					</table>
				</div>
			</xsl:if>
		</xsl:if>
		</xsl:for-each>
	</xsl:template>

	<xsl:template match="figlist" mode="subcategory">
	    <xsl:if test="count(category/subcategory[@name!=''])>0">
	    <div name="title" class="pagetitle"><xsl:value-of select="$SubSection" /></div>
		<xsl:for-each select="category/subcategory">
			<xsl:if test="@name!=''">
				<div class="datalist">
					<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
					<xsl:attribute name="onmouseover">List_CateListMouseOver(this,'<xsl:value-of select="$figgroup"/>','<xsl:value-of select="$category"/>','<xsl:value-of select="@name"/>',2)</xsl:attribute>
					<!--<xsl:attribute name="onclick">List_CateListClick(2,'<xsl:value-of select="$figgroup"/>','<xsl:value-of select="figid"/>')</xsl:attribute>-->
					<table class="datalisttbl">
						<tr>
							<td class="datalisttd1"><xsl:value-of select="@name"/></td>
						<xsl:if test="count(fig[name!='' and count(noshow)=0])>0">
							<td class="datalisttd2"><img name="trimage" src="../../common/image/other/tri.gif"/></td>
						</xsl:if>
						<xsl:if test="count(fig[name!='' and count(noshow)=0])=0">
							<td class="datalisttd2"><img name="spimage" src="../../common/image/other/space.gif" width="15px"/></td>
						</xsl:if>
						</tr>
					</table>
				</div>
			</xsl:if>
		</xsl:for-each>
	    </xsl:if>
	</xsl:template>

	<xsl:template match="figlist" mode="figure">
	    <xsl:if test="count(subcategory/fig[name!='' and count(noshow)=0])>0">
	      <xsl:if test="not ($figgroup='Harness Layout')">
	      <div name="title" class="pagetitle"><xsl:value-of select="$Title" /></div>
	      </xsl:if>
	      <xsl:if test="$figgroup='Harness Layout'">
	      <div name="title" class="pagetitle"><xsl:value-of select="$Section" /></div>
	      </xsl:if>
		<xsl:for-each select="subcategory/fig">
			<xsl:if test="name!='' and count(noshow)=0">
					<xsl:if test="not ($figgroup='Harness Layout' and name=$Outline)">
					<div class="datalist">
						<xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute>
						<xsl:attribute name="onmouseover">List_CateListMouseOver(this,'','','',3)</xsl:attribute>
						<xsl:attribute name="onmouseout">List_CateListMouseOut(this,'','','',3)</xsl:attribute>
						<xsl:attribute name="onclick">CateList_ClickFigure('<xsl:value-of select="$figgroup"/>','<xsl:value-of select="@id"/>')</xsl:attribute>
						<table class="datalisttbl">
							<tr>
								<td class="datalisttd1"><xsl:value-of select="name"/></td>
								<td class="datalisttd2"><img name="spimage" src="../../common/image/other/space.gif" width="15px"/></td>
							</tr>
						</table>
					</div>
				</xsl:if>
			</xsl:if>
		</xsl:for-each>
	    </xsl:if>
	</xsl:template>

	<xsl:template match="figlist" mode="figimg">
		<xsl:for-each select="fig">
			<table><tr><td>
				<script type="text/JavaScript" src="../../common/script/actx.js"></script><!--20080911 activeX-->
			</td></tr></table>
			<div>
				<xsl:attribute name="id">divalt</xsl:attribute>
				<xsl:attribute name="onmouseover">SVG_ShowAltCon_mov()</xsl:attribute>
				<xsl:attribute name="style">position:absolute; border:outset 1px #a9a9a9; background-color:#faebd7; padding:2px; font-size:11pt; visibility:hidden; z-index:1000;</xsl:attribute>
			</div>
		</xsl:for-each>

	</xsl:template>
		<xsl:template match="figlist" mode="pan">
		<xsl:for-each select="fig">
			<div class="figtop">
				<xsl:element name="input">
		     			<xsl:attribute name="type">button</xsl:attribute>
		     			<xsl:attribute name="value">&lt;</xsl:attribute>
		     			<xsl:attribute name="onclick">FrameSizeChange()</xsl:attribute>
		     			<xsl:attribute name="id">Fsb</xsl:attribute>
				</xsl:element>

				<span class="pan">
					<a>
						<xsl:attribute name="href"><xsl:value-of select="$urlparam1" /></xsl:attribute>
						<xsl:attribute name="target">_top</xsl:attribute>
						<xsl:value-of select="$figgroup2"/>
					</a>
					<xsl:if test="$category!=''">
					&gt;
					<a>
						<xsl:attribute name="href"><xsl:value-of select="$urlparam2" /></xsl:attribute>
						<xsl:attribute name="target">_top</xsl:attribute>
						<xsl:value-of select="$category"/>
					</a>
					</xsl:if>
					<xsl:if test="$subcategory!=''">
					&gt;
					<a>
						<xsl:attribute name="href"><xsl:value-of select="$urlparam3" /></xsl:attribute>
						<xsl:attribute name="target">_top</xsl:attribute>
						<xsl:value-of select="$subcategory"/>
					</a>
					</xsl:if>
				</span>

			</div>
		</xsl:for-each>
	</xsl:template>

</xsl:stylesheet>
