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

    <xsl:template name="searchResults">
        <div class="Table">
            <h2>
                Search Results
                <p class="Heading-addition">
                    <xsl:value-of select="count(ArtistPayee)" /><xsl:choose><xsl:when test="Params/Query"> match<xsl:if test="count(ArtistPayee) != 1">es</xsl:if> found for '<strong><xsl:value-of select="Params/Query" /></strong>'</xsl:when><xsl:otherwise> total payee<xsl:if test="count(ArtistPayee) != 1">s</xsl:if></xsl:otherwise></xsl:choose>
                </p>
            </h2>
            <xsl:if test="count(ArtistPayee) != 0">
                <table class="Table">
                    <thead>
                        <tr class="Table-row Table-row-header">
                            <xsl:if test="Params/_inline">
                                <th class="Table-col">Select</th>
                            </xsl:if>
                            <th class="Table-col">
                                Name
                            </th>
                            <xsl:if test="not(Params/_inline)">
                                <th class="Table-col">Edit</th>
                            </xsl:if>
                        </tr>
                    </thead>
                    <tbody>
                        <xsl:for-each select="ArtistPayee">
                            <tr class="Table-row Table-row-data">
                                <xsl:if test="/Root/Params/_inline">
                                    <td class="Table-col">
                                        <input type="radio" name="payeeMatch" value="{position()}" onClick="modifyField('selectMatch','enable');" />
                                    </td>
                                    <script type="text/javascript">
                                        match<xsl:value-of select="position()" /> = new Object();
                                        match<xsl:value-of select="position()" />['ArtistPayeeID'] = '<xsl:value-of select="ArtistPayeeID" />';
                                        match<xsl:value-of select="position()" />['Name'] = '<xsl:call-template name="fixQuotes"><xsl:with-param name="string" select="Name" /></xsl:call-template>';
                                        matchCollection['position<xsl:value-of select="position()" />'] = match<xsl:value-of select="position()" />;
                                    </script>
                                </xsl:if>
                                <td class="Table-col">
                                    <a>
                                        <xsl:if test="not(/Root/Params/_inline)">
                                            <xsl:attribute name="href">payee?ArtistPayeeID=<xsl:value-of select="ArtistPayeeID" />&amp;c=show</xsl:attribute>
                                        </xsl:if>
                                        <xsl:value-of select="Name" />
                                    </a>
                                </td>
                                <xsl:if test="not(/Root/Params/_inline)">
                                    <td class="Table-col">
                                        <a href="payee?c=edit&amp;ArtistPayeeID={ArtistPayeeID}" title="Edit">
                                            <img src="/production/images/icons/mini/edit.gif" width="11" height="12" />
                                        </a>
                                    </td>
                                </xsl:if>
                            </tr>
                        </xsl:for-each>
                    </tbody>
                </table>
                <xsl:if test="Params/_inline">
                    <script type="text/javascript">
                        window.matchCollection = matchCollection;
                    </script>
                </xsl:if>
            </xsl:if>
        </div>
        <xsl:if test="count(ArtistPayee) != 0 and Params/_inline">
            <xsl:call-template name="buttons" />
        </xsl:if>
    </xsl:template>

</xsl:stylesheet>

