<?xml version="1.0" encoding="BIG5"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="html" encoding="UTF-8"/>
	<xsl:template match="file_type_table">
		<xsl:call-template name="LEVEL_2"/>
	</xsl:template>
	<xsl:template name="LEVEL_2">
		<xsl:for-each select="category">
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
				<xsl:if test="hidden='true'"><xsl:attribute name="style">display:none;</xsl:attribute></xsl:if>
				<tr><td width="20">
						<xsl:element name="input">
							<xsl:attribute name="type">checkbox</xsl:attribute>
							<xsl:attribute name="id">chkAll</xsl:attribute>
							<xsl:attribute name="name">chkAll<xsl:value-of select="name"/></xsl:attribute>
							<xsl:attribute name="onclick">setUIChecked(this.checked,fmMain.chkAll<xsl:value-of select="name"/>_items);setUIItemsChecked(fmMain.chkAllType, fmMain.chkAll, false);</xsl:attribute>
							<xsl:if test="file_types/type/enable='true'">
								<xsl:attribute name="checked">checked</xsl:attribute>
							</xsl:if>
						</xsl:element></td>
					<td><xsl:value-of select="description"/><xsl:text disable-output-escaping="yes"> </xsl:text>
            <xsl:element name="span">
              <xsl:attribute name="id">tabAll<xsl:value-of select="name"/></xsl:attribute>
              <xsl:attribute name="class">more-out</xsl:attribute>
              <xsl:attribute name="onclick">setUIMoreDisplay(this);</xsl:attribute>
              <xsl:attribute name="onmouseover">setUIMoreOverOut(this,true);</xsl:attribute>
              <xsl:attribute name="onmouseout">setUIMoreOverOut(this,false);</xsl:attribute>
                <xsl:element name="img">
							    <xsl:attribute name="id">tabAll<xsl:value-of select="name"/>_icon</xsl:attribute>
							    <xsl:attribute name="src">images/more_down_out.gif</xsl:attribute>
						    </xsl:element>
            </xsl:element>
          </td></tr>
				<xsl:call-template name="LEVEL_3">
					<xsl:with-param name="pos" select="position()-1"/>		
				</xsl:call-template>
				</table>
		</xsl:for-each>
	</xsl:template>
	<xsl:template name="LEVEL_3">
		<xsl:param name="pos"/>
		<tr><td width="20"/>
			<td><table width="100%" border="0" cellpadding="0" cellspacing="0" id="tabAll{name}_items" style="display:none">
				<xsl:for-each select="file_types/type">
				<tr><td><xsl:choose>
						<xsl:when test="enable='true'">
							<input type="checkbox" id="chkAll{ancestor::category/name}_items" name="chkAll{name}" onclick="setUIItemsChecked(fmMain.chkAll[{$pos}], fmMain.chkAll{ancestor::category/name}_items, false);setUIItemsChecked(fmMain.chkAllType, fmMain.chkAll, false);" checked="checked"/>
							<xsl:value-of select="description"/>
						</xsl:when>
						<xsl:otherwise>
							<input type="checkbox" id="chkAll{ancestor::category/name}_items" name="chkAll{name}" onclick="setUIItemsChecked(fmMain.chkAll[{$pos}], fmMain.chkAll{ancestor::category/name}_items, false);setUIItemsChecked(fmMain.chkAllType, fmMain.chkAll, false);"/>
							<xsl:value-of select="description"/>
						</xsl:otherwise>
						</xsl:choose></td></tr>
				</xsl:for-each>
				</table></td></tr>
	</xsl:template>
</xsl:stylesheet>