<?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="conimgfolder" />
	<xsl:variable name="viewmode" />
	<xsl:variable name="conside" />
	<xsl:variable name="figgroup" />
	<xsl:variable name="figid" />

	<xsl:variable name="pinno" />
	<xsl:variable name="conno" />
	<xsl:variable name="sigcnt" />

	<xsl:variable name="CircuitDiagram" />
	<xsl:variable name="HarnessLayout" />
	<xsl:variable name="PowerSource_Grounding_SneakPath" />

	<xsl:variable name="Fuse" />
	<xsl:variable name="FuseNo" />
	<xsl:variable name="Terminal" />
	<xsl:variable name="TerminalNo" />
	<xsl:variable name="WireColor" />
	<xsl:variable name="SignalName" />
	<xsl:variable name="Spec" />

	<xsl:variable name="ConnectorList" />

	<xsl:variable name="ConnectorInfomation" />
	<xsl:variable name="FuseNo1" />	
	<xsl:variable name="ConnectorNo" />
	<xsl:variable name="ConnectorName" />
	<xsl:variable name="ConnectorType" />	
	<xsl:variable name="ConnectorNotFound" />
	<xsl:variable name="ConnectorRevers" />	
	<xsl:variable name="HarnessSide" />
	<xsl:variable name="Shield" />

	<xsl:variable name="JunctionFromList" />
	<xsl:variable name="JunctionToList" />
	<xsl:variable name="WireToWire" />

	<xsl:variable name="figgroup2" />

	<xsl:variable name="JunctionMode" />

	<xsl:variable name="PowerName" />
		
	<xsl:variable name="SQotName" />
	<xsl:variable name="DELIName" />

	<xsl:template match="/">
		<xsl:if test="$viewmode='list'"><xsl:apply-templates select="connector" mode="list" /></xsl:if>
		<xsl:if test="$viewmode='list2'"><xsl:apply-templates select="connector" mode="list2" /></xsl:if>
		<xsl:if test="$viewmode='list3'"><xsl:apply-templates select="connector" mode="list3" /></xsl:if>
		<xsl:if test="$viewmode='list4'"><xsl:apply-templates select="connector" mode="list4" /></xsl:if>
		<xsl:if test="$viewmode='list5'"><xsl:apply-templates select="connector" mode="list5" /></xsl:if><!--20080826 connector list mod-->
		<xsl:if test="$viewmode='info'"><xsl:apply-templates select="connector" mode="info" /></xsl:if>
		<xsl:if test="$viewmode='zoom'"><xsl:apply-templates select="connector" mode="zoom" /></xsl:if>
		<xsl:if test="$viewmode='junc'"><xsl:apply-templates select="connector" mode="junc" /></xsl:if>
	</xsl:template>

	<xsl:template match="connector" mode="junc">
		<xsl:choose>		
			<xsl:when test="con/term/pin">
				<xsl:for-each select="con/term/pin/sig">
					<table class="coninfo">
						<tr>
							<td class="contermdata"><xsl:value-of select="../@no"/></td>
							<td class="contermdata"><xsl:value-of select="@jc"/></td>
						</tr>
					</table>
				</xsl:for-each>
			</xsl:when>

			<xsl:otherwise>
				<!--Connector Not Found-->
				<xsl:value-of select="$ConnectorNotFound" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="connector" mode="list2">
		<xsl:if test="$sigcnt='1'">
			<div class="pagetitle">
				<xsl:value-of select="$JunctionToList" />
			</div>
		</xsl:if>

		<xsl:choose>
			<xsl:when test="con/term/pin/sig">
			<xsl:for-each select="con/term/pin/sig">

				<!--<xsl:sort select="name" lang="en-us"/>-->
				<!--<xsl:sort select="name" lang="ja"/>-->
				<xsl:sort select="name"/>
				<xsl:sort select="@no" data-type="number"/>
					<xsl:if test="../../../name != $WireToWire">
					<xsl:if test="../../../@no != $conno">
						<xsl:if test="@jc=$pinno">
							<div class="junclist">
								<xsl:value-of select="../../../@no"/>
								&lt;<xsl:value-of select="../@no"/>&gt;
								<xsl:value-of select="../../../name"/>
							</div>
						</xsl:if>
					</xsl:if>
				</xsl:if>
			</xsl:for-each>
			</xsl:when>
			<xsl:otherwise>
				<!--Connector Not Found-->
				<xsl:value-of select="$ConnectorNotFound" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	
	<xsl:template match="connector" mode="list3">
		<div class="pagetitle">	
			<xsl:value-of select="$JunctionFromList" />
		</div>
		<xsl:choose>
		<xsl:when test="con/term/pin/sig">
			<xsl:for-each select="con/term/pin/sig">
				<!--<xsl:sort select="name" lang="en-us"/>-->
				<!--<xsl:sort select="name" lang="ja"/>-->
				<xsl:sort select="name"/>
				<xsl:sort select="@no" data-type="number"/>
				<xsl:if test="../../../name != $WireToWire">
				<xsl:if test="../../../@no = $conno">
					<xsl:if test="@jc=$pinno">
						<div class="junclist">
						<xsl:attribute name="src">../../common/image/other/maru.gif</xsl:attribute>
							<xsl:value-of select="../../../@no"/>
							&lt;<xsl:value-of select="../@no"/>&gt;
							<xsl:value-of select="../../../name"/>
						</div>
					</xsl:if>
				</xsl:if>
			</xsl:if>	
			</xsl:for-each>
		</xsl:when>
		<xsl:otherwise>
			<!--Connector Not Found-->
			<xsl:value-of select="$ConnectorNotFound" />
		</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="connector" mode="list">
		<div class="pagetitle">
		<xsl:value-of select="$ConnectorList" /></div>
		<xsl:choose>
		<xsl:when test="con">
		<xsl:for-each select="con">
			<!--<xsl:sort select="name" lang="en-us"/>-->
			<!--<xsl:sort select="name" lang="ja"/>-->

			<xsl:sort select="name"/>
			<xsl:sort select="@no" data-type="number"/>

			<div class="datalist">	
				<xsl:attribute name="onmouseover">List_MouseOver('<xsl:value-of select="@no"/>',this)</xsl:attribute>
				<xsl:attribute name="onmouseout">List_MouseOut('<xsl:value-of select="@no"/>',this)</xsl:attribute>
				<xsl:attribute name="onclick">FigData_ClickConnList('<xsl:value-of select="@no"/>',this)</xsl:attribute>

				<xsl:value-of select="name"/>
				&lt;<xsl:value-of select="@no"/>&gt;

			</div>
		</xsl:for-each>
		</xsl:when>
		<xsl:otherwise>
			<!--Connector Not Found-->
			<xsl:value-of select="$ConnectorNotFound" />
		</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

<!--from 20080826 connector list mod-->
	<xsl:template match="connector" mode="list5">
		<div class="pagetitle">
		<xsl:value-of select="$ConnectorList" /></div>
		<xsl:choose>
		<xsl:when test="con">
		<xsl:for-each select="con">
			<xsl:sort select="@no" data-type="number"/>

			<div class="datalist">	
				<xsl:attribute name="onmouseover">List_MouseOver('<xsl:value-of select="@no"/>',this)</xsl:attribute>
				<xsl:attribute name="onmouseout">List_MouseOut('<xsl:value-of select="@no"/>',this)</xsl:attribute>
				<xsl:attribute name="onclick">FigData_ClickConnList('<xsl:value-of select="@no"/>',this)</xsl:attribute>

				&lt;<xsl:value-of select="@no"/>&gt;
				<xsl:value-of select="name"/>
			</div>
		</xsl:for-each>
		</xsl:when>
		<xsl:otherwise>
			<!--Connector Not Found-->
			<xsl:value-of select="$ConnectorNotFound" />
		</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
<!--to 20080826 connector list mod-->

	<xsl:template match="connector" mode="list4">
	<div class="pagetitle">
		<xsl:value-of select="$ConnectorList" />
	</div>
		<xsl:choose>
			<xsl:when test="con">
				<xsl:for-each select="con">
					<xsl:sort select="suff"/>
					<xsl:sort select="suffno" data-type="number"/>
					<table class="datalist2">
						<xsl:attribute name="onmouseover">List_MouseOver('<xsl:value-of select="@no"/>',this)</xsl:attribute>
						<xsl:attribute name="onmouseout">List_MouseOut('<xsl:value-of select="@no"/>',this)</xsl:attribute>
						<xsl:attribute name="onclick">FigData_ClickConnList('<xsl:value-of select="@no"/>',this)</xsl:attribute>
							<tr>
								<td class="searchstyle0">
								</td>

								<td class="searchstyle1">
									<xsl:value-of select="@no"/>
								</td>
								<td class="searchstyle2">
									<xsl:value-of select="name"/>
								</td>
							</tr>
						</table>
				</xsl:for-each>
			</xsl:when>
			<xsl:otherwise>
				<!--Connector Not Found-->
				<xsl:value-of select="$ConnectorNotFound" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
		
	
	<xsl:template match="connector" mode="info">
		<div class="pagetitle"><xsl:value-of select="$ConnectorInfomation" /></div>
		<form name="infoform" onsubmit="return false;">		
		<xsl:for-each select="con">
		<xsl:choose>
			<xsl:when test="fuse">
			<table class="coninfo" width="240">
				<tr>			
					<td class="coninfotitle" width="70"><xsl:value-of select="$FuseNo1" /></td>
					<td class="coninfodata"><xsl:value-of select="@no" /></td>
				</tr>
				<tr>	
					<td class="coninfotitle" width="70"><xsl:value-of select="$ConnectorName" /></td>
					<td class="coninfodata"><xsl:value-of select="name" /></td>
				</tr>
			</table>
			<table class="coninfo" width="240">
				<xsl:if test="shape[@name='Harness-side']/svgfile != ''">
				<tr>
					<td>
						<div>
							<xsl:attribute name="id">thstxt<xsl:value-of select="@no" /></xsl:attribute>
						</div>
						<div>
							<xsl:attribute name="id">thsimg<xsl:value-of select="@no" /></xsl:attribute>
							<xsl:if test="shape[@name=$conside]/svgfile != ''">
							<embed>
								<xsl:attribute name="type">image/svg-xml</xsl:attribute><!--20070705 add-->
								<xsl:attribute name="WMODE">transparent</xsl:attribute><!--20070705 add-->
								<xsl:attribute name="src"><xsl:value-of select="$conimgfolder" /><xsl:value-of select="shape[@name=$conside]/svgfile" /></xsl:attribute>
							</embed>
							</xsl:if>
						</div>
					</td>
				</tr>
				</xsl:if>
			</table>
			<table class="coninfo" width="240">
				<xsl:if test="not(shape[@name='Harness-side']/svgfile != '')">
					<tr><td colspan="2"><br/><br/></td></tr>
				</xsl:if>
				<xsl:if test="term">
				<tr>
					<td>
						<div class="contermframe">
							<table class="coninfo">
								<tr>		
									<td class="contermtitle1"><xsl:value-of select="$Fuse" /><br/><xsl:value-of select="$FuseNo" /></td>
									<td class="contermtitle2"><xsl:value-of select="$WireColor" /></td>
									<td class="contermtitle3"><xsl:value-of select="$SignalName" /><br/><xsl:value-of select="$Spec" /></td>
								</tr>
								<xsl:for-each select="term/pin">
									<tr>
										<xsl:if test="../../name != $WireToWire">
										<xsl:if test="sig/@jc != 'NG'">
										<xsl:if test="sig/@jc != 'ng'">
										<xsl:if test="sig/@jc != '-'">
										<xsl:if test="$JunctionMode='Y'">
											<td class="jcdata">
												<xsl:attribute name="onclick">Serach_Junction('<xsl:value-of select="../../@no" />','','<xsl:value-of select="../../type" />','<xsl:value-of select="@no" />')</xsl:attribute>
												<xsl:attribute name="onmouseover">Jc_MouseOver(this)</xsl:attribute>
												<xsl:attribute name="onmouseout">Jc_MouseOut(this)</xsl:attribute>	
												<xsl:value-of select="@no" />								
											</td>
										</xsl:if>
										</xsl:if>
										</xsl:if>
										</xsl:if>
										</xsl:if>

										<xsl:if test="(../../name = $WireToWire) or (sig/@jc = '') or (sig/@jc = '-') or ($JunctionMode!='Y')">
										<td class="contermdata">
											<xsl:value-of select="@no" />
										</td>
										</xsl:if>

										<!--replace 07.07.3-->
										<xsl:choose>
											<xsl:when test="color = $Shield">
												<td class="contermdataSHIELD"><xsl:value-of select="color" /></td>
											</xsl:when>
											<xsl:when test="color = '-'">
												<td class="contermdata"><xsl:value-of select="color" /></td>
											</xsl:when>
											<xsl:otherwise>
												<xsl:variable name="ColorName1" select="concat('contermdata',color)" />
												<xsl:variable name="ColorName2" select="translate($ColorName1,'/','_')" />
												<td class="{$ColorName2}"><xsl:value-of select="color" /></td>
											</xsl:otherwise>
										</xsl:choose>
										<!--replace 07.07.3-->

										<td class="contermdata"><xsl:value-of select="signal" /></td>
									</tr>
								</xsl:for-each>
							</table>
						</div>
						<br/>
					</td>
				</tr>
				</xsl:if>
			</table>
			</xsl:when>
			<xsl:otherwise>
			<table class="coninfo" width="240">
				<tr>
					<td class="coninfotitle" width="70"><xsl:value-of select="$ConnectorNo" /></td>
					<td class="coninfodata"><xsl:value-of select="@no" /></td>
				</tr>
				<tr>
					<td class="coninfotitle" width="70"><xsl:value-of select="$ConnectorName" /></td>
					<td class="coninfodata"><xsl:value-of select="name" /></td>
				</tr>
				<tr>
					<td class="coninfotitle" width="70"><xsl:value-of select="$ConnectorType" /></td>
					<td class="coninfodata"><xsl:value-of select="type" /></td>
				</tr>
			</table>
						<div style="display: none;">
							<xsl:attribute name="id">thstxt<xsl:value-of select="@no" /></xsl:attribute>
							<xsl:value-of select="$conside" />
						</div>
			<table class="coninfo" width="240">
				<xsl:if test="shape[@name='Terminal-side']/svgfile != '' or shape[@name='Harness-side']/svgfile != ''">
				<tr><td>
				<table class="coninfo" width="240">
				<tr>
					<td align="left">
						<xsl:element name="img">
							<xsl:attribute name="src">../../common/image/other/hs.gif</xsl:attribute>
							<xsl:attribute name="id">sideImg<xsl:value-of select="@no" /></xsl:attribute>
							<xsl:attribute name="width">57</xsl:attribute>
							<xsl:attribute name="height">57</xsl:attribute>
							<xsl:attribute name="alt"><xsl:value-of select="$HarnessSide" /></xsl:attribute>
						</xsl:element>
					</td>
					<td align="right">
						<xsl:if test="shape[@name='Harness-side']/svgfile != ''">
							<xsl:element name="img">
								<xsl:attribute name="src">../../common/image/button/connector/rev.gif</xsl:attribute>
								<xsl:attribute name="width">120</xsl:attribute>
								<xsl:attribute name="height">30</xsl:attribute>
								<xsl:attribute name="alt"><xsl:value-of select="$ConnectorRevers" /></xsl:attribute>
								<xsl:attribute name="OnClick">FigData_ChangeConnImageBySide('<xsl:value-of select="@no" />','<xsl:value-of select="shape[@name='Terminal-side']/svgfile" />','<xsl:value-of select="shape[@name='Harness-side']/svgfile" />',this)</xsl:attribute>
								<xsl:attribute name="onmouseover">Rev_MouseOver(this)</xsl:attribute>
								<xsl:attribute name="onmouseout">Rev_MouseOut(this)</xsl:attribute>
							</xsl:element>
						</xsl:if>
					</td>
				</tr>
				</table>
				<table>
				<tr>
					<td align="left">
						<div>
							<xsl:attribute name="id">thsimg<xsl:value-of select="@no" /></xsl:attribute>
							<xsl:if test="shape[@name=$conside]/svgfile != ''">
							<embed>
								<xsl:attribute name="type">image/svg-xml</xsl:attribute><!--20070705 add-->
								<xsl:attribute name="WMODE">transparent</xsl:attribute><!--20070705 add-->
								<xsl:attribute name="src"><xsl:value-of select="$conimgfolder" /><xsl:value-of select="shape[@name=$conside]/svgfile" /></xsl:attribute>
							</embed>
							</xsl:if>
						</div>
					</td>
				</tr>
				</table></td></tr>
				</xsl:if>
			</table>
			<table class="coninfo" width="240">
				<xsl:if test="not(shape[@name='Terminal-side']/svgfile != '' or shape[@name='Harness-side']/svgfile != '')">
					<tr><td><br/><br/></td></tr>
				</xsl:if>
				<xsl:if test="term">
				<tr>
					<td colspan="2">
						<div class="contermframe">
							<table class="coninfo">
								<tr>
									<td class="contermtitle1"><xsl:value-of select="$Terminal" /><br/><xsl:value-of select="$TerminalNo" /></td>
									<td class="contermtitle2"><xsl:value-of select="$WireColor" /></td>
									<td class="contermtitle3"><xsl:value-of select="$SignalName" /><br/><xsl:value-of select="$Spec" /></td>
								</tr>
								<xsl:for-each select="term/pin">
									<tr>
										<xsl:if test="../../name != $WireToWire">
										<xsl:if test="sig/@jc != 'NG'">
										<xsl:if test="sig/@jc != 'ng'">
										<xsl:if test="sig/@jc != '-'">
										<xsl:if test="$JunctionMode='Y'">
											<td class="jcdata">
												<xsl:attribute name="onclick">Serach_Junction('<xsl:value-of select="../../@no" />','<xsl:value-of select="translate(../../name,$SQotName,$DELIName)" />','<xsl:value-of select="../../type" />','<xsl:value-of select="@no" />')</xsl:attribute>
												<xsl:attribute name="onclick">Serach_Junction('<xsl:value-of select="../../@no" />','','<xsl:value-of select="../../type" />','<xsl:value-of select="@no" />')</xsl:attribute>
												<xsl:attribute name="onmouseover">Jc_MouseOver(this)</xsl:attribute>
												<xsl:attribute name="onmouseout">Jc_MouseOut(this)</xsl:attribute>
												<xsl:value-of select="@no" />
											</td>
										</xsl:if>
										</xsl:if>
										</xsl:if>
										</xsl:if>
										</xsl:if>
										<xsl:if test="(../../name = $WireToWire) or (sig/@jc = '') or (sig/@jc = '-') or ($JunctionMode!='Y')">
											<td class="contermdata">
												<xsl:value-of select="@no" />
											</td>
										</xsl:if>

										<!--replace 07.07.3-->
										<xsl:choose>
											<xsl:when test="color = $Shield">
												<td class="contermdataSHIELD"><xsl:value-of select="color" /></td>
											</xsl:when>
											<xsl:when test="color = '-'">
												<td class="contermdata"><xsl:value-of select="color" /></td>
											</xsl:when>
											<xsl:otherwise>
												<xsl:variable name="ColorName1" select="concat('contermdata',color)" />
												<xsl:variable name="ColorName2" select="translate($ColorName1,'/','_')" />
												<td class="{$ColorName2}"><xsl:value-of select="color" /></td>
											</xsl:otherwise>
										</xsl:choose>
										<!--replace 07.07.3-->

										<td class="contermdata"><xsl:value-of select="signal" /></td>
									</tr>
								</xsl:for-each>
							</table>
						</div>
						<br/>
					</td>
				</tr>
				</xsl:if>
			</table>
			</xsl:otherwise>
		</xsl:choose>
			<table>
			<xsl:for-each select="link">
				<xsl:if test="not(@name=$figgroup2)">
				<tr>
					<xsl:if test="(($JunctionMode='Y') and (@name=$PowerSource_Grounding_SneakPath))">
						<td colspan="2" class="configlinkgrp"><xsl:value-of select="$PowerName" /></td>
					</xsl:if>			
					<xsl:if test="not(($JunctionMode='Y') and (@name=$PowerSource_Grounding_SneakPath))">
						<td colspan="2" class="configlinkgrp"><xsl:value-of select="@name" /></td>
					</xsl:if>
				</tr>
				<xsl:for-each select="fig">
					<xsl:if test="@id!=$figid">
				<tr>
					<td width="20" nowrap="nowrap"></td>
					<td class="configlink">
						<xsl:element name="a">
							<xsl:choose>
								<xsl:when test="parent::node()/@name=$CircuitDiagram">
									<xsl:attribute name="href">#</xsl:attribute>
									<xsl:attribute name="onclick">FigData_ConnInfoLinkClick('winfiggrp1','fig.html?j=1&amp;f=<xsl:value-of select="@id" />&amp;cn=<xsl:value-of select="../../@no" />')</xsl:attribute>
								</xsl:when>
								<xsl:when test="parent::node()/@name=$HarnessLayout">
									<xsl:attribute name="href">#</xsl:attribute>
									<xsl:attribute name="onclick">FigData_ConnInfoLinkClick('winfiggrp2','fig.html?j=2&amp;f=<xsl:value-of select="@id" />&amp;cn=<xsl:value-of select="../../@no" />')</xsl:attribute>
								</xsl:when>
								<xsl:when test="parent::node()/@name=$PowerName">
									<xsl:attribute name="href">#</xsl:attribute>
									<xsl:attribute name="onclick">FigData_ConnInfoLinkClick('winfiggrp6','fig.html?j=6&amp;f=<xsl:value-of select="@id" />&amp;cn=<xsl:value-of select="../../@no" />')</xsl:attribute>
								</xsl:when>
								<xsl:otherwise />
							</xsl:choose>
							<xsl:value-of select="name" />

						</xsl:element>
					</td>
				</tr>
					</xsl:if>
				</xsl:for-each>
			</xsl:if>

			</xsl:for-each>
			</table>
			<br/><hr align="left" width="100%" /><br/>
		</xsl:for-each>
		</form>
	</xsl:template>

</xsl:stylesheet>
