<!--                                                                  -->
<!--  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="statementPayorList">
    <xsl:call-template name="statementPayors" />
  </xsl:template>

  <xsl:template name="statementPayors">
    <div class="section">
			<xsl:call-template name="payorTable" />
		</div>
	</xsl:template>

	<xsl:template name="payorTable">
    <table class="textChart hiOn">
      <tr>
        <th class="rowLeft">Payor</th>
				<th># of Statements</th>
      </tr>
      <xsl:for-each select="ArtistRoyaltyPayorList/Payor">
        <tr class="row{position() mod 2}">
          <td class="rowLeft">
          	<a>
          		<xsl:attribute name="href">
          			<xsl:choose>
          				<xsl:when test="/Root/Params/Payments">
          					?c=editpay&amp;RoyaltyRunID=<xsl:value-of select="/Root/Params/RoyaltyRunID" />&amp;PayorID=<xsl:value-of select="PayorID" />
          				</xsl:when>
          				<xsl:otherwise>
          					?c=show&amp;RoyaltyRunID=<xsl:value-of select="/Root/Params/RoyaltyRunID" />&amp;PayorID=<xsl:value-of select="PayorID" />
          				</xsl:otherwise>
								</xsl:choose>
							</xsl:attribute>
							<xsl:value-of select="Name" />
        	  </a>
          </td>
					<td>
						<xsl:value-of select="NumStatements" />
					</td>
        </tr>
      </xsl:for-each>
    </table>
  </xsl:template>

</xsl:stylesheet>

