<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dyn="http://exslt.org/dynamic" extension-element-prefixes="dyn">
    <xsl:output method="html" indent="no" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 4.01//EN" encoding="utf-8" />


    <xsl:include href="/app/tools/rps/templates/global.xsl" />
    <xsl:include href="shared.xsl" />


    <xsl:template name="pickLayout">
        <div class="section">
            <xsl:call-template name="helpLink" />  	        
            <xsl:call-template name="trackView">
                <xsl:with-param name="track" select="Track" />
                <xsl:with-param name="albumTitle" select="Album/Title" />
            </xsl:call-template>
            <br />
            <xsl:call-template name="preeditChoices" />
            <br /><br />
        </div>
        <xsl:call-template name="buttons" />
    </xsl:template>


    <xsl:template name="preeditChoices">
        <fieldset>
            <legend><xsl:value-of select="$licenseHeading" /></legend>
            <table class="landingPage">
                <tr>
                    <td class="landingAdd">

                        <table>
                            <tr>
                                <td>            
                                    <xsl:call-template name="addLicense" />
                                    <xsl:call-template name="addControlledComp" />                     
                                    <xsl:call-template name="addPublic" />                         
                                </td>
                            </tr>
                        </table>          
        
                    </td>
                    
                    <xsl:if test="$area = 'license'">
                        <xsl:call-template name="addRingtone" />
                    </xsl:if>
                    
                </tr>
            </table>            
        </fieldset>
    </xsl:template>

    
    <xsl:template name="addLicense">
        <a href="?c=edit&amp;TrackID={Params/TrackID}" title="Add New Mechanical License"><img src="/production/images/icons/office/Add-(16x16).gif" style="vertical-align: bottom" /></a>&#160;<a href="?c=edit&amp;TrackID={Params/TrackID}" style="font-weight: bold">Add New Mechanical License</a>
        <br /><br />    
    </xsl:template>
    
    
    <xsl:template name="addControlledComp">
        <xsl:choose>
            <xsl:when test="HasControlledComposition = 1">
                <a href="?c=edit&amp;TrackID={Params/TrackID}&amp;ControlledCompositionID={ControlledCompositionID}" title="Use Existing Controlled Composition"><img src="/production/images/icons/office/Add-(16x16).gif" style="vertical-align: bottom" /></a>&#160;<a href="?c=edit&amp;TrackID={Params/TrackID}&amp;ControlledCompositionID={ControlledCompositionID}" style="font-weight: bold">Use Existing Controlled Composition</a>
                <br /><br />
            </xsl:when>
            <xsl:otherwise>
                <div style="margin-top: -1px; margin-bottom: 0; padding-bottom: 0">
                    <img src="/production/images/icons/office/Add-Disabled-(16x16).gif" style="vertical-align: bottom" />&#160;<a style="font-weight: bold" class="inactive">Use Existing Controlled Composition</a>           
                        <xsl:call-template name="helpIcon">
                        <xsl:with-param name="tip">No controlled composition clause is available for this track.</xsl:with-param>
                    </xsl:call-template>
                </div>
                <br />
            </xsl:otherwise>
        </xsl:choose>    
    </xsl:template>


    <xsl:template name="addPublic">
        <a href="?c=edit&amp;LicenseType=4&amp;TrackID={Params/TrackID}" title="Add New Public Domain"><img src="/production/images/icons/office/Add-(16x16).gif" style="vertical-align: bottom" /></a>&#160;<a href="?c=edit&amp;LicenseType=4&amp;TrackID={Params/TrackID}" style="font-weight: bold">Add New Public Domain</a>
        <br /><br />      
    </xsl:template>
        

    <xsl:template name="addRingtone">
        <td class="landingView">
            <table>
                <tr>
                    <td>
                    <a href="?c=edit&amp;LicenseType=5&amp;TrackID={Params/TrackID}" title="Add New Ringtone License"><img src="/production/images/icons/office/Add-(16x16).gif" style="vertical-align: bottom" /></a>&#160;<a href="?c=edit&amp;LicenseType=5&amp;TrackID={Params/TrackID}" style="font-weight: bold">Add New Ringtone License</a>
                    </td>
                </tr>
            </table>      
        </td>
    </xsl:template>


    <xsl:template name="submitButton">
        <xsl:attribute name="class">hidden</xsl:attribute>
    </xsl:template>


    <xsl:template name="cancelButton">  
        <input type="button" value="Return to Album" onClick="location.href='catalog?AlbumID={Track/AlbumID}&amp;c=show&amp;tab={$licenseTab}'" />
    </xsl:template>


</xsl:stylesheet>

