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


	<xsl:variable name="showDistTab">
		<xsl:if test="/Root/Access/rps/product/show_digital">1</xsl:if>
	</xsl:variable>

	
	<xsl:variable name="isDistClient" select="/Root/ClientTypes/ClientType[ClientTypeID = 4]/IsClientTypeFlag" />


	<xsl:variable name="showTabs">
		<xsl:choose>
			<xsl:when test="/Root/Access/rps/catalog/show_contracts or /Root/Access/rps/catalog/show_licenses or /Root/Access/rps/catalog/show_uk_licenses or /Root/Access/rps/catalog/show_ca_licenses or $showDistTab = 1">1</xsl:when>
			<xsl:otherwise>0</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>


    <xsl:template name="catalogViewLayout">

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

        <script type="text/javascript">
    
            var mainTab        = new Object();
            mainTab.url        = "/rps/catalog?c=show_main&amp;AlbumID=<xsl:value-of select="Form/Album/AlbumID" />";
            mainTab.id         = "mainTab";
            mainTab.text       = "Main";
            mainTab.visible    = "<xsl:value-of select="Access/rps/catalog/show_main" />";
            mainTab.enabled    = "1";
            mainTab.show_count = "0";
            mainTab.loading_image = "/production/images/loading.gif";
    
            var contractTab        = new Object();
            contractTab.url        = "/rps/catalog?c=show_contracts&amp;AlbumID=<xsl:value-of select="Form/Album/AlbumID" />";
            contractTab.id         = "contractTab";
            contractTab.text       = "Contracts";
            contractTab.visible    = "<xsl:value-of select="Access/rps/catalog/show_contracts" />";
            contractTab.enabled    = "1";
            contractTab.show_count = "1";
            contractTab.loading_image = "/production/images/loading.gif";
    
            var caLicenseTab        = new Object();
            caLicenseTab.url        = "/rps/catalog?c=show_ca_licenses&amp;AlbumID=<xsl:value-of select="Form/Album/AlbumID" />";
            caLicenseTab.id         = "caLicenseTab";
            caLicenseTab.text       = "CA Licenses";
            caLicenseTab.visible    = "<xsl:value-of select="Access/rps/catalog/show_ca_licenses" />";
            caLicenseTab.enabled    = "1";
            caLicenseTab.show_count = "1";
            caLicenseTab.loading_image = "/production/images/loading.gif";  
    
            var ukLicenseTab        = new Object();
            ukLicenseTab.url        = "/rps/catalog?c=show_uk_licenses&amp;AlbumID=<xsl:value-of select="Form/Album/AlbumID" />";
            ukLicenseTab.id         = "ukLicenseTab";
            ukLicenseTab.text       = "UK Licenses";
            ukLicenseTab.visible    = "<xsl:value-of select="Access/rps/catalog/show_uk_licenses" />";
            ukLicenseTab.enabled    = "1";
            ukLicenseTab.show_count = "1";
            ukLicenseTab.loading_image = "/production/images/loading.gif";  
    
            var licenseTab        = new Object();
            licenseTab.url        = "/rps/catalog?c=show_licenses&amp;AlbumID=<xsl:value-of select="Form/Album/AlbumID" />";
            licenseTab.id         = "licenseTab";   
            licenseTab.text       = "US Licenses";
            licenseTab.visible    = "<xsl:value-of select="Access/rps/catalog/show_licenses" />";
            licenseTab.enabled    = "1";
            licenseTab.show_count = "1";
            licenseTab.loading_image = "/production/images/loading.gif";     
    
            var distributionTab        = new Object();
            distributionTab.url        = "/rps/product?c=show_digital&amp;AlbumID=<xsl:value-of select="Form/Album/AlbumID" />";
            distributionTab.id         = "distributionTab";
            distributionTab.text       = "Distribution";
            distributionTab.visible    = "<xsl:value-of select="$showDistTab" />";
            distributionTab.enabled    = "1";
            distributionTab.show_count = "1";
            distributionTab.loading_image = "/production/images/loading.gif";
   
    
            var aTabs = new Array( mainTab, contractTab, caLicenseTab, ukLicenseTab, licenseTab, distributionTab );
            var oTabUpdateObj = new RSCatalogTabOnclickUpdate( "oTabUpdateObj", "mainCatalogPanel", "catalogNav", aTabs );
    
            <xsl:choose>
                <xsl:when test="Params/tab = 'distributionTab'">
                    oTabUpdateObj.ActivateTab( 'distributionTab' );
                </xsl:when>
                <xsl:when test="Params/tab = 'contractTab'">
                    oTabUpdateObj.ActivateTab( 'contractTab' );
                </xsl:when>
                <xsl:when test="Params/tab = 'licenseTab'">
                    oTabUpdateObj.ActivateTab( 'licenseTab' );
                </xsl:when>
                <xsl:when test="Params/tab = 'ukLicenseTab'">
                    oTabUpdateObj.ActivateTab( 'ukLicenseTab' );
                </xsl:when>   
                <xsl:when test="Params/tab = 'caLicenseTab'">
                    oTabUpdateObj.ActivateTab( 'caLicenseTab' );
                </xsl:when>                  
                <xsl:otherwise>
                    oTabUpdateObj.ActivateTab( 'mainTab' );
                </xsl:otherwise>
            </xsl:choose>

			function displayErrorReport() {
				displayInline('/rps/catalog?AlbumID=<xsl:value-of select="Form/Album/AlbumID" />&amp;c=error_report');
			}

			<xsl:if test="Params/error_report">
    		// allow the error report to pop up automatically
    		addEvent(window, 'load', displayErrorReport, false);
			</xsl:if>

        </script>
    </xsl:template>


    <xsl:template name="catalogView">

        <div class="section">
            <xsl:call-template name="successMessageGeneral">
                <xsl:with-param name="successMessage">Album successfully updated!</xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="albumDetailView" /><br /><br />
        </div>
    
        <xsl:call-template name="catalogViewTabs" />
    
        <div class="section">
        	<xsl:if test="$showTabs = 1">
        		<xsl:attribute name="class">section withTabs</xsl:attribute>
        	</xsl:if>
    
        	<div id="mainCatalogPanel">
     	    </div>
     			
     	    <br />
            <br />
        </div>

    </xsl:template>


    <xsl:template name="catalogViewTabs">
        <div class="sectionNav">
    	    <xsl:if test="$showTabs != 1">
    		    <xsl:attribute name="style">display: none</xsl:attribute>
    	    </xsl:if>
    	    <table>
    		    <tr>
    			    <td>
    				    <ul id="catalogNav"></ul>
    			    </td>
    		    </tr>
    	    </table>
        </div>
    </xsl:template>


  <xsl:template name="albumDetailView">
    <fieldset id="albumView">
      <legend>Album</legend>
      	
        <table class="textChart">
          <tbody>
            <tr class="row1">
            
            	<td rowspan="9" class="albumCoverContainer">	  

            		<xsl:choose>
            			<xsl:when test="Form/Album/AlbumArtThumbnail = '/production/images/no_album_thumbnail.png' or Form/Album/AlbumArtThumbnail = ''">
            				<img src="/production/images/no_album_thumbnail.png" class="albumCoverThumb" />
										
										<xsl:if test="Access/rps/catalog/image_upload">	
            					<div class="addArtLink">
            						<a href="catalog?AlbumID={Form/Album/AlbumID}&amp;c=edit">Add Cover Art</a>
            					</div>
										</xsl:if>

            			</xsl:when>
            			<xsl:otherwise>
		            		<script type="text/javascript">     		
											var albumCover = new Image(600,600);									
											albumCover.src = '<xsl:value-of select="Form/Album/AlbumArt" />';
		            		</script>
		            		<a href="javascript:showAlbumCover(albumCover)" title="Enlarge Cover Art">
		            			<img style="background-image: url({Form/Album/AlbumArtThumbnail})" src="/production/images/zoomAlbumCover.png" class="albumCoverThumb" height="100" width="100" />
		            		</a>	 
		            	</xsl:otherwise> 
		            </xsl:choose>
		                      	
            	</td>
            	
                <td>
                    <b>Title:</b>&#160;<xsl:value-of select="Form/Album/Title" /><xsl:if test="normalize-space(Form/Album/TitleVersion)">&#160;(<xsl:value-of select="Form/Album/TitleVersion" />)</xsl:if>   
                    <!--           	
                    <xsl:if test="/Root/Access/app/reports/a">
                        <xsl:for-each select="Form/Album/ProductList/Product">            	
                            &#160;<a href="/app/reports?c=a&amp;product={ProductID}" title="Sales Analytics for &quot;{UPC}&quot;" class="iconLink"><img src="/production/images/icons/office/Pie-Chart2-(14x14).png" /></a>
                        </xsl:for-each>
                    </xsl:if>
                    -->
                </td>
              
              <td><b>Catalog #:</b>&#160;<xsl:value-of select="Form/Album/CatalogNumber" /></td>
              
            </tr>
            
            <tr>
              <td>
              	<b>Artist:</b>&#160;<xsl:value-of select="Form/Album/ArtistName" />
              	<xsl:if test="count(Form/Album/AdditionalArtistList/AdditionalArtist) != 0">
              		&#160;<a class="iconLink">
              		  <xsl:attribute name="title">
              		    <xsl:for-each select="Form/Album/AdditionalArtistList/AdditionalArtist">
              		      <xsl:sort select="AdditionalArtistID" data-type="number" />
              		      <xsl:call-template name="escapeJavascript">
              		        <xsl:with-param name="string" select="Name" />
              		      </xsl:call-template> (<xsl:value-of select="Role/Role" />)<xsl:value-of select="$tipBreak" />
              		    </xsl:for-each>
              		  </xsl:attribute>
              		  <img src="/production/images/icons/speech_bubble.gif" />
              		</a>
              	</xsl:if>                	
              	<xsl:if test="Form/Album/ArtistID != 0 and /Root/Access/app/reports/r">
              		&#160;<a href="/app/reports?c=r&amp;artist={Form/Album/ArtistID}" title="Sales Analytics for &quot;{Form/Album/ArtistName}&quot;" class="iconLink"><img src="/production/images/icons/office/Pie-Chart2-(14x14).png" /></a>
              	</xsl:if>
              </td>
              <td>
              	<xsl:variable name="labelName" select="Form/LabelList/Label[LabelID = /Root/Form/Album/LabelID]/LabelName" />
              	<b>Label:</b>&#160;<xsl:value-of select="$labelName" />
              	<xsl:if test="Form/Album/LabelID != 0 and /Root/Access/app/reports/m">
              		&#160;<a href="/app/reports?c=m&amp;label={Form/Album/LabelID}" title="Sales Analytics for &quot;{$labelName}&quot;" class="iconLink"><img src="/production/images/icons/office/Pie-Chart2-(14x14).png" /></a>
              	</xsl:if>
              </td>
            </tr>
            
            <tr class="row1">
              <td><b>Genre:</b>&#160;<xsl:value-of select="Form/Album/GenrePrimaryName" /></td>
              <td><b>Album Status:</b>&#160;<xsl:call-template name="albumStatus"><xsl:with-param name="status" select="Form/Album/Status" /></xsl:call-template></td>
            </tr>
            <tr>
              <td><b>Advisory:</b>&#160;<xsl:call-template name="albumParentalAdvisory"><xsl:with-param name="advisory" select="Form/Album/AlbumParentalAdvisory" /></xsl:call-template></td>                        
              <td>
              	<xsl:choose>
              		<xsl:when test="$isDistClient = 1">
              			<xsl:call-template name="albumDataCell" />
              		</xsl:when>
              		<xsl:otherwise>
              			<xsl:call-template name="custom1Cell" />
              		</xsl:otherwise>
              	</xsl:choose>
              </td>
            </tr>
            <tr class="row1">
              <td><b>(C) Line:</b>&#160;<xsl:value-of select="Form/Album/CLine" /></td>
              <td>
              	<xsl:choose>
              		<xsl:when test="$isDistClient = 1">
              			<xsl:call-template name="distReadyCell" />
              		</xsl:when>
              		<xsl:otherwise>
              			<xsl:call-template name="custom2Cell" />
              		</xsl:otherwise>
              	</xsl:choose>                                        
              </td>
            </tr>
            <tr>
              <td><b>(P) Line:</b>&#160;<xsl:value-of select="Form/Album/PLine" /></td>
              <td>
              	<xsl:choose>
              		<xsl:when test="$isDistClient = 1">
              			<xsl:call-template name="custom1Cell" />
              		</xsl:when>
              		<xsl:otherwise>
              			<xsl:call-template name="custom3Cell" />
              		</xsl:otherwise>
              	</xsl:choose>     
              </td>
            </tr>
            
            <tr class="row1">
              <td>
              	<b>Product Type:</b><xsl:text> </xsl:text>
              	<xsl:variable name="daCount" select="count(Form/ProductList/Product[ProductTypeID = 3])" />
              	<xsl:if test="$daCount &gt; 0">
              		DA<xsl:if test="$daCount &gt; 1">(<xsl:value-of select="$daCount" />)</xsl:if>
              	</xsl:if>              	
              	<xsl:for-each select="Form/ProductList/Product[ProductTypeID != 3]">
              		<xsl:variable name="productTypeID" select="ProductTypeID" />
              		<xsl:if test="position() != 1 or $daCount &gt; 0">,</xsl:if>
              		<xsl:value-of select="/Root/Form/TypeList/Type[ProductTypeID = $productTypeID]/Description" />
              	</xsl:for-each>
              </td>
              <td>  
              	<xsl:if test="$isDistClient = 1">
              		<xsl:call-template name="custom2Cell" />
              	</xsl:if>                             
              </td>              
            </tr>
              
            <tr class="row0">
              <td>
              	<xsl:if test="normalize-space(Form/Album/ClientAlbumID)">
              		<b>Client Album ID:</b>&#160;<xsl:value-of select="Form/Album/ClientAlbumID" />
              	</xsl:if>
              </td>
              <td>  
              	<xsl:if test="$isDistClient = 1">
              		<xsl:call-template name="custom3Cell" />   
              	</xsl:if>                        
              </td>              
            </tr>						      
           
          	<tr>
            	<td colspan="2" class="right">
            		<xsl:call-template name="lastModifiedCell" />
            		
            		<xsl:if test="Access/rps/catalog/edit"> 
              		<input type="button" value="Edit Album" onClick="javascript:location.href='catalog?AlbumID={Form/Album/AlbumID}&amp;c=edit'" class="bottomButton" />
              	</xsl:if>
              	
            	</td>
          	</tr>

          </tbody>
        </table>
    </fieldset>
  </xsl:template>


	<xsl:template name="lastModifiedCell">
		<b>Last Modified:</b>&#160;<xsl:value-of select="Form/Album/ModifiedDate" /><xsl:if test="normalize-space(Form/Album/ModifiedBy)"> by <xsl:value-of select="Form/Album/ModifiedBy" /></xsl:if>	
	</xsl:template>


	<xsl:template name="albumDataCell">
  	<b>Album Data:</b>&#160;<xsl:call-template name="albumDistributionReady"><xsl:with-param name="status" select="Form/Album/IsDistributionReady" /></xsl:call-template>
  	<xsl:if test="(not(normalize-space(Form/Album/IsDistributionReady)) or Form/Album/IsDistributionReady != 1) and /Root/Access/rps/catalog/error_report">
  	 (<a href="javascript:displayErrorReport();">Show Errors</a>)
  	</xsl:if>
  	<xsl:call-template name="helpIcon">
  		<xsl:with-param name="tip">Album information (UPC, Title, C-Line, P-Line, etc.), audio files and cover art<xsl:value-of select="$tipBreak" />must all be present and complete before an album can be delivered.<xsl:value-of select="$tipBreak" /><xsl:value-of select="$tipBreak" />The system makes this determination automatically.</xsl:with-param>
  	</xsl:call-template>
	</xsl:template>
		
		
	<xsl:template name="salesCell">
    <b>Sales:</b>&#160;<xsl:choose><xsl:when test="Form/ProductDigital/ProductID and /Root/Access/app/reports/a"><a href="/app/reports?c=a&amp;product={Form/ProductDigital/ProductID}">Digital sales statistics</a></xsl:when><xsl:otherwise>No digital sales</xsl:otherwise></xsl:choose>
	</xsl:template>
	
	
	<xsl:template name="distReadyCell">
		<b>Cleared for Distribution:</b>&#160;<xsl:choose><xsl:when test="Form/ProductDigital/DistAllow = 1">Yes</xsl:when><xsl:when test="Form/ProductDigital/DistAllow = 0">No</xsl:when><xsl:otherwise>N/A</xsl:otherwise></xsl:choose>
		&#160;<xsl:call-template name="helpIcon">
  		<xsl:with-param name="tip">Setting this to "No" will prevent this album from being distributed to any services.<xsl:value-of select="$tipBreak" />Set this field by clicking on "Edit Album."</xsl:with-param>
  	</xsl:call-template>		
	</xsl:template>
	
	
	<xsl:template name="custom1Cell">
		<xsl:choose>
			<xsl:when test="normalize-space(Form/Album/Custom1)">
    		<b>Custom 1:</b>&#160;<xsl:value-of select="Form/Album/Custom1" />
    	</xsl:when>
			<xsl:when test="normalize-space(Form/Album/Custom2)">
    		<b>Custom 2:</b>&#160;<xsl:value-of select="Form/Album/Custom2" />
    	</xsl:when>  
			<xsl:when test="normalize-space(Form/Album/Custom3)">
    		<b>Custom 3:</b>&#160;<xsl:value-of select="Form/Album/Custom3" />
    	</xsl:when>    	  	
    </xsl:choose>
	</xsl:template>	
	
	
	<xsl:template name="custom2Cell">
		<xsl:choose>
			<xsl:when test="normalize-space(Form/Album/Custom1) and normalize-space(Form/Album/Custom2)">
    		<b>Custom 2:</b>&#160;<xsl:value-of select="Form/Album/Custom2" />
    	</xsl:when>  
			<xsl:when test="normalize-space(Form/Album/Custom1) and normalize-space(Form/Album/Custom3)">
    		<b>Custom 3:</b>&#160;<xsl:value-of select="Form/Album/Custom3" />
    	</xsl:when>      	
			<xsl:when test="normalize-space(Form/Album/Custom2) and normalize-space(Form/Album/Custom3)">
    		<b>Custom 3:</b>&#160;<xsl:value-of select="Form/Album/Custom3" />
    	</xsl:when>    	  	
    </xsl:choose>
	</xsl:template>		
				
				
	<xsl:template name="custom3Cell">
		<xsl:if test="normalize-space(Form/Album/Custom1) and normalize-space(Form/Album/Custom2) and normalize-space(Form/Album/Custom3)">
    	<b>Custom 3:</b>&#160;<xsl:value-of select="Form/Album/Custom3" />
    </xsl:if>
	</xsl:template>		
					

  <xsl:template name="trackList">
    <fieldset id="trackListTable">
      <legend>Tracks</legend>
      <table class="textChart">
        <tbody>
					<xsl:if test="Form/Album/TrackList/Track">
						<xsl:call-template name="addTrackButton">
							<xsl:with-param name="position" select="'top'" />
						</xsl:call-template>
	          <tr>
  	          <th id="trackCol">Track</th>
    	        <th id="nameCol">Name</th>
      	      <th id="lengthCol">Length</th>
        	    <th id="artistCol">Artist</th>
        	    <th>Parental Advisory</th>
        	    <th>Media Type</th>
                <xsl:if test="Access/rps/track/edit">
              	<th id="trackEdit">Actions</th>
              </xsl:if>
	          </tr>
  	        <xsl:for-each select="Form/Album/TrackList/Track">
    	        <xsl:call-template name="trackListRow" />
      	    </xsl:for-each>
					</xsl:if>
					<xsl:call-template name="addTrackButton">
						<xsl:with-param name="position" select="'bottom'" />
					</xsl:call-template>
        </tbody>
      </table>
    </fieldset>
  </xsl:template>


  <xsl:template name="addTrackButton">
  	<xsl:param name="position" />
	  <xsl:if test="Access/rps/track/edit">
	    <tr>
	      <td colspan="7" class="right">
	        <input type="button" value="Add Track" onClick="javascript:location.href='track?AlbumID={Form/Album/AlbumID}&amp;c=edit'" class="{$position}Button" />
	      </td>
	    </tr>
	  </xsl:if>
  </xsl:template>


  <xsl:template name="trackListRow">
    <tr class="row{position() mod 2}">
      <td class="rowLeft">
        <a href="javascript:void(0);" onClick="showDetails(this,'trackDetails{TrackID}');" title="Expand" onMouseOver="javascript:window.status=''; return true;"><img src="/production/images/icons/expand.gif" class="showDetails" /></a>
        <xsl:if test="TrackOrder &lt; 10">0</xsl:if><xsl:value-of select="TrackOrder" />
      </td>
      <td><a href="track?c=show&amp;TrackID={TrackID}"><xsl:value-of select="Title" /></a></td>
      <td><xsl:value-of select="Master/Duration" /></td>
      <td><xsl:value-of select="ArtistName" /></td>
      <td>
      	<xsl:call-template name="albumParentalAdvisory">
      		<xsl:with-param name="advisory" select="ParentalAdvisory" />
      	</xsl:call-template>
      </td>
      <td>
      	<xsl:choose>
      		<xsl:when test="MediaType = 2">Video</xsl:when>
      		<xsl:otherwise>Audio</xsl:otherwise>
      	</xsl:choose>
      </td>
      <xsl:if test="/Root/Access/rps/track/edit">
        <td class="icon">
          <a href="/rps/track?c=edit&amp;TrackID={TrackID}">Edit</a>
        </td>
      </xsl:if>
    </tr>
    <tr class="trackInfo row{position() mod 2}" id="trackDetails{TrackID}" style="display:none">
      <td colspan="3" class="rowLeft subTable">
        <table class="textTable masterTable">
          <tr>
            <th colspan="2" class="rowLeft">Master</th>
          </tr>
          <tr>
            <td class="leftCol">Title:</td>
            <td><xsl:value-of select="Master/Title" /></td>
          </tr>
          <tr>
            <td class="leftCol">Artist:</td>
            <td><xsl:value-of select="Master/ArtistName" /></td>
          </tr>
          <tr>
            <td class="leftCol">ISRC:</td>
            <td><xsl:value-of select="Master/ISRC" /></td>
          </tr>
          <tr>
            <td class="leftCol">Recording Date:</td>
            <td><xsl:value-of select="Master/DateRecorded" /></td>
          </tr>
        </table>
      </td>
      <td colspan="3" class="songTable">
        <xsl:if test="/Root/Access/rps/track/edit">
          <xsl:attribute name="colspan">4</xsl:attribute>
        </xsl:if>
        <table class="textTable">
          <tr>
            <th colspan="2" class="rowLeft">Song</th>
          </tr>
          <tr>
            <td class="leftCol">Title:</td>
            <td><xsl:value-of select="Master/Song/Title" /></td>
          </tr>
          <tr>
            <td class="leftCol">Composer:</td>
            <td><xsl:value-of select="Master/Song/ComposerName" /></td>
          </tr>
          <tr>
            <td class="leftCol">ISWC:</td>
            <td><xsl:value-of select="Master/Song/ISWC" /></td>
          </tr>
        </table>
      </td>
    </tr>
  </xsl:template>


  <xsl:template name="productView">
    <fieldset id="productViewTable">
      <legend>Products</legend>
      <table class="textChart">
        <tbody>
          <xsl:if test="Form/ProductList/Product">
            <tr>
         	  <th id="productType" class="rowLeft">Type</th>
            	<th id="productID">Product ID</th>
          	  <th id="productUPC">UPC</th>
        	    <th id="productDate">Release Date</th>
      	      <!-- <th id="productPrice">Retail Price</th> -->
    	        <th id="productStatus" class="status">Status</th>
  	          <th class="editCol">Actions</th>
	          </tr>
	          <xsl:for-each select="Form/ProductList/Product">
  	          <xsl:call-template name="productRow" />
    	      </xsl:for-each>
          </xsl:if>
          <tr>
            <td colspan="7" class="right">
              <input type="button" id="addProductButton" value="Add Product" onClick="location.href='product?c=edit&amp;AlbumID={Form/Album/AlbumID}'" class="bottomButton">
                <xsl:if test="not(Form/Album/TrackList/Track/TrackID) or count(Form/TypeList/Type) = count(Form/ProductList/Product)">
                  <xsl:attribute name="disabled">disabled</xsl:attribute>
                </xsl:if>
              </input>
            </td>
					</tr>
        </tbody>
      </table>
    </fieldset>
  </xsl:template>


  <xsl:template name="productRow">
    <tr class="row{position() mod 2}">
      <xsl:variable name="productTypeID" select="ProductTypeID" />
      <td class="rowLeft">
        <a href="/rps/product?c=show&amp;ProductID={ProductID}">
          <xsl:value-of select="/Root/Form/TypeList/Type[ProductTypeID = $productTypeID]/Description" />
        </a>
      </td>
      <td><xsl:value-of select="ProductCode" /></td>
      <td><xsl:value-of select="UPC" /></td>
      <td><xsl:value-of select="ReleaseDate" /></td>
      <xsl:variable name="productPriceID" select="ProductPriceID" />
      <!-- <td><xsl:value-of select="/Root/Form/PriceList/Price[ProductPriceID = $productPriceID]/Description" /></td> -->
      <xsl:variable name="productStatusID" select="ProductStatusID" />
      <td class="status"><xsl:value-of select="/Root/Form/StatusList/Status[ProductStatusID = $productStatusID]/Description" /></td>
      <td class="icon">
        <a href="/rps/product?c=edit&amp;ProductID={ProductID}">Edit</a>
      </td>
    </tr>
  </xsl:template>


</xsl:stylesheet>
