<!--                                                                  -->
<!--  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="ukMechCurrentRetentionsLayout">
        <div class="section" id="auditReport">
    	    <xsl:choose>
    		    <xsl:when test="Report/Product">
                    <xsl:call-template name="ukMechCurrentRetentionsDisplay" />
				</xsl:when>
				<xsl:otherwise>
				    <xsl:call-template name="ukMechCurrentRetentionsHeading" />
					<p>No retentions were reported during this period.</p>
				</xsl:otherwise>
			</xsl:choose>
		</div>

        <xsl:call-template name="backToUKMechRun" />

	</xsl:template>
	
	
	<xsl:template name="ukMechCurrentRetentionsDisplay">
        <div class="reportNavWrapper">
            <xsl:call-template name="ukMechCurrentRetentionsHeading" />
            <xsl:call-template name="reportHeading" />
            <xsl:call-template name="reportNav" />
        </div>
        <xsl:call-template name="ukMechCurrentRetentionsTable" />
        <xsl:call-template name="reportNav" />
        <br class="superBreak" />
        <br />
	</xsl:template>	
	
	
	<xsl:template name="ukMechCurrentRetentionsHeading">
        <h2>
            Retentions - Current Period
            <xsl:call-template name="helpIcon">
		        <xsl:with-param name="tip">
			        Lists retentions that were held or released within the<xsl:value-of select="$tipBreak" />
			        reporting period of this UK mechanical statement run.
		        </xsl:with-param>
	        </xsl:call-template>  
        </h2>	
	</xsl:template>			
						

	<xsl:template name="ukMechCurrentRetentionsTable">
        <table class="textChart hiOn">
            <tr>
              	<th>Catalog&#160;#</th>
              	<th>Album&#160;Title</th>
              	<th>Artist</th>
              	<th>Product</th>
              	<th>Release Date</th>
              	<th class="status">TV Ad</th>
              	<th class="amount">Retention Rate</th>
              	<th class="amount">Retentions Held</th>
              	<th class="amount">Retentions Released</th>
            </tr>
            <xsl:for-each select="Report/Product">
                
                <tr class="row{position() mod 2}">
                    <td><xsl:value-of select="CatalogNumber" /></td>
    				<td>
    					<a href="/rps/catalog?c=show&amp;AlbumID={AlbumID}"><xsl:value-of select="AlbumTitle" /></a>
    				</td>
    			    <td><xsl:value-of select="ArtistName" /></td>
    			    <td>
    			        <xsl:value-of select="ProductType" />
    			    </td>
    			    <td><xsl:value-of select="ReleaseDate" /></td>
    			    <td class="status">
    			        <xsl:choose>
    			            <xsl:when test="TVAdvertised = '1'">Y</xsl:when>
    			            <xsl:otherwise>N</xsl:otherwise>
    			        </xsl:choose>
    			    </td>   
    			    <td class="amount">
    			        <xsl:choose>
    			            <xsl:when test="CurrentPeriod &gt; 4"></xsl:when>
    			            <xsl:when test="TVAdvertised = 'Y' and CurrentPeriod &lt; 3">25%</xsl:when>
    			            <xsl:otherwise>10%</xsl:otherwise>
    			        </xsl:choose>
    			    </td>
    			    <td class="amount">
    			        <xsl:value-of select="Retentions" />
    			    </td>
    			    <td class="amount">
    			        <xsl:value-of select="Released" />
    			    </td>
                </tr>
            </xsl:for-each>
        </table>
    </xsl:template>

</xsl:stylesheet>
