<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:template name="statementRunList">
    <xsl:call-template name="statementRuns" />
  </xsl:template>
  
  <xsl:template name="statementRuns">
    <div class="section" id="runList">
	  	<xsl:call-template name="createRunLink" />
			<xsl:choose>
				<xsl:when test="DistributorRoyaltyRunList/DistributorRoyaltyRun">
					<xsl:call-template name="runTable" />
				</xsl:when>
				<xsl:otherwise>
					<br class="superBreak" />
					<p>No distributor royalty runs have been created.</p>
				</xsl:otherwise>
			</xsl:choose>
		</div>
	</xsl:template>

  <xsl:template name="runTable">
    <table class="textChart hiOn">
			<tr>
      	<th># of Statements</th>
      	<th>Label</th>
      	<th>Payor</th>
      	<th>Run Date</th>
      	<th>
      		Status
					<xsl:call-template name="helpIcon">
						<xsl:with-param name="tip" select="$statusDescriptions" />
					</xsl:call-template>        	
      	</th>
      	<th>Actions</th>
			</tr>
      <xsl:for-each select="DistributorRoyaltyRunList/DistributorRoyaltyRun">
        <tr class="row{position() mod 2}">
          <td>
						<xsl:call-template name="statementCount" />
          </td>
          <td>
          	<xsl:value-of select="Label" />
          </td>
          <td>
						<xsl:call-template name="payorName" />
          </td>
          <td>
          	<xsl:call-template name="runDate" />
          </td>
          <td>
          	<xsl:call-template name="statusCodeToName" />
          </td>
        	<td>
						<xsl:call-template name="runActions" />      
					</td>
        </tr>
      </xsl:for-each>
    </table>
  </xsl:template>

</xsl:stylesheet>

