<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslc="http://xslcomponents.org/TR/WD-xslc">
	<xsl:import href="../../xslc.xsl"/>
	<xsl:import href="../../Common.xsl"/>
	<xsl:template match="/">
		<xsl:apply-templates select="document"/>
	</xsl:template>
	<xsl:template match="document">
		<xsl:call-template name="xslc:Page">
			<xsl:with-param name="Head">
				<script language="javascript">var keyPress = '0';

function getRapport(xFileCmd) {
  if (keyPress == '17') {
    keyPress = '0';
    xFileCmd=xFileCmd.replace("/action/","ReportPDF");
};
  if (keyPress != '17'){
    xFileCmd=xFileCmd.replace("/action/?rptSelect=","CarFidShowFact?");
    xFileCmd=xFileCmd.replace(";3d;","=");
};
  window.open(xFileCmd, '_blank');
}


function getKeyDown(e){
  keyPress = (document.all)?event.keyCode:e.keyCode;
}
document.onkeydown=getKeyDown;
</script>
			</xsl:with-param>
			<xsl:with-param name="Body">
				<xsl:call-template name="xslc:ApplicationMessages"/>
				<xsl:apply-templates select="StatsS"/>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="StatsS">
		<table width="320px" nowrap="nowrap" style="border-width:1px;border-color:#c8c8c8;">
			<tr style="background: #c8c8c8;">
				<td width="60px"/>
				<td width="25px" align="center">0</td>
				<td width="25px" align="center">1</td>
				<td width="25px" align="center">2</td>
				<td width="25px" align="center">3</td>
				<td width="25px" align="center">4</td>
				<td width="25px" align="center">5</td>
				<td width="25px" align="center">6</td>
				<td width="25px" align="center">7</td>
				<td width="25px" align="center">8</td>
				<td width="25px" align="center">9</td>
				<td/>
			</tr>
			<xsl:apply-templates select="Stats"/>
		</table>
	</xsl:template>
	<xsl:template match="Stats">
		<xsl:variable name="clValue">
			<xsl:choose>
				<xsl:when test="position() mod 2 = 1">clRowLight</xsl:when>
				<xsl:otherwise>clRowDark</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="clv0">
			<xsl:value-of select="a0"/>
		</xsl:variable>
		<xsl:variable name="clv1">
			<xsl:value-of select="a1"/>
		</xsl:variable>
		<xsl:variable name="clv2">
			<xsl:value-of select="a2"/>
		</xsl:variable>
		<xsl:variable name="clv3">
			<xsl:value-of select="a3"/>
		</xsl:variable>
		<xsl:variable name="clv4">
			<xsl:value-of select="a4"/>
		</xsl:variable>
		<xsl:variable name="clv5">
			<xsl:value-of select="a5"/>
		</xsl:variable>
		<xsl:variable name="clv6">
			<xsl:value-of select="a6"/>
		</xsl:variable>
		<xsl:variable name="clv7">
			<xsl:value-of select="a7"/>
		</xsl:variable>
		<xsl:variable name="clv8">
			<xsl:value-of select="a8"/>
		</xsl:variable>
		<xsl:variable name="clv9">
			<xsl:value-of select="a9"/>
		</xsl:variable>
		<xsl:variable name="oc0">
			<xsl:if test="i0!=''">javascript: getRapport('/action/?rptSelect=idSPL_Docs;3d;<xsl:value-of select="i0"/>&amp;rptName=Facture'); </xsl:if>
		</xsl:variable>
		<xsl:variable name="oc1">
			<xsl:if test="i1!=''">javascript: getRapport('/action/?rptSelect=idSPL_Docs;3d;<xsl:value-of select="i1"/>&amp;rptName=Facture'); </xsl:if>
		</xsl:variable>
		<xsl:variable name="oc2">
			<xsl:if test="i2!=''">javascript: getRapport('/action/?rptSelect=idSPL_Docs;3d;<xsl:value-of select="i2"/>&amp;rptName=Facture'); </xsl:if>
		</xsl:variable>
		<xsl:variable name="oc3">
			<xsl:if test="i3!=''">javascript: getRapport('/action/?rptSelect=idSPL_Docs;3d;<xsl:value-of select="i3"/>&amp;rptName=Facture'); </xsl:if>
		</xsl:variable>
		<xsl:variable name="oc4">
			<xsl:if test="i4!=''">javascript: getRapport('/action/?rptSelect=idSPL_Docs;3d;<xsl:value-of select="i4"/>&amp;rptName=Facture'); </xsl:if>
		</xsl:variable>
		<xsl:variable name="oc5">
			<xsl:if test="i5!=''">javascript: getRapport('/action/?rptSelect=idSPL_Docs;3d;<xsl:value-of select="i5"/>&amp;rptName=Facture'); </xsl:if>
		</xsl:variable>
		<xsl:variable name="oc6">
			<xsl:if test="i6!=''">javascript: getRapport('/action/?rptSelect=idSPL_Docs;3d;<xsl:value-of select="i6"/>&amp;rptName=Facture'); </xsl:if>
		</xsl:variable>
		<xsl:variable name="oc7">
			<xsl:if test="i7!=''">javascript: getRapport('/action/?rptSelect=idSPL_Docs;3d;<xsl:value-of select="i7"/>&amp;rptName=Facture'); </xsl:if>
		</xsl:variable>
		<xsl:variable name="oc8">
			<xsl:if test="i8!=''">javascript: getRapport('/action/?rptSelect=idSPL_Docs;3d;<xsl:value-of select="i8"/>&amp;rptName=Facture'); </xsl:if>
		</xsl:variable>
		<xsl:variable name="oc9">
			<xsl:if test="i9!=''">javascript: getRapport('/action/?rptSelect=idSPL_Docs;3d;<xsl:value-of select="i9"/>&amp;rptName=Facture'); </xsl:if>
		</xsl:variable>
		<tr class="{$clValue}">
			<td align="center">
				<xsl:value-of select="vStart"/>
			</td>
			<td style="{$clv0}" align="center" onclick="{$oc0} return false;">
				<xsl:value-of select="v0"/>
			</td>
			<td style="{$clv1}" align="center" onclick="{$oc1} return false;">
				<xsl:value-of select="v1"/>
			</td>
			<td style="{$clv2}" align="center" onclick="{$oc2} return false;">
				<xsl:value-of select="v2"/>
			</td>
			<td style="{$clv3}" align="center" onclick="{$oc3} return false;">
				<xsl:value-of select="v3"/>
			</td>
			<td style="{$clv4}" align="center" onclick="{$oc4} return false;">
				<xsl:value-of select="v4"/>
			</td>
			<td style="{$clv5}" align="center" onclick="{$oc5} return false;">
				<xsl:value-of select="v5"/>
			</td>
			<td style="{$clv6}" align="center" onclick="{$oc6} return false;">
				<xsl:value-of select="v6"/>
			</td>
			<td style="{$clv7}" align="center" onclick="{$oc7} return false;">
				<xsl:value-of select="v7"/>
			</td>
			<td style="{$clv8}" align="center" onclick="{$oc8} return false;">
				<xsl:value-of select="v8"/>
			</td>
			<td style="{$clv9}" align="center" onclick="{$oc9} return false;">
				<xsl:value-of select="v9"/>
			</td>
			<td/>
		</tr>
	</xsl:template>
</xsl:stylesheet>
