<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--                                                                  -->
<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">
		<link href="/production/css/rps/mapface.css?v=2" media="screen" rel="stylesheet" type="text/css" />
		<div class="section" id="mapface">
			<xsl:if test="Form/MapFaceFile/RemainingErrors/@raw = 0">
	            <xsl:call-template name="successMessageGeneral">
	                <xsl:with-param name="successMessage">All mapping exceptions resolved for this file!</xsl:with-param>
	            </xsl:call-template>	
	        </xsl:if>	
			<xsl:if test="Form/MapFaceFile/Status = 3">
	            <p class="successGeneral messageBox" id="successGeneralMessageBox">
	                All mappings have been approved for this file!
	            </p>
	        </xsl:if>		        
	        <xsl:call-template name="groupCount" />
			<xsl:call-template name="fileInfo" />
			<xsl:call-template name="navLinks" />
			<xsl:call-template name="lineInfo" />
			<xsl:call-template name="mappingForm" />
		</div>
		<script type="text/javascript" src="/production/javascript/rps/mapface.js?v=10" />
		<xsl:call-template name="pagePrepJavascript" />
	</xsl:template>


	<xsl:variable name="saleID" select="/Root/Form/SaleGroup/Sale/SaleID" />
	
	<xsl:variable name="status" select="/Root/Form/MapFaceTempMapping/Status" />
	
	<xsl:variable name="mapService">
		<xsl:if test="/Root/Form/MapFaceTempMapping/ServiceID != 0">
	 		<xsl:value-of select="/Root/Form/MapFaceTempMapping/ServiceID" />
	 	</xsl:if>
	</xsl:variable>

	<xsl:variable name="saleService">
		<xsl:choose>
			<xsl:when test="/Root/Form/SaleImportErrorList/SaleImportError[SaleID = $saleID and ErrorType = 1 and Mapped = 'N']"></xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="/Root/Form/SaleGroup/Sale[SaleID = $saleID]/ServiceID" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>	
	
	<xsl:variable name="disableService">
	    <xsl:choose>
	        <xsl:when test="normalize-space($saleService) or (normalize-space($mapService) and $status != 2)">1</xsl:when>
	        <xsl:otherwise>0</xsl:otherwise>
	    </xsl:choose>
	</xsl:variable>
	
	<xsl:variable name="mapCountry" select="/Root/Form/MapFaceTempMapping/CountryCode" />	
	
	<xsl:variable name="saleCountry">
		<xsl:choose>
			<xsl:when test="/Root/Form/SaleImportErrorList/SaleImportError[SaleID = $saleID and ErrorType = 2 and Mapped = 'N']"></xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="/Root/Form/SaleGroup/Sale[SaleID = $saleID]/CountryCode" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>	
	
	<xsl:variable name="disableCountry">
	    <xsl:choose>
	        <xsl:when test="normalize-space($saleCountry) or (normalize-space($mapCountry) and $status != 2)">1</xsl:when>
	        <xsl:otherwise>0</xsl:otherwise>
	    </xsl:choose>
	</xsl:variable>	
	
	<xsl:variable name="mapProductType" select="/Root/Form/MapFaceTempMapping/ProductType" />	
	
	<xsl:variable name="saleProductType">
		<xsl:choose>
			<xsl:when test="/Root/Form/SaleImportErrorList/SaleImportError[SaleID = $saleID and ErrorType = 3 and Mapped = 'N']"></xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="/Root/Form/SaleGroup/Sale[SaleID = $saleID]/ProductType" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>	
	
	<xsl:variable name="disableProductType">
	    <xsl:choose>
	        <xsl:when test="normalize-space($saleProductType) or (normalize-space($mapProductType) and $status != 2)">1</xsl:when>
	        <xsl:otherwise>0</xsl:otherwise>
	    </xsl:choose>
	</xsl:variable>	
	
	<xsl:variable name="isPhysicalProduct">
		<xsl:choose>
	        <xsl:when test="normalize-space($saleProductType) and $saleProductType != 'A' and $saleProductType != 'T'">1</xsl:when>
	        <xsl:when test="normalize-space($mapProductType) and $mapProductType != 'A' and $mapProductType != 'T'">1</xsl:when>		
	        <xsl:otherwise>0</xsl:otherwise>
		</xsl:choose>	
	</xsl:variable>	

	<xsl:variable name="mapFormatType" select="/Root/Form/MapFaceTempMapping/FormatType" />

	<xsl:variable name="saleFormatType">
		<xsl:choose>
			<xsl:when test="/Root/Form/SaleImportErrorList/SaleImportError[SaleID = $saleID and ErrorType = 4 and Mapped = 'N']"></xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="/Root/Form/SaleGroup/Sale[SaleID = $saleID]/FormatType" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>	

	<xsl:variable name="disableFormatType">
	    <xsl:choose>
	        <xsl:when test="normalize-space($saleFormatType) or (normalize-space($mapFormatType) and $status != 2)">1</xsl:when>
	        <xsl:when test="$isPhysicalProduct = 1">1</xsl:when>
	        <xsl:otherwise>0</xsl:otherwise>
	    </xsl:choose>
	</xsl:variable>	
	
	<xsl:variable name="mapMediaType">
		<xsl:if test="/Root/Form/MapFaceTempMapping/MediaType != 0">
	 		<xsl:value-of select="/Root/Form/MapFaceTempMapping/MediaType" />
	 	</xsl:if>	
	</xsl:variable>	

	<xsl:variable name="saleMediaType">
		<xsl:choose>
			<xsl:when test="/Root/Form/SaleImportErrorList/SaleImportError[SaleID = $saleID and ErrorType = 5 and Mapped = 'N']"></xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="/Root/Form/SaleGroup/Sale[SaleID = $saleID]/MediaType" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>	

	<xsl:variable name="disableMediaType">
	    <xsl:choose>
	        <xsl:when test="normalize-space($saleMediaType) or (normalize-space($mapMediaType) and $status != 2)">1</xsl:when>
	        <xsl:when test="$isPhysicalProduct = 1">1</xsl:when>
	        <xsl:otherwise>0</xsl:otherwise>
	    </xsl:choose>
	</xsl:variable>
	
	<xsl:variable name="allMapped">
	    <xsl:choose>
	        <xsl:when test="$disableService = 1 and $disableCountry = 1 and $disableProductType = 1 and $disableFormatType = 1 and $disableMediaType = 1">1</xsl:when>
	        <xsl:otherwise>0</xsl:otherwise>
	    </xsl:choose>
	</xsl:variable>
	
	<xsl:template name="groupCount">
	    <p>
	        <strong><xsl:value-of select="Form/CurrentPage" /></strong> of <strong><xsl:value-of select="Form/TotalGroupCount" /></strong>
	    </p>
	</xsl:template>

	<xsl:template name="fileInfo">
    	<fieldset id="fileInfoFieldset">
      		<legend>File</legend>
	  		<table class="textChart" id="fileInfo">
	    		<tr>
	    			<th>Customer</th>
	    			<th>Service</th>
	    			<th>File Name</th>
	    			<th>Received</th>
	    			<th># of Errors</th>
	    			<th>Errors Mapped</th>
	    			<th>Errors Approved</th>
	    			<th>Resolving User</th>	
	    		</tr>
        		<tr class="row1">    		
        			<td><xsl:value-of select="Form/MapFaceFile/ClientName" /></td>
        			<td><xsl:value-of select="Form/File/ServiceName" /></td>       
        			<td>
        				<xsl:value-of select="Form/File/OrigFileName" />
        			</td>
        			<td><xsl:value-of select="Form/File/DateCreatedPretty" /></td>  
        			<td><xsl:value-of select="Form/MapFaceFile/InitialErrors" /></td>
        			<td><xsl:value-of select="Form/MapFaceFile/InitialErrors - Form/MapFaceFile/RemainingErrors" /></td>  
        			<td><xsl:value-of select="Form/MapFaceFile/ApprovedMappings" /></td>
        			<td>
        				<xsl:choose>
        					<xsl:when test="normalize-space(Form/MapFaceFile/ResolvingUserName)">
        						<xsl:value-of select="Form/MapFaceFile/ResolvingUserName" />
        					</xsl:when>
        					<xsl:otherwise>None</xsl:otherwise>
        				</xsl:choose>        			
        			</td>        			        			 		
        		</tr>
    		</table>	
        </fieldset>
        <br class="superBreak" />
	</xsl:template>


  	<xsl:template name="navLinks">
    	<div class="navPrev matcherNavPrev">
      		<xsl:if test="normalize-space(Form/PrevGroupNum)">
        		<a href="?file={Params/file}&amp;mappingGroup={Form/PrevGroupNum}&amp;c=map">&#171; Previous</a>
      		</xsl:if>
    	</div>
    	<div class="navNext matcherNavNext">
      		<xsl:if test="normalize-space(Form/NextGroupNum)">
        		<a href="?file={Params/file}&amp;mappingGroup={Form/NextGroupNum}&amp;c=map">Next &#187;</a>
      		</xsl:if>
    	</div>
  	</xsl:template>


	<xsl:template name="lineInfo">
    	<fieldset id="lineInfoFieldset">
    	    <input type="hidden" name="saleCount" id="saleCount" value="{Form/SaleCount}" />
      		<legend>Line</legend>
	  		<table class="textChart" id="lineInfo">
	    		<tr>
	    			<th>Line</th>
	    			<th>Artist</th>
	    			<th>Album</th>
	    			<th>Track</th>
	    			<th>ISRC</th>
	    			<th>UPC</th>
	    			<th>Units</th>	
	    			
	    			<xsl:if test="Form/File/Physical = 1">
	    				<th>Revenue</th>
	    			</xsl:if>
	    			
	    			<th>Price</th>
	    		</tr>
	    		<xsl:for-each select="Form/SaleGroup/Sale">
                    <xsl:call-template name="saleRow" />
        		</xsl:for-each>
    		</table>
    		<xsl:if test="Form/SaleCount > 5">
    		    <div id="showMoreLines" class="showMore">   		    
    		        <a href="javascript:showMoreLines(5,{Form/MapFaceTempMapping/MapFaceTempMappingID})">More...</a>    		    
    		    </div>	
    		</xsl:if>
        </fieldset>
        <br class="superBreak" />
	</xsl:template>
	

	<xsl:template name="mappingForm">	
		 
    	<fieldset id="mappingFormFieldset">
      		<legend>Mapping</legend>
      		<form name="createMapping" id="createMapping" method="post" action="mapface">
      			<input type="hidden" name="formSubmit" value="1" />
      			<input type="hidden" name="c" value="map" />
      			<input type="hidden" name="file" value="{Params/file}" />
      			<input type="hidden" name="mappingGroup" value="{Form/CurrentGroupNum}" />  

				<xsl:variable name="serviceStatus">
					<xsl:choose>
	    				<xsl:when test="normalize-space($mapService) and $status = 3">approved</xsl:when>
	    				<xsl:when test="normalize-space($mapService) and $status = 1">mapped</xsl:when>		
	    				<xsl:when test="not(normalize-space($saleService))">hi</xsl:when>
	    			</xsl:choose>	
			    </xsl:variable>	

				<xsl:variable name="productTypeStatus">
					<xsl:choose>
	    				<xsl:when test="normalize-space($mapProductType) and $status = 3">approved</xsl:when>
	    				<xsl:when test="normalize-space($mapProductType) and $status = 1">mapped</xsl:when>		
	    				<xsl:when test="not(normalize-space($saleProductType))">hi</xsl:when>
	    			</xsl:choose>	
			    </xsl:variable>	   

				<xsl:variable name="formatTypeStatus">
					<xsl:choose>
						<xsl:when test="(normalize-space($mapFormatType) or (normalize-space($mapProductType) and $isPhysicalProduct = 1)) and $status = 3">approved</xsl:when>
			    		<xsl:when test="(normalize-space($mapFormatType) or (normalize-space($mapProductType) and $isPhysicalProduct = 1)) and $status = 1">mapped</xsl:when>		
	    				<xsl:when test="not(normalize-space($saleFormatType))">hi</xsl:when>
	    			</xsl:choose>	
	    		</xsl:variable>

				<xsl:variable name="mediaTypeStatus">
					<xsl:choose>
						<xsl:when test="(normalize-space($mapMediaType) or (normalize-space($mapProductType) and $isPhysicalProduct = 1)) and $status = 3">approved</xsl:when>
			    		<xsl:when test="(normalize-space($mapMediaType) or (normalize-space($mapProductType) and $isPhysicalProduct = 1)) and $status = 1">mapped</xsl:when>	
	    				<xsl:when test="not(normalize-space($saleMediaType))">hi</xsl:when>
	    			</xsl:choose>	
	    		</xsl:variable>    		   		
      			  			
				<xsl:variable name="countryStatus">
					<xsl:choose>
	    				<xsl:when test="normalize-space($mapCountry) and $status = 3">approved</xsl:when>
	    				<xsl:when test="normalize-space($mapCountry) and $status = 1">mapped</xsl:when>		
	    				<xsl:when test="not(normalize-space($saleCountry))">hi</xsl:when>
	    			</xsl:choose>	
			    </xsl:variable>				          			  			

				<xsl:variable name="serviceClass">		
					<xsl:choose>
						<xsl:when test="Form/Mappings/serviceID/serviceID and normalize-space($serviceStatus)">
							<xsl:value-of select="$serviceStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/countryCode/serviceID and normalize-space($countryStatus)">
							<xsl:value-of select="$countryStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/productType/serviceID and normalize-space($productTypeStatus)">
							<xsl:value-of select="$productTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/formatType/serviceID and normalize-space($formatTypeStatus)">
							<xsl:value-of select="$formatTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/mediaType/serviceID and normalize-space($mediaTypeStatus)">
							<xsl:value-of select="$mediaTypeStatus" />
						</xsl:when>															
					</xsl:choose>	
	    		</xsl:variable>	 

				<xsl:variable name="countryClass">
					<xsl:choose>
						<xsl:when test="Form/Mappings/serviceID/countryCode and normalize-space($serviceStatus)">
							<xsl:value-of select="$serviceStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/countryCode/countryCode and normalize-space($countryStatus)">
							<xsl:value-of select="$countryStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/productType/countryCode and normalize-space($productTypeStatus)">
							<xsl:value-of select="$productTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/formatType/countryCode and normalize-space($formatTypeStatus)">
							<xsl:value-of select="$formatTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/mediaType/countryCode and normalize-space($mediaTypeStatus)">
							<xsl:value-of select="$mediaTypeStatus" />
						</xsl:when>															
					</xsl:choose>			
	    		</xsl:variable>	 
	    		
				<xsl:variable name="productTypeClass">
					<xsl:choose>
						<xsl:when test="Form/Mappings/serviceID/productType and normalize-space($serviceStatus)">
							<xsl:value-of select="$serviceStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/countryCode/productType and normalize-space($countryStatus)">
							<xsl:value-of select="$countryStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/productType/productType and normalize-space($productTypeStatus)">
							<xsl:value-of select="$productTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/formatType/productType and normalize-space($formatTypeStatus)">
							<xsl:value-of select="$formatTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/mediaType/productType and normalize-space($mediaTypeStatus)">
							<xsl:value-of select="$mediaTypeStatus" />
						</xsl:when>															
					</xsl:choose>		
	    		</xsl:variable>	

				<xsl:variable name="formatTypeClass">
					<xsl:choose>
						<xsl:when test="Form/Mappings/serviceID/formatType and normalize-space($serviceStatus)">
							<xsl:value-of select="$serviceStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/countryCode/formatType and normalize-space($countryStatus)">
							<xsl:value-of select="$countryStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/productType/formatType and normalize-space($productTypeStatus)">
							<xsl:value-of select="$productTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/formatType/formatType and normalize-space($formatTypeStatus)">
							<xsl:value-of select="$formatTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/mediaType/formatType and normalize-space($mediaTypeStatus)">
							<xsl:value-of select="$mediaTypeStatus" />
						</xsl:when>															
					</xsl:choose>					
	    		</xsl:variable>	 
	    		
				<xsl:variable name="mediaTypeClass">
					<xsl:choose>
						<xsl:when test="Form/Mappings/serviceID/mediaType and normalize-space($serviceStatus)">
							<xsl:value-of select="$serviceStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/countryCode/mediaType and normalize-space($countryStatus)">
							<xsl:value-of select="$countryStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/productType/mediaType and normalize-space($productTypeStatus)">
							<xsl:value-of select="$productTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/formatType/mediaType and normalize-space($formatTypeStatus)">
							<xsl:value-of select="$formatTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/mediaType/mediaType and normalize-space($mediaTypeStatus)">
							<xsl:value-of select="$mediaTypeStatus" />
						</xsl:when>															
					</xsl:choose>					
	    		</xsl:variable>	
	    		
                <xsl:variable name="salesTypeClass">
                    <xsl:choose>
                        <xsl:when test="Form/Mappings/serviceID/salesType and normalize-space($serviceStatus)">
                            <xsl:value-of select="$serviceStatus" />
                        </xsl:when>
                        <xsl:when test="Form/Mappings/countryCode/salesType and normalize-space($countryStatus)">
                            <xsl:value-of select="$countryStatus" />
                        </xsl:when>
                        <xsl:when test="Form/Mappings/productType/salesType and normalize-space($productTypeStatus)">
                            <xsl:value-of select="$productTypeStatus" />
                        </xsl:when>	
                        <xsl:when test="Form/Mappings/formatType/salesType and normalize-space($formatTypeStatus)">
                            <xsl:value-of select="$formatTypeStatus" />
                        </xsl:when>	
                        <xsl:when test="Form/Mappings/mediaType/salesType and normalize-space($mediaTypeStatus)">
                            <xsl:value-of select="$mediaTypeStatus" />
                        </xsl:when>															
                    </xsl:choose>				
                </xsl:variable>		

                <xsl:variable name="typeClass">
                    <xsl:choose>
                        <xsl:when test="Form/Mappings/serviceID/type and normalize-space($serviceStatus)">
                            <xsl:value-of select="$serviceStatus" />
                        </xsl:when>
                        <xsl:when test="Form/Mappings/countryCode/type and normalize-space($countryStatus)">
                            <xsl:value-of select="$countryStatus" />
                        </xsl:when>
                        <xsl:when test="Form/Mappings/productType/type and normalize-space($productTypeStatus)">
                            <xsl:value-of select="$productTypeStatus" />
                        </xsl:when>	
                        <xsl:when test="Form/Mappings/formatType/type and normalize-space($formatTypeStatus)">
                            <xsl:value-of select="$formatTypeStatus" />
                        </xsl:when>	
                        <xsl:when test="Form/Mappings/mediaType/type and normalize-space($mediaTypeStatus)">
                            <xsl:value-of select="$mediaTypeStatus" />
                        </xsl:when>															
                    </xsl:choose>				
                </xsl:variable>	

				<xsl:variable name="assetTypeClass">
					<xsl:choose>
						<xsl:when test="Form/Mappings/serviceID/assetType and normalize-space($serviceStatus)">
							<xsl:value-of select="$serviceStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/countryCode/assetType and normalize-space($countryStatus)">
							<xsl:value-of select="$countryStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/productType/assetType and normalize-space($productTypeStatus)">
							<xsl:value-of select="$productTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/formatType/assetType and normalize-space($formatTypeStatus)">
							<xsl:value-of select="$formatTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/mediaType/assetType and normalize-space($mediaTypeStatus)">
							<xsl:value-of select="$mediaTypeStatus" />
						</xsl:when>															
					</xsl:choose>				
	    		</xsl:variable>	

				<xsl:variable name="mediaCodeClass">
					<xsl:choose>
						<xsl:when test="Form/Mappings/serviceID/mediaCode and normalize-space($serviceStatus)">
							<xsl:value-of select="$serviceStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/countryCode/mediaCode and normalize-space($countryStatus)">
							<xsl:value-of select="$countryStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/productType/mediaCode and normalize-space($productTypeStatus)">
							<xsl:value-of select="$productTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/formatType/mediaCode and normalize-space($formatTypeStatus)">
							<xsl:value-of select="$formatTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/mediaType/mediaCode and normalize-space($mediaTypeStatus)">
							<xsl:value-of select="$mediaTypeStatus" />
						</xsl:when>															
					</xsl:choose>					
	    		</xsl:variable>	 

				<xsl:variable name="deliveryTypeClass">
					<xsl:choose>
						<xsl:when test="Form/Mappings/serviceID/deliveryType and normalize-space($serviceStatus)">
							<xsl:value-of select="$serviceStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/countryCode/deliveryType and normalize-space($countryStatus)">
							<xsl:value-of select="$countryStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/productType/deliveryType and normalize-space($productTypeStatus)">
							<xsl:value-of select="$productTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/formatType/deliveryType and normalize-space($formatTypeStatus)">
							<xsl:value-of select="$formatTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/mediaType/deliveryType and normalize-space($mediaTypeStatus)">
							<xsl:value-of select="$mediaTypeStatus" />
						</xsl:when>															
					</xsl:choose>				
	    		</xsl:variable>	
	    		
				<xsl:variable name="deliveryFormatClass">
					<xsl:choose>
						<xsl:when test="Form/Mappings/serviceID/deliveryFormat and normalize-space($serviceStatus)">
							<xsl:value-of select="$serviceStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/countryCode/deliveryFormat and normalize-space($countryStatus)">
							<xsl:value-of select="$countryStatus" />
						</xsl:when>
						<xsl:when test="Form/Mappings/productType/deliveryFormat and normalize-space($productTypeStatus)">
							<xsl:value-of select="$productTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/formatType/deliveryFormat and normalize-space($formatTypeStatus)">
							<xsl:value-of select="$formatTypeStatus" />
						</xsl:when>	
						<xsl:when test="Form/Mappings/mediaType/deliveryFormat and normalize-space($mediaTypeStatus)">
							<xsl:value-of select="$mediaTypeStatus" />
						</xsl:when>															
					</xsl:choose>				
	    		</xsl:variable>		
		
		  		<table class="textChart" id="mapping">
		    		<tr>
		    			<xsl:if test="Form/MappingCriteria/serviceID">
			    			<th id="serviceHeader" class="{$serviceClass}">			
			    				<xsl:value-of select="Form/FileHeaders/serviceID" />
			    			</th>
		    			</xsl:if>
		    			
		    			<xsl:if test="Form/MappingCriteria/productType">
		    				<th id="productTypeHeader" class="{$productTypeClass}">			    				
		    					<xsl:value-of select="Form/FileHeaders/productType" />
		    				</th>
		    			</xsl:if>		    			
		    			
		    			<xsl:if test="Form/MappingCriteria/formatType">
		    				<th id="formatTypeHeader" class="{$formatTypeClass}">			    				
		    					<xsl:value-of select="Form/FileHeaders/formatType" />
		    				</th>
		    			</xsl:if>
		    			
		    			<xsl:if test="Form/MappingCriteria/mediaType">
		    				<th id="mediaTypeHeader" class="{$mediaTypeClass}">	    				
		    					<xsl:value-of select="Form/FileHeaders/mediaType" />
		    				</th>
		    			</xsl:if>
		    			
		    			<xsl:if test="Form/MappingCriteria/assetType">
		    				<th id="assetTypeHeader" class="{$assetTypeClass}">	    				
		    					<xsl:value-of select="Form/FileHeaders/assetType" />
		    				</th>
		    			</xsl:if>	
		    			
		    			<xsl:if test="Form/MappingCriteria/salesType">
		    				<th id="salesTypeHeader" class="{$salesTypeClass}">	    				
		    					<xsl:value-of select="Form/FileHeaders/salesType" />
		    				</th>
		    			</xsl:if>		

                        <xsl:if test="Form/MappingCriteria/type">
                            <th id="typeHeader" class="{$typeClass}">	    				
                                <xsl:value-of select="Form/FileHeaders/type" />
                            </th>
                        </xsl:if>			    			
		    			
		    			<xsl:if test="Form/MappingCriteria/mediaCode">
		    				<th id="mediaCodeHeader" class="{$mediaCodeClass}">	    				
		    					<xsl:value-of select="Form/FileHeaders/mediaCode" />
		    				</th>
		    			</xsl:if>
		    			
		    			<xsl:if test="Form/MappingCriteria/deliveryType">
		    				<th id="deliveryTypeHeader" class="{$deliveryTypeClass}">	    				
		    					<xsl:value-of select="Form/FileHeaders/deliveryType" />
		    				</th>
		    			</xsl:if>	
		    			
		    			<xsl:if test="Form/MappingCriteria/deliveryFormat">
		    				<th id="deliveryFormatHeader" class="{$deliveryFormatClass}">	    				
		    					<xsl:value-of select="Form/FileHeaders/deliveryFormat" />
		    				</th>
		    			</xsl:if>		    			 				    			
		    			
		    			<xsl:if test="Form/MappingCriteria/countryCode">
			    			<th id="countryHeader" class="{$countryClass}">
			    				<xsl:value-of select="Form/FileHeaders/countryCode" />
			    			</th>
		    			</xsl:if>
		    		</tr>
	        		<tr class="row1">    		
	        			<xsl:if test="Form/MappingCriteria/serviceID">
		        			<td id="serviceRow" class="{$serviceClass}">	        			
		        				<xsl:value-of select="Form/MappingCriteria/serviceID" />
		        			</td>
		        		</xsl:if>

						<xsl:if test="Form/MappingCriteria/productType">
							<td id="productTypeRow" class="{$productTypeClass}">							
								<xsl:value-of select="Form/MappingCriteria/productType" />
							</td>
						</xsl:if>
						
						<xsl:if test="Form/MappingCriteria/formatType">				
							<td id="formatTypeRow" class="{$formatTypeClass}">								
								<xsl:value-of select="Form/MappingCriteria/formatType" />
							</td>
						</xsl:if>						
							        			
	        			<xsl:if test="Form/MappingCriteria/mediaType">
							<td id="mediaTypeRow" class="{$mediaTypeClass}">							
								<xsl:value-of select="Form/MappingCriteria/mediaType" />
							</td>
						</xsl:if>
						
						<xsl:if test="Form/MappingCriteria/assetType">				
							<td id="assetTypeRow" class="{$assetTypeClass}">								
								<xsl:value-of select="Form/MappingCriteria/assetType" />
							</td>
						</xsl:if>						
							        			
	        			<xsl:if test="Form/MappingCriteria/salesType">
							<td id="salesTypeRow" class="{$salesTypeClass}">							
								<xsl:value-of select="Form/MappingCriteria/salesType" />
							</td>
						</xsl:if>						

                        <xsl:if test="Form/MappingCriteria/type">
                            <td id="typeRow" class="{$typeClass}">							
                                <xsl:value-of select="Form/MappingCriteria/type" />
                            </td>
                        </xsl:if>	

	        			<xsl:if test="Form/MappingCriteria/mediaCode">
							<td id="mediaCodeRow" class="{$mediaCodeClass}">							
								<xsl:value-of select="Form/MappingCriteria/mediaCode" />
							</td>
						</xsl:if>
						
						<xsl:if test="Form/MappingCriteria/deliveryType">				
							<td id="deliveryTypeRow" class="{$deliveryTypeClass}">								
								<xsl:value-of select="Form/MappingCriteria/deliveryType" />
							</td>
						</xsl:if>						
							        			
	        			<xsl:if test="Form/MappingCriteria/deliveryFormat">
							<td id="deliveryFormatRow" class="{$deliveryFormatClass}">							
								<xsl:value-of select="Form/MappingCriteria/deliveryFormat" />
							</td>
						</xsl:if>	
				
						<xsl:if test="Form/MappingCriteria/countryCode">											
							<td id="countryRow" class="{$countryClass}">				
								<xsl:value-of select="Form/MappingCriteria/countryCode" />
							</td>
						</xsl:if>
	        		</tr>
	    		</table>
	    		<br class="superBreak" />
	    		<table class="textChart" id="newValues">
	    			<tr>
	    				<th class="rsValuesHeader"></th>
	    				<th class="newValuesHeader {$serviceStatus}">Service</th>
	    				<th class="newValuesHeader {$productTypeStatus}">Product Type</th>
	    				<th class="newValuesHeader {$formatTypeStatus}">Format Type</th>
	    				<th class="newValuesHeader {$mediaTypeStatus}">Media Type</th>
	    				<th class="{$countryStatus}">Country</th>
	    			</tr>
	    			<tr>
	    				<td><strong>RS Values</strong></td>
	    				<td class="{$serviceStatus}">
	    				    <xsl:variable name="selectedServiceID">
	    				        <xsl:choose>
	    				            <xsl:when test="normalize-space($saleService)">
	    				                <xsl:value-of select="$saleService" />
	    				            </xsl:when>
	    				            <xsl:otherwise>
	    				                <xsl:value-of select="$mapService" />
	    				            </xsl:otherwise>
	    				        </xsl:choose>
	    				    </xsl:variable>	  
	    				    <xsl:variable name="selectedServiceName">
	    				        <xsl:choose>
	    				            <xsl:when test="normalize-space(Form/ServiceList/Service[ServiceID = $selectedServiceID]/ServiceName)">
	    				                <xsl:value-of select="Form/ServiceList/Service[ServiceID = $selectedServiceID]/ServiceName" />
	    				            </xsl:when>
	    				            <xsl:otherwise>
	    				                <xsl:value-of select="Form/MapFaceTempMapping/ServiceName" />
	    				            </xsl:otherwise>
	    				        </xsl:choose>
	    				    </xsl:variable>	 	    				      				
							<div id="myAutoComplete">
								<input id="Form_MapFaceTempMapping_ServiceName" name="Form_MapFaceTempMapping_ServiceName" type="text" class="serviceNameField" value="{$selectedServiceName}" >
			                      <xsl:if test="$disableService = 1">
			                        <xsl:attribute name="disabled">disabled</xsl:attribute>
			                      </xsl:if>
			                    </input>&#160;<span id="noMatchWarning" class="yui-ac-warning"></span>
			                    <xsl:if test="not(normalize-space($saleService))">
									<input type="hidden" name="Form_MapFaceTempMapping_ServiceID" id="Form_MapFaceTempMapping_ServiceID" value="{$selectedServiceID}" />
									<div id="myContainer"></div>
							        <script src="/production/javascript/autocomplete/service.js?v=3" type="text/javascript"></script>
							        <script type="text/javascript">
										var myAutoComp = new YAHOO.widget.RSServiceAutoComplete("myContainer","Form_MapFaceTempMapping_ServiceName", "Form_MapFaceTempMapping_ServiceID",
											{
										  		"noMatchWarningID": "noMatchWarning"
											}
										);
							        </script>
							    </xsl:if>
							</div>											
	    				</td>
	    				<td class="{$productTypeStatus}">
	    				    <xsl:variable name="selectedProductType">
	    				        <xsl:choose>
	    				            <xsl:when test="normalize-space($saleProductType)">
	    				                <xsl:value-of select="$saleProductType" />
	    				            </xsl:when>
	    				            <xsl:otherwise>
	    				                <xsl:value-of select="$mapProductType" />
	    				            </xsl:otherwise>
	    				        </xsl:choose>
	    				    </xsl:variable>
	    					<select name="Form_MapFaceTempMapping_ProductType" id="Form_MapFaceTempMapping_ProductType" onChange="checkProductType()">
	    						<xsl:if test="$disableProductType = 1">
	    							<xsl:attribute name="disabled">disabled</xsl:attribute>
	    						</xsl:if>	    					
	    						<option value="">Select...</option>
	    						<xsl:if test="Form/File/Physical = 0">
        							<option value="A">
        								<xsl:if test="$selectedProductType = 'A'">
        									<xsl:attribute name="selected">selected</xsl:attribute>
        								</xsl:if>	    							
        								Album
        							</option>				
        							<option value="T">
        								<xsl:if test="$selectedProductType = 'T'">
        									<xsl:attribute name="selected">selected</xsl:attribute>
        								</xsl:if>	    							
        								Track
        							</option>
        					    </xsl:if>
    							<xsl:if test="not(normalize-space($saleFormatType)) and not(normalize-space($saleMediaType)) and Form/File/Physical = 1">	    	
	    							<option value="U">
	    								<xsl:if test="$selectedProductType = 'U'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								Blu-ray Disc
	    							</option>	  
	    							<option value="4">
	    								<xsl:if test="$selectedProductType = '4'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								Cassette
	    							</option>	    							
	    							<option value="K">
	    								<xsl:if test="$selectedProductType = 'K'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								Cassette Single
	    							</option>				
	    							<option value="2">
	    								<xsl:if test="$selectedProductType = '2'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								CD
	    							</option>	    	
	    							<option value="B">
	    								<xsl:if test="$selectedProductType = 'B'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								Double CD
	    							</option>	  
	    							<option value="C">
	    								<xsl:if test="$selectedProductType = 'C'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								CD Single
	    							</option>	  
	    							<option value="9">
	    								<xsl:if test="$selectedProductType = '9'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								DVD
	    							</option>				
	    							<option value="D">
	    								<xsl:if test="$selectedProductType = 'D'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								DVD/CD Set
	    							</option>	    
	    							<option value="7">
	    								<xsl:if test="$selectedProductType = '7'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								EP
	    							</option>	     								
	    							<option value="1">
	    								<xsl:if test="$selectedProductType = '1'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								LP
	    							</option>	  
	    							<option value="P">
	    								<xsl:if test="$selectedProductType = 'P'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								LP5
	    							</option>	      							    							
	    							<option value="3">
	    								<xsl:if test="$selectedProductType = '3'">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>	    							
	    								VHS
	    							</option>	  
	    						</xsl:if>   							    								
	    					</select> 					
	    				</td>	 
	    				<td class="{$formatTypeStatus}">
	    					<input type="hidden" name="formatTypeMapped" id="formatTypeMapped" value="0">
		    					<xsl:if test="normalize-space($saleFormatType)">
		    						<xsl:attribute name="value">1</xsl:attribute>
		    					</xsl:if>	
	    					</input>   
	    				    <xsl:variable name="selectedFormatType">
	    				        <xsl:choose>
	    				            <xsl:when test="normalize-space($saleFormatType)">
	    				                <xsl:value-of select="$saleFormatType" />
	    				            </xsl:when>
	    				            <xsl:otherwise>
	    				                <xsl:value-of select="$mapFormatType" />
	    				            </xsl:otherwise>
	    				        </xsl:choose>
	    				    </xsl:variable>	    				
	    					<select name="Form_MapFaceTempMapping_FormatType" id="Form_MapFaceTempMapping_FormatType">
	    						<xsl:if test="$disableFormatType = 1">
	    							<xsl:attribute name="disabled">disabled</xsl:attribute>
	    						</xsl:if>	    					
	    						<option value="">Select...</option>
    							<option value="D">
    								<xsl:if test="$selectedFormatType = 'D'">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	    							
    								Download
    							</option>	  	 
    							<option value="H">
    								<xsl:if test="$selectedFormatType = 'H'">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	    							
    								Premium download
    							</option>	
    							<option value="I">
    								<xsl:if test="$selectedFormatType = 'I'">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	    							
    								Upgrade download
    							</option>	  	 
    							<option value="E">
    								<xsl:if test="$selectedFormatType = 'E'">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	    							
    								Dual download
    							</option>
    							<option value="T">
    								<xsl:if test="$selectedFormatType = 'T'">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	    							
    								Tethered download
    							</option>	
    							<option value="P">
    								<xsl:if test="$selectedFormatType = 'P'">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	    							
    								Variable price download
    							</option>	  	 
    							<option value="R">
    								<xsl:if test="$selectedFormatType = 'R'">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	    							
    								Ringtone
    							</option>	
    							<option value="S">
    								<xsl:if test="$selectedFormatType = 'S'">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	    							
    								Stream
    							</option>	  	 
    							<option value="B">
    								<xsl:if test="$selectedFormatType = 'B'">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	    							
    								Background music
    							</option>
    							<option value="J">
    								<xsl:if test="$selectedFormatType = 'J'">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	    							
    								Jukebox
    							</option>	
                                <option value="O">
                                    <xsl:if test="$selectedFormatType = 'O'">
                                        <xsl:attribute name="selected">selected</xsl:attribute>  
                                    </xsl:if>						
                                    Performance Income
                                </option>	
	    					</select>
	    				</td>	 
	    				<td class="{$mediaTypeStatus}">
	    					<input type="hidden" name="mediaTypeMapped" id="mediaTypeMapped" value="0">
		    					<xsl:if test="normalize-space($saleMediaType)">
		    						<xsl:attribute name="value">1</xsl:attribute>
		    					</xsl:if>	
	    					</input>    				
	    				    <xsl:variable name="selectedMediaType">
	    				        <xsl:choose>
	    				            <xsl:when test="normalize-space($saleMediaType)">
	    				                <xsl:value-of select="$saleMediaType" />
	    				            </xsl:when>
	    				            <xsl:otherwise>
	    				                <xsl:value-of select="$mapMediaType" />
	    				            </xsl:otherwise>
	    				        </xsl:choose>
	    				    </xsl:variable>	    				
	    					<select name="Form_MapFaceTempMapping_MediaType" id="Form_MapFaceTempMapping_MediaType">
	    						<xsl:if test="$disableMediaType = 1">
	    							<xsl:attribute name="disabled">disabled</xsl:attribute>
	    						</xsl:if>	    					
	    						<option value="">Select...</option>
	    						<option value="1">
    								<xsl:if test="$selectedMediaType = 1">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	 	    						
	    							Audio
	    						</option>
	    						<option value="2">
    								<xsl:if test="$selectedMediaType = 2">
    									<xsl:attribute name="selected">selected</xsl:attribute>
    								</xsl:if>	 	 	    						
	    							Video
	    						</option>
	    					</select>
	    				</td>	 
	    				<td class="{$countryStatus}">
	    				    <xsl:variable name="selectedCountry">
	    				        <xsl:choose>
	    				            <xsl:when test="normalize-space($saleCountry)">
	    				                <xsl:value-of select="$saleCountry" />
	    				            </xsl:when>
	    				            <xsl:otherwise>
	    				                <xsl:value-of select="$mapCountry" />
	    				            </xsl:otherwise>
	    				        </xsl:choose>
	    				    </xsl:variable>	    				
	    					<select name="Form_MapFaceTempMapping_CountryCode" id="Form_MapFaceTempMapping_CountryCode">
	    						<xsl:if test="$disableCountry = 1">
	    							<xsl:attribute name="disabled">disabled</xsl:attribute>
	    						</xsl:if>
	    						<option value="">Select...</option>					
	    						<xsl:for-each select="Form/CountryList/Country">
	    							<xsl:sort select="CountryCode" />
	    							<option value="{CountryCode}">
	    								<xsl:if test="CountryCode = $selectedCountry">
	    									<xsl:attribute name="selected">selected</xsl:attribute>
	    								</xsl:if>
	    								<xsl:value-of select="CountryCode" /> - <xsl:value-of select="Name" />
	    							</option>
	    						</xsl:for-each>
	    					</select>    					
	    				</td>	 	    					    					    				   				
	    			</tr>
	    			<tr>
	    			    <td></td>
	    			    <td>   
                            <xsl:call-template name="inlineError">
                                <xsl:with-param name="path">Form/MapFaceTempMapping/ServiceName</xsl:with-param>
                                <xsl:with-param name="displayName">Service</xsl:with-param>
                            </xsl:call-template>	                          	    			    
	    			    </td>
	    			    <td>
                            <xsl:call-template name="inlineError">
                                <xsl:with-param name="path">Form/MapFaceTempMapping/ProductType</xsl:with-param>
                                <xsl:with-param name="displayName">Product Type</xsl:with-param>
                            </xsl:call-template>		    			    
	    			    </td>
	    			    <td>
                            <xsl:call-template name="inlineError">
                                <xsl:with-param name="path">Form/MapFaceTempMapping/FormatType</xsl:with-param>
                                <xsl:with-param name="displayName">Format Type</xsl:with-param>
                            </xsl:call-template>		    			    
	    			    </td>
	    			    <td>
	    					<xsl:call-template name="inlineError">
                                <xsl:with-param name="path">Form/MapFaceTempMapping/MediaType</xsl:with-param>
                                <xsl:with-param name="displayName">Media Type</xsl:with-param>
                            </xsl:call-template>	    			    
	    			    </td>
	    			    <td>
                            <xsl:call-template name="inlineError">
                                <xsl:with-param name="path">Form/MapFaceTempMapping/CountryCode</xsl:with-param>
                                <xsl:with-param name="displayName">Country</xsl:with-param>
                            </xsl:call-template>	    			    
	    			    </td>
	    			</tr>
	    		</table>
	            <div id="approveSection">
	            	<xsl:if test="$allMapped = 1">
	            		<xsl:choose>
	            			<xsl:when test="$status = 3 or $status = 4">
	            				<xsl:attribute name="id">approvedSection</xsl:attribute>
	            				Approved <img src="/production/images/icons/office/Checkmark-(16x16).gif" />
	            			</xsl:when>
	            			<xsl:when test="Form/MapFaceTempMapping/ResolvingUserID = User/UserID">
	            				Not Approved
	            			</xsl:when>
	            			<xsl:otherwise>
	            				<a href="/rps/mapface?c=approve&amp;mapID={Form/MapFaceTempMapping/MapFaceTempMappingID}">
	            				    <xsl:if test="Form/MapFaceFile/InitialErrors/@raw - Form/MapFaceFile/ApprovedMappings/@raw = 1">
	            				        <xsl:attribute name="href">javascript:confirmFinalApproval(<xsl:value-of select="Form/MapFaceTempMapping/MapFaceTempMappingID" />)</xsl:attribute>
	            				    </xsl:if>
	            				    Approve
	            				</a>
	            			</xsl:otherwise>
	            		</xsl:choose>
	            	</xsl:if>
	            	&#160;
	            </div>
	            <div id="approveBalancer">&#160;</div>
	    		<xsl:call-template name="buttons" />
	    		<xsl:if test="Form/MapFaceTempMapping/MapFaceTempMappingHistoryList/MapFaceTempMappingHistory">	 
    	    		<div id="mappingHistory">
    	    		    <table id="history">
    	    		    <xsl:for-each     select="Form/MapFaceTempMapping/MapFaceTempMappingHistoryList/MapFaceTempMappingHistory">
    	    		    
    	    		        <xsl:variable name="action">
    	    		            <xsl:if test="Action = 'appr'">Approved</xsl:if>
    	    		            <xsl:if test="Action = 'auto'">Auto-Approved</xsl:if>
    	    		            <xsl:if test="Action = 'mapd'">Mapped</xsl:if>
    	    		            <xsl:if test="Action = 'undo'">Undone</xsl:if>
    	    		        </xsl:variable>  
    	    		        <tr>
    	    		            <td>
    	    		                <xsl:value-of select="$action" /> by <xsl:value-of select="UserName" /><xsl:if test="not(UserName)">None</xsl:if> at <xsl:value-of select="Date" />
    	    		            </td>
    	    		        </tr>
    	    		    </xsl:for-each>
    	    		    </table>
    	    		    <div id="showMoreHistory"><a href="javascript:showMoreHistory()">More...</a></div>
    	    		</div>
    	        </xsl:if>
    		</form>	
        </fieldset>
        <br class="superBreak" />
	</xsl:template>
	
	
    <xsl:template name="submitButton">
    	<xsl:choose>
    		<xsl:when test="$status = 4 or /Root/Form/MapFaceFile/Status = 3 or /Root/Form/MapFaceFile/Status = 4">
    			<xsl:attribute name="class"></xsl:attribute>
    		</xsl:when>
    		<xsl:otherwise>
		        <input type="button" value="Undo" id="undoButton" onClick="location.href='/rps/mapface?c=undo&amp;mapID={Form/MapFaceTempMapping/MapFaceTempMappingID}'" />
		        <input name="confirmMapping" type="submit" value="Confirm Mapping" id="submitButton">
		        	<xsl:if test="Form/MapFaceFile/ResolvingUserID != 0 and Form/MapFaceFile/ResolvingUserID != User/UserID">
		        		<xsl:attribute name="onClick">confirmNewResolvingUser(); return false;</xsl:attribute>
		        	</xsl:if>
		        </input>
		    </xsl:otherwise>
        </xsl:choose>
    </xsl:template>


    <xsl:template name="cancelButton">
		<input type="button" name="Back" value="Back to Summary" onClick="location.href='/rps/mapface'" />
    </xsl:template>	
		
		
	<xsl:template name="pagePrepJavascript">
	    <script type="text/javascript">
	        <xsl:choose>
	            <xsl:when test="$allMapped = 1">
	                confirmButton.hide();
	            </xsl:when>
	            <xsl:otherwise>
	                undoButton.hide();
	            </xsl:otherwise>
	        </xsl:choose>        

            requireField("Form_MapFaceTempMapping_ProductType","Product Type must be selected.<br />");

            requireField("Form_MapFaceTempMapping_FormatType","Format Type must be selected.<br />");

            requireField("Form_MapFaceTempMapping_MediaType","Media Type must be selected.<br />");

            requireField("Form_MapFaceTempMapping_CountryCode","Country must be selected.<br />");

            validationSet["Form_MapFaceTempMapping_ServiceName"] = {
              'banned': 'SoundExchange',
              'error': 'Service cannot be mapped to SoundExchange.<br />',
              'errorBlank': 'Service must be entered.<br />'
            };
            
        </script>	    
	    	    
	</xsl:template>	
		
		
</xsl:stylesheet>


