<!--                                                                  -->
<!--  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="textChart">
      <h2>Search Results</h2>
      <p>
        <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>
      <xsl:if test="count(ArtistPayee) != 0">
        <table class="textChartHi">
          <tr>
            <xsl:if test="Params/_inline">
              <th class="rowLeft selectCol">Select</th>
            </xsl:if>
            <th>
              <xsl:if test="not(Params/_inline)">
                <xsl:attribute name="class">rowLeft</xsl:attribute>
              </xsl:if>
              Name
            </th>
            <xsl:if test="not(Params/_inline)">
              <th class="editCol">Edit</th>
            </xsl:if>
          </tr>
          <xsl:for-each select="ArtistPayee">
            <tr class="row{position() mod 2}">
              <xsl:if test="/Root/Params/_inline">
                <td class="rowLeft">
                  <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>
                <xsl:attribute name="class">
                  <xsl:if test="not(/Root/Params/_inline)">rowLeft left</xsl:if>
                  <xsl:if test="/Root/Params/_inline">left</xsl:if>
                </xsl:attribute>
                <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>
                  <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>
        </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>

