<?xml version="1.0" encoding="utf-8"?>
<!-- DWXMLSource="pid-common.xml" -->
<!DOCTYPE xsl:stylesheet  [
	<!ENTITY nbsp   "&#160;">
	<!ENTITY copy   "&#169;">
	<!ENTITY reg    "&#174;">
	<!ENTITY trade  "&#8482;">
	<!ENTITY mdash  "&#8212;">
	<!ENTITY ldquo  "&#8220;">
	<!ENTITY rdquo  "&#8221;"> 
	<!ENTITY pound  "&#163;">
	<!ENTITY yen    "&#165;">
	<!ENTITY euro   "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" encoding="utf-8"/>
  <xsl:template match="/params">
    <xsl:for-each select="group">
	<ul>
    <xsl:for-each select="param">
	<li>
	<div class="box_wrapper">
		<h5>
          <xsl:attribute name="title">PID: <xsl:value-of select="@id"/></xsl:attribute>
          <label><input type="checkbox" checked="checked" title="Enable/disable the PID response"><xsl:attribute name="onclick">emulator.togglePID("<xsl:value-of select="@id"/>",checked)</xsl:attribute></input>&nbsp;
          <xsl:value-of select="name"/></label>
		</h5>
		<div class="box">
			<button class="l_btn" onmouseup="knob.StopChangeValue()">
			<xsl:attribute name="onmousedown">knob.StartChangeValue(nextSibling, '<xsl:value-of select="@id"/>', -1, <xsl:value-of select="min"/>, <xsl:value-of select="max"/>)</xsl:attribute>
			</button>
			<input type="text" class="num" value="0">
				<xsl:attribute name="id"><xsl:value-of select="../@name"/>-<xsl:value-of select="@id"/></xsl:attribute>
				<xsl:attribute name="onkeypress">knob.setValue('<xsl:value-of select="@id"/>', value)</xsl:attribute>
			</input>
			<button class="r_btn" onmouseup="knob.StopChangeValue()">
			<xsl:attribute name="onmousedown">knob.StartChangeValue(previousSibling, '<xsl:value-of select="@id"/>', 1, <xsl:value-of select="min"/>, <xsl:value-of select="max"/>)</xsl:attribute>	
			</button>
			<span class="unit"><xsl:value-of select="unit"/></span>
		</div>
	</div>
	</li>
    </xsl:for-each>
    <xsl:for-each select="readiness">
    <xsl:if test="@id=1">
    <li>
	<div class="box_wrapper">
        <h5>
          <label>DTC Count</label>
        </h5>
        <div class="box">
            <button class="l_btn">
            <xsl:attribute name="onclick">emulator.setDTCCount(parseInt(nextSibling.value) - 1)</xsl:attribute>
            </button>
            <input type="text" class="num" value="0" id="DTC_COUNT" onchange="emulator.setDTCCount(parseInt(value))"/>
            <button class="r_btn">
            <xsl:attribute name="onclick">emulator.setDTCCount(parseInt(previousSibling.value) + 1)</xsl:attribute>
            </button>
        </div>
     </div>
     </li>
    </xsl:if>
	<li>
	<div class="box_wrapper">
        <h5>
          <label><input type="checkbox" title="Toggle Availability">
          <xsl:attribute name="id">Availability-<xsl:value-of select="@id"/></xsl:attribute>
          <xsl:attribute name="onclick">emulator.setAvailability("<xsl:value-of select="@available"/>",checked)</xsl:attribute>
          </input>&nbsp;
          <xsl:value-of select="name"/></label>
        </h5>
        <div class="box">
            <button class="l_btn">
            <xsl:attribute name="onclick">nextSibling.innerHTML = emulator.setCompleteness('<xsl:value-of select="@complete"/>', true)</xsl:attribute>
            </button>
            <span class="state">
                <xsl:attribute name="id"><xsl:value-of select="../@name"/>-<xsl:value-of select="@id"/></xsl:attribute>
            </span>
            <button class="r_btn">
            <xsl:attribute name="onclick">previousSibling.innerHTML = emulator.setCompleteness('<xsl:value-of select="@complete"/>', false)</xsl:attribute>
            </button>
        </div>
	</div>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>
