<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:template name="catalogEditLayout">
    	<script src="/production/javascript/validateAdditionalArtist.js?v=3" type="text/javascript"></script>

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

    	<form action="/rps/catalog" name="catalogEntry" id="catalogEntry" method="post">
<!--
				<input type="hidden" name="raw" value="1" />
-->

	      <div class="section" id="catalogEdit">
		    	<input type="hidden" name="formSubmit" value="1" />
		    	<input type="hidden" name="c" value="edit" />

		    	<xsl:if test="Params/show_errors">
		    		<input type="hidden" name="show_errors" value="1" />
		    	</xsl:if>

		      <xsl:call-template name="albumEdit" />
	      </div>

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

      </form>
  </xsl:template>

  <xsl:template name="albumEdit">
    <xsl:param name="columns" />
    <xsl:if test="normalize-space(Form/Album/AlbumID)">
      <input type="hidden" name="AlbumID" value="{Form/Album/AlbumID}" />
    </xsl:if>
    <xsl:if test="Form/Album/AlbumID = ''">
      <input type="hidden" name="new" value="1" />
    </xsl:if>

    <div id="roleSelectTemplate" style="display:none">
      <xsl:call-template name="additionalArtistRoleSelect" />
    </div>

    <p class="formHeader">Enter album information here.</p>
    <hr />

    <xsl:call-template name="openRunStatusMessage" />
  	<xsl:call-template name="errorMessageGeneral" />
  	<xsl:call-template name="albumEditFields" />
  	<br class="superBreak" />
  	<br />

  </xsl:template>

  <xsl:template name="albumEditFields">
  	<div class="column1">
			<table id="albumTable">
				<xsl:call-template name="catalogNumberRow" />
				<xsl:call-template name="catalogTitleRow" />
				<xsl:call-template name="catalogTitleVersionRow" />
				<xsl:call-template name="catalogArtistRow" />
				<xsl:call-template name="catalogAdditionalArtistRow" />
				<xsl:call-template name="catalogLabelRow" />
				<xsl:call-template name="catalogCLineRow" />
				<xsl:call-template name="catalogPLineRow" />
				<xsl:call-template name="catalogGenrePrimaryRow" />
				<xsl:call-template name="catalogGenreSecondaryRow" />
				<xsl:call-template name="catalogClearedForDistributionRow" />
				<xsl:call-template name="catalogStatusRow" />
				<xsl:call-template name="catalogClientAlbumIDRow" />
				<xsl:call-template name="catalogCustom1Row" />
				<xsl:call-template name="catalogCustom2Row" />
				<xsl:call-template name="catalogCustom3Row" />

                <xsl:if test="ClientTypes/ClientType[ClientTypeID = 2]/IsClientTypeFlag != 1 and ClientTypes/ClientType[ClientTypeID = 5]/IsClientTypeFlag != 1 and ClientTypes/ClientType[ClientTypeID = 6]/IsClientTypeFlag != 1">
					<xsl:call-template name="catalogUPCRow" />
					<xsl:call-template name="catalogReleaseDateRow" />
				</xsl:if>

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

			</table>
		</div>
  </xsl:template>

  <xsl:template name="catalogImageRow">
		<tr>
			<td class="leftCol"><label for="Form_Album_CatalogImage">Cover Art:</label></td>
			<td>
			</td>
		</tr>
  </xsl:template>

  <xsl:template name="catalogNumberRow">
		<tr>
			<td class="leftCol"><label for="Form_Album_CatalogNumber">*Catalog #:</label></td>
			<td class="catalogNumber">
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Album/CatalogNumber</xsl:with-param>
					<xsl:with-param name="displayName">Catalog #</xsl:with-param>
				</xsl:call-template>
				<input type="text" name="Form_Album_CatalogNumber" id="Form_Album_CatalogNumber" maxlength="20" value="{Form/Album/CatalogNumber}" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
                </input>
			</td>
		</tr>
  </xsl:template>

  <xsl:template name="catalogTitleRow">
		<tr>
			<td class="leftCol"><label for="Form_Album_Title">*Title:</label></td>
			<td>
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Album/Title</xsl:with-param>
					<xsl:with-param name="displayName">Title</xsl:with-param>
				</xsl:call-template>
				<input type="text" class="titleField" name="Form_Album_Title" id="Form_Album_Title" value="{Form/Album/Title}" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
                </input>
			</td>
		</tr>
  </xsl:template>

	<xsl:template name="catalogTitleVersionRow">
		<tr>
			<td class="leftCol"><label for="Form_Album_TitleVersion">Title Version:</label></td>
			<td>
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Album/TitleVersion</xsl:with-param>
					<xsl:with-param name="displayName">Title Version</xsl:with-param>
				</xsl:call-template>
				<input type="text" name="Form_Album_TitleVersion" id="Form_Album_TitleVersion" maxlength="50" value="{Form/Album/TitleVersion}" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
                </input>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogArtistRow">
		<tr>
			<td class="leftCol"><label for="Form_Album_ArtistName">*Primary Artist:</label></td>
			<td class="artistNameCell">
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Album/ArtistName</xsl:with-param>
					<xsl:with-param name="displayName">Artist</xsl:with-param>
				</xsl:call-template>

				<div id="myAutoComplete">
					<input id="Form_Album_ArtistName" name="Form_Album_ArtistName" type="text" class="artistNameField" value="{Form/Album/ArtistName}" >
                      <xsl:if test="$openRuns = 1">
                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                      </xsl:if>
                    </input>&#160;<span id="noMatchWarning" class="yui-ac-warning"></span>
					<input type="hidden" name="Form_Album_ArtistID" id="Form_Album_ArtistID" value="{Form/Album/ArtistID}" />
					<div id="myContainer"></div>
          <script src="/production/javascript/autocomplete/artist.js?t={$now}" type="text/javascript"></script>
          <script type="text/javascript">
              var myAutoComp = new YAHOO.widget.RSArtistAutoComplete("myContainer","Form_Album_ArtistName", "Form_Album_ArtistID",
               {
                  "noMatchWarningID": "noMatchWarning"
               }
              );
          </script>
				</div>

			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogAdditionalArtistRow">

      <xsl:for-each select="Form/Album/AdditionalArtistList/AdditionalArtist">
		<xsl:sort select="New" />
		<xsl:sort select="AdditionalArtistID" data-type="number" />
		<xsl:sort select="OriginalKey" />
        <xsl:call-template name="catalogAdditionalArtistRowWithKey" >
          <xsl:with-param name="key">
			<xsl:choose>
			  <xsl:when test="normalize-space(OriginalKey)"><xsl:value-of select="OriginalKey" /></xsl:when>
			  <xsl:otherwise><xsl:value-of select="/Root/Form/Album/AlbumID" />.<xsl:value-of select="ArtistID" />.<xsl:value-of select="Role/ArtistRoleID" /></xsl:otherwise>
		    </xsl:choose>
		  </xsl:with-param>
        </xsl:call-template>
      </xsl:for-each>

      <tr id="addLinkRow">
        <td class="leftCol"></td>
        <td>
          <xsl:if test="$openRuns = 0">
            <p class="addLink">
              <a id="addImageLink" href="javascript:addAdditionalArtist(0,'Album');" tip="Add Another Artist">
                <img height="16" width="16" src="/production/images/icons/office/Add-(16x16).gif"/>
              </a>
              <a id="addTextLink" href="javascript:addAdditionalArtist(0,'Album')" tip="">Add Another Artist</a>
            </p>
		  </xsl:if>
        </td>
      </tr>

    </xsl:template>

	<xsl:template name="catalogAdditionalArtistRowWithKey">
      <xsl:param name="key" />
      <tr>
        <td class="leftCol"><label for="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_Name">Additional Artist:</label></td>
        <td class="artistNameCell">
          <xsl:call-template name="inlineError">
            <xsl:with-param name="path">Name</xsl:with-param>
            <xsl:with-param name="displayName">Artist</xsl:with-param>
          </xsl:call-template>
          <div id="myAutoComplete_{$key}">
            <input id="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_Name" name="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_Name" type="text" class="artistNameField" value="{Name}" >
              <xsl:if test="$openRuns = 1">
                <xsl:attribute name="disabled">disabled</xsl:attribute>
              </xsl:if>
            </input>&#160;<span id="noMatchWarning_{$key}" class="yui-ac-warning"></span>
            <input type="hidden" name="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_ArtistID" id="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_ArtistID" value="{ArtistID}" />
            <input type="hidden" name="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_AlbumID" id="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_AlbumID" value="{/Root/Form/Album/AlbumID}" />
            <input type="hidden" name="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_OriginalKey" id="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_OriginalKey" value="{$key}" />
            <div id="myContainer_{$key}"></div>
            <script src="/production/javascript/autocomplete/artist.js?t={$now}" type="text/javascript"></script>
            <script type="text/javascript">
              var myAutoComp = new YAHOO.widget.RSArtistAutoComplete("myContainer_<xsl:value-of select="$key"/>","Form_Album_AdditionalArtistList_AdditionalArtist_<xsl:value-of select="$key"/>_Name", "Form_Album_AdditionalArtistList_AdditionalArtist_<xsl:value-of select="$key"/>_ArtistID",
                { "noMatchWarningID": "noMatchWarning_<xsl:value-of select="$key"/>" }
              );
            </script>
          </div>
        </td>
      </tr>
      <tr>
        <td class="leftCol"><label for="additionalArtistRoleSelect_{$key}">Role: </label></td>
        <td class="artistNameCell">
          <xsl:call-template name="inlineError">
            <xsl:with-param name="path">ArtistRoleID</xsl:with-param>
            <xsl:with-param name="displayName">Role</xsl:with-param>
          </xsl:call-template>
          <xsl:call-template name="additionalArtistRoleSelect" >
            <xsl:with-param name="formIndex"><xsl:value-of select="$key" /></xsl:with-param>
            <xsl:with-param name="selectedID"><xsl:value-of select="Role/ArtistRoleID" /></xsl:with-param>
          </xsl:call-template>&#160;
          <span><input type="checkbox" value="1" name="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_Delete" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
		          <xsl:if test="normalize-space(Delete)">
					<xsl:attribute name="checked">CHECKED</xsl:attribute>
				  </xsl:if>
		        </input>
		  &#160;<label for="Form_Album_AdditionalArtistList_AdditionalArtist_{$key}_Delete">Remove</label></span>
        </td>
      </tr>
    </xsl:template>

    <xsl:template name="additionalArtistRoleSelect" >
      <xsl:param name="formIndex" />
      <xsl:param name="selectedID" />

      <select id="additionalArtistRoleSelect_{$formIndex}">
        <xsl:if test="$openRuns = 1">
          <xsl:attribute name="disabled">disabled</xsl:attribute>
        </xsl:if>
        <xsl:if test="normalize-space($formIndex)" >
          <xsl:attribute name="name">Form_Album_AdditionalArtistList_AdditionalArtist_<xsl:value-of select="$formIndex" />_ArtistRoleID</xsl:attribute>
        </xsl:if>
        <option value="0">Choose...</option>
        <xsl:for-each select="/Root/Form/ArtistRoleList/ArtistRole" >
          <option value="{ArtistRoleID}">
            <xsl:if test="ArtistRoleID = $selectedID">
              <xsl:attribute name="selected">selected</xsl:attribute>
            </xsl:if>
            <xsl:value-of select="Role" />
          </option>
        </xsl:for-each>
      </select>
    </xsl:template>

	<xsl:template name="catalogLabelRow">
		<xsl:choose>
			<xsl:when test="Form/LabelList/Label">
				<script type="text/javascript">
					requireField("Form_Album_LabelID","Label must be selected.<br />");
				</script>
				<tr>
					<td class="leftCol"><label for="Form_Album_LabelID">*Label:</label></td>
					<td>
						<xsl:call-template name="inlineError">
							<xsl:with-param name="path">Form/Album/LabelID</xsl:with-param>
							<xsl:with-param name="displayName">Label</xsl:with-param>
						</xsl:call-template>
						<select name="Form_Album_LabelID" id="Form_Album_LabelID">
                          <xsl:if test="$openRuns = 1">
                            <xsl:attribute name="disabled">disabled</xsl:attribute>
                          </xsl:if>
							<option value="">Choose...</option>
							<xsl:for-each select="Form/LabelList/Label">
								<option value="{LabelID}">
									<xsl:if test="LabelID = /Root/Form/Album/LabelID">
										<xsl:attribute name="selected">selected</xsl:attribute>
									</xsl:if>
									<xsl:value-of select="LabelName" />
								</option>
							</xsl:for-each>
						</select>
					</td>
				</tr>
			</xsl:when>
			<xsl:otherwise>
				<input type="hidden" name="Form_Album_LabelID" value="{Form/Album/LabelID}" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="catalogStatusRow">
		<tr>
			<td class="leftCol"><label for="Form_Album_Status">Status:</label></td>
			<td>
				<select name="Form_Album_Status" id="Form_Album_Status">
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
					<option value="1">Active</option>
					<option value="0">
						<xsl:if test="Form/Album/Status = 0">
							<xsl:attribute name="selected">selected</xsl:attribute>
						</xsl:if>
						Inactive
					</option>
				</select>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogCLineRow">
		<tr>
			<td class="leftCol"><label for="Form_Album_CLine">(C) Line:</label></td>
			<td>
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Album/CLine</xsl:with-param>
					<xsl:with-param name="displayName">(C) Line</xsl:with-param>
				</xsl:call-template>
				<input type="text" name="Form_Album_CLine" id="Form_Album_CLine" maxlength="50" value="{Form/Album/CLine}" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
				</input>
				<xsl:call-template name="helpIcon">
        	<xsl:with-param name="tip">The Copyright Line is a four-digit year followed<xsl:value-of select="$tipBreak" />by a space and the copyright holder's name.</xsl:with-param>
        </xsl:call-template>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogPLineRow">
		<tr>
			<td class="leftCol"><label for="Form_Album_PLine">(P) Line:</label></td>
			<td>
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Album/PLine</xsl:with-param>
					<xsl:with-param name="displayName">(P) Line</xsl:with-param>
				</xsl:call-template>
				<input type="text" name="Form_Album_PLine" id="Form_Album_PLine" maxlength="50" value="{Form/Album/PLine}" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
				</input>
				<xsl:call-template name="helpIcon">
        	<xsl:with-param name="tip">The Phonogram Copyright Line is a four-digit year followed<xsl:value-of select="$tipBreak" />by a space and the phonogram copyright holder's name.</xsl:with-param>
        </xsl:call-template>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogGenrePrimaryRow">
		<xsl:choose>
			<xsl:when test="Form/GenreList/Genre">
				<tr>
					<td class="leftCol"><label for="Form_Album_GenrePrimaryID">Primary Genre:</label></td>
					<td>
						<xsl:call-template name="inlineError">
							<xsl:with-param name="path">Form/Album/GenrePrimaryID</xsl:with-param>
							<xsl:with-param name="displayName">Primary Genre</xsl:with-param>
						</xsl:call-template>
						<select name="Form_Album_GenrePrimaryID" id="Form_Album_GenrePrimaryID">
                          <xsl:if test="$openRuns = 1">
                            <xsl:attribute name="disabled">disabled</xsl:attribute>
                          </xsl:if>
							<option value="">Choose...</option>
							<xsl:for-each select="Form/GenreList/Genre">
								<option value="{GenreID}">
									<xsl:if test="GenreID = /Root/Form/Album/GenrePrimaryID">
										<xsl:attribute name="selected">selected</xsl:attribute>
									</xsl:if>
									<xsl:value-of select="GenreName" />
								</option>
							</xsl:for-each>
						</select>
					</td>
				</tr>
			</xsl:when>
			<xsl:otherwise>
				<input type="hidden" name="Form_Album_GenrePrimaryID" value="{Form/Album/GenrePrimaryID}" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="catalogGenreSecondaryRow">
		<xsl:choose>
			<xsl:when test="Form/GenreList/Genre">
				<tr>
					<td class="leftCol"><label for="Form_Album_GenreSecondaryID">Secondary Genre:</label></td>
					<td>
						<xsl:call-template name="inlineError">
							<xsl:with-param name="path">Form/Album/GenreSecondaryID</xsl:with-param>
							<xsl:with-param name="displayName">Secondary Genre</xsl:with-param>
						</xsl:call-template>
						<select name="Form_Album_GenreSecondaryID" id="Form_Album_GenreSecondaryID">
                          <xsl:if test="$openRuns = 1">
                            <xsl:attribute name="disabled">disabled</xsl:attribute>
                          </xsl:if>
							<option value="">Choose...</option>
							<xsl:for-each select="Form/GenreList/Genre">
								<option value="{GenreID}">
									<xsl:if test="GenreID = /Root/Form/Album/GenreSecondaryID">
										<xsl:attribute name="selected">selected</xsl:attribute>
									</xsl:if>
									<xsl:value-of select="GenreName" />
								</option>
							</xsl:for-each>
						</select>
					</td>
				</tr>
			</xsl:when>
			<xsl:otherwise>
				<input type="hidden" name="Form_Album_GenreSecondaryID" value="{Form/Album/GenreSecondaryID}" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="catalogClearedForDistributionRow">
      <xsl:if test="$isDistClient = 1">
      <tr>
        <td class="leftCol"><label for="Form_ProductDigital_DistAllow">Cleared For Distribution:</label></td>
        <td>
          <xsl:call-template name="inlineError">
            <xsl:with-param name="path">Form/ProductDigital/DistAllow</xsl:with-param>
            <xsl:with-param name="displayName">Distribution Allowed</xsl:with-param>
          </xsl:call-template>
          <select name="Form_ProductDigital_DistAllow">
            <xsl:if test="$openRuns = 1">
              <xsl:attribute name="disabled">disabled</xsl:attribute>
            </xsl:if>
            <option value="1">
              <xsl:if test="Form/ProductDigital/DistAllow = 1">
                <xsl:attribute name="selected">selected</xsl:attribute>
              </xsl:if>
              Yes
            </option>
            <option value="0">
              <xsl:if test="Form/ProductDigital/DistAllow = 0">
                <xsl:attribute name="selected">selected</xsl:attribute>
              </xsl:if>
              No
            </option>
          </select>
        </td>
      </tr>
      </xsl:if>
	</xsl:template>

	<xsl:template name="catalogRequiredRow">
		<tr>
			<td colspan="2">
				<br />*Required field
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogClientAlbumIDRow">
		<tr>
			<td class="leftCol"><label for="Form_Album_ClientAlbumID">Client Album ID:</label></td>
			<td>
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Album/ClientAlbumID</xsl:with-param>
					<xsl:with-param name="displayName">Client Album ID</xsl:with-param>
				</xsl:call-template>
				<input type="text" name="Form_Album_ClientAlbumID" id="Form_Album_ClientAlbumID" maxlength="50" value="{Form/Album/ClientAlbumID}" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
				</input>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogCustom1Row">
		<tr>
			<td class="leftCol"><label for="Form_Album_Custom1">Custom 1:</label></td>
			<td>
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Album/Custom1</xsl:with-param>
					<xsl:with-param name="displayName">Custom 1</xsl:with-param>
				</xsl:call-template>
				<input type="text" name="Form_Album_Custom1" id="Form_Album_Custom1" maxlength="50" value="{Form/Album/Custom1}" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
				</input>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogCustom2Row">
		<tr>
			<td class="leftCol"><label for="Form_Album_Custom2">Custom 2:</label></td>
			<td>
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Album/Custom2</xsl:with-param>
					<xsl:with-param name="displayName">Custom 2</xsl:with-param>
				</xsl:call-template>
				<input type="text" name="Form_Album_Custom2" id="Form_Album_Custom2" maxlength="50" value="{Form/Album/Custom2}" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
				</input>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogCustom3Row">
		<tr>
			<td class="leftCol"><label for="Form_Album_Custom3">Custom 3:</label></td>
			<td>
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Album/Custom3</xsl:with-param>
					<xsl:with-param name="displayName">Custom 3</xsl:with-param>
				</xsl:call-template>
				<input type="text" name="Form_Album_Custom3" id="Form_Album_Custom3" maxlength="50" value="{Form/Album/Custom3}" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
				</input>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogUPCRow">
		<tr>
			<td class="leftCol"><label for="Form_Product_UPC">*Digital UPC</label></td>
			<td>
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Product/UPC</xsl:with-param>
					<xsl:with-param name="displayName">UPC</xsl:with-param>
				</xsl:call-template>
				<input type="text" class="upcField" name="Form_Product_UPC" id="Form_Product_UPC" value="{Form/Product/UPC}" >
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
				</input>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="catalogReleaseDateRow">
		<tr>
			<td class="leftCol"><label for="Form_Product_ReleaseDate">Release Date:</label></td>
			<td>
				<xsl:call-template name="inlineError">
					<xsl:with-param name="path">Form/Product/ReleaseDate</xsl:with-param>
					<xsl:with-param name="displayName">Release Date</xsl:with-param>
				</xsl:call-template>
				<input type="text" class="dateField" name="Form_Product_ReleaseDate" id="Form_Product_ReleaseDate">
                  <xsl:if test="$openRuns = 1">
                    <xsl:attribute name="disabled">disabled</xsl:attribute>
                  </xsl:if>
					<xsl:attribute name="value">
						<xsl:choose>
							<xsl:when test="normalize-space(Form/Product/ReleaseDate)">
								<xsl:value-of select="Form/Product/ReleaseDate" />
							</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="Form/TodaysDate" />
							</xsl:otherwise>
						</xsl:choose>
					</xsl:attribute>
				</input>
				<a title="Select Release Date">
					<img src="/production/images/icons/office/Calendar-(16x16).gif" height="16" width="16" id="calendarIcon" class="calendarIcon" />
				</a>
			</td>
		</tr>
		<xsl:call-template name="calendar">
			<xsl:with-param name="fieldID">Form_Product_ReleaseDate</xsl:with-param>
			<xsl:with-param name="buttonID">calendarIcon</xsl:with-param>
		</xsl:call-template>
	</xsl:template>

  <xsl:template name="catalogImageForm">
		<div id="catalogImageForm">
			<xsl:if test="/Root//*[@emsg] or /Root//*[@e] or (Params/show_errors and Form/Album/AlbumArt = '')">
				<xsl:attribute name="class">withErrorBox</xsl:attribute>
			</xsl:if>
			<xsl:if test="Form/RoyaltyRunStatus/CanEdit = 0">
				<xsl:attribute name="class">withOpenRunBox</xsl:attribute>
			</xsl:if>			
			<xsl:if test="Form/Album/AlbumID != ''">
				<table>
				  <tr class="labelTop">
					  <td class="leftCol"><label for="Form_Album_CatalogImage">Cover&#160;Art:</label></td>
						<td class="thumbCell">
							<xsl:variable name="thumbSrc">
								<xsl:choose>
									<xsl:when test="Form/Album/AlbumArtThumbnail = ''">/production/images/no_album_art.png</xsl:when>
									<xsl:otherwise><xsl:value-of select="Form/Album/AlbumArtThumbnail" /></xsl:otherwise>
								</xsl:choose>
							</xsl:variable>
							<img id="uploadImage" src="{$thumbSrc}" class="albumCoverThumb" width="100" height="100" />

							<img src="/production/images/dashed_divider.gif" width="1" height="110" alt="" />
						</td>
						<td>
							<b>Upload your album cover art here:</b>
							<br /><br />
						  <div id="uploadMessage">
						  	<xsl:if test="Params/show_errors = 1 and Form/Album/AlbumArt = ''"><span class="error">Cover Art missing</span></xsl:if>
						  </div>
						  <form id="fileUpload" name="fileUpload" onSubmit="oUpload.uploadFile(); return false;" method="post" enctype="multipart/form-data" encoding="multipart/form-data" action="#">
		            <input type="hidden" name="albumID" value="{Form/Album/AlbumID}" />
		            <input type="hidden" name="c" value="image_upload" />
						    <input type="file" size="30" name="fileUpload"/>
						    <div id="uploadSubmit"><input type="submit" value="Upload" /></div>
						  </form>
						  <br />
						  <span class="finePrint">
							  RoyaltyShare strongly recommends that cover art submissions meet or exceed the following specifications.
								<br /><br />
								Dimensions: <b>1425 x 1425</b><br />
								Resolution: <b>300 DPI</b><br />
								Format: <b>JPG or TIFF</b><br />
								Composition: <b>RGB (even if they are black and white)</b><br />
								Shape: <b>Square</b><br />
								<br /><br />
								The following are the minimum specifications that RoyaltyShare will accept for cover art submissions.  Please be aware that these minimums may produce undesirable results on some services.
								<br /><br />
								Dimensions: <b>600 x 600</b><br />
								Resolution: <b>72 DPI</b><br />
								Format: <b>JPG or TIFF</b><br />
								Composition: <b>RGB (even if they are black and white)</b><br />
								Shape: <b>Square</b>
							</span>
						</td>
				  </tr>
				</table>
				<script type="text/javascript">
				  var oUpload = new RSImageUpload( { url: "/rps/catalog", progressBar: "/production/images/pb_gap.gif", image: "uploadImage", button: "uploadSubmit", form: "fileUpload", message: "uploadMessage" } );
				</script>
			</xsl:if>
		</div>
  </xsl:template>

</xsl:stylesheet>
