<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<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:template name="payorEditLayout">
		<script type="text/javascript" src="/production/javascript/validatePayor.js?t={$now}" />
		<form name="payorEdit" id="payorEdit" method="post" action="payor" enctype="multipart/form-data">
			<xsl:call-template name="payorEdit" />
			<xsl:call-template name="buttons" />
		</form>
	</xsl:template>

	<xsl:template name="payorEdit">
		<xsl:call-template name="successMessageGeneral">
			<xsl:with-param name="successMessage">Payor successfully created!</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="openRunStatusMessage" />
		<xsl:if test="Params/_inline">
			<input type="hidden" name="_inline" value="1" />
		</xsl:if>
		<input type="hidden" name="formSubmit" value="1" />
		<input type="hidden" name="c" value="edit" />
		<input type="hidden" name="ReturnTo" id="ReturnTo" value="{Params/ReturnTo}" />
		<xsl:if test="normalize-space(Form/Payor/PayorID)">
			<input type="hidden" name="PayorID" value="{Form/Payor/PayorID}" />
		</xsl:if>
		<xsl:call-template name="errorMessageGeneral" />
		<p class="User-edit-subheader">
			Enter payor information here.
			<span class="Required-notice"/>
		</p>
		<section class="PayeeEdit-form-section">
		    <xsl:call-template name="column1Edit" />
		    <xsl:call-template name="column2Edit" />
		</section>
	</xsl:template>

	<xsl:template name="column1Edit">
	    <div class="PayeeEdit-form-part">
			<fieldset class="User-edit-fieldset">
				<div class="Form-item Form-item-required">
					<label class="Form-label">
						<span class="Form-label-caption">Payor</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_Name" id="Form_Payor_Name" value="{Form/Payor/Name}" maxlength="{Form/Payor/Name/@maxLength}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
							<xsl:call-template name="inlineError">
								<xsl:with-param name="path">Form/Payor/Name</xsl:with-param>
								<xsl:with-param name="displayName">Payor</xsl:with-param>
							</xsl:call-template>
						</div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">Client Payor #</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_ClientPayorID" id="Form_Payor_ClientPayorID" value="{Form/Payor/ClientPayorID}" maxlength="{Form/Payor/ClientPayorID/@maxLength}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
							<xsl:call-template name="inlineError">
								<xsl:with-param name="path">Form/Payor/ClientPayorID</xsl:with-param>
								<xsl:with-param name="displayName">Client Payor #</xsl:with-param>
							</xsl:call-template>
						</div>
					</label>
				</div>
                <xsl:if test="Access/rps/artist_payee/edit = 1">
                    <div class="Form-item">
                        <xsl:attribute name="class">
                            <xsl:text>Form-item</xsl:text>
                            <xsl:if test="Form/Payor/ArtistPayeeMinPayment[@e]">
                                <xsl:text> Form-item-error</xsl:text>
                            </xsl:if>
                        </xsl:attribute>
                        <label class="Form-label">
                        <span class="Form-label-caption">Artist payee min payment (<xsl:value-of select="Client/Locale/CurrencyFormat/CurrencyCode" />)</span>
                        <xsl:call-template name="helpIcon">
                            <xsl:with-param name="tip">
                            Minimum payment values entered here will act as the default minimum payment amount and will be applied to new artist payees, as well as existing artist payees that currently have no minimum payment value, or a minimum payment value of zero.&lt;br&gt; &lt;br&gt;

                            Please Note: Adding or updating the default minimum payment on this page will &lt;u&gt;not&lt;/u&gt; overwrite existing minimum payments values greater than zero.
                            </xsl:with-param>
                        </xsl:call-template>
                            <div class="Form-input-wrapper">
                                <input class="Input Form-input"
                                       type="text"
                                       name="Form_Payor_ArtistPayeeMinPayment"
                                       id="Form_Payor_ArtistPayeeMinPayment"
                                       value="{Form/Payor/ArtistPayeeMinPayment}">
                                    <xsl:if test="$openRuns = 1">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                </input>
                            </div>
                        </label>
                        <xsl:call-template name="inlineError">
                            <xsl:with-param name="path">Form/Payor/ArtistPayeeMinPayment</xsl:with-param>
                            <xsl:with-param name="displayName">Minimum Payment</xsl:with-param>
                        </xsl:call-template>
                    </div>
                </xsl:if>
                <xsl:if test="Access/rps/label_payee/edit = 1">
                    <div class="Form-item">
                        <xsl:attribute name="class">
                            <xsl:text>Form-item</xsl:text>
                            <xsl:if test="Form/Payor/LabelPayeeMinPayment[@e]">
                                <xsl:text> Form-item-error</xsl:text>
                            </xsl:if>
                        </xsl:attribute>
                        <label class="Form-label">
                            <span class="Form-label-caption">Label payee min payment (<xsl:value-of select="Client/Locale/CurrencyFormat/CurrencyCode" />)</span>
                            <xsl:call-template name="helpIcon">
                                <xsl:with-param name="tip">
                                Minimum payment values entered here will act as the default minimum payment amount and will be applied to new label payees, as well as existing label payees that currently have no minimum payment value, or a minimum payment value of zero.&lt;br&gt; &lt;br&gt;

                                Please Note: Adding or updating the default minimum payment on this page will &lt;u&gt;not&lt;/u&gt; overwrite existing minimum payments values greater than zero.
                                </xsl:with-param>
                            </xsl:call-template>
                            <div class="Form-input-wrapper">
                                <input class="Input Form-input"
                                       type="text"
                                       name="Form_Payor_LabelPayeeMinPayment"
                                       id="Form_Payor_LabelPayeeMinPayment"
                                       value="{Form/Payor/LabelPayeeMinPayment}">
                                    <xsl:if test="$openRuns = 1">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                </input>
                            </div>
                        </label>
                        <xsl:call-template name="inlineError">
                            <xsl:with-param name="path">Form/Payor/LabelPayeeMinPayment</xsl:with-param>
                            <xsl:with-param name="displayName">Minimum Payment</xsl:with-param>
                        </xsl:call-template>
                    </div>
                </xsl:if>
                <xsl:if test="Access/rps/publisher/edit = 1">
                    <div class="Form-item">
                        <xsl:attribute name="class">
                            <xsl:text>Form-item</xsl:text>
                            <xsl:if test="Form/Payor/USPublisherMinPayment[@e]">
                                <xsl:text> Form-item-error</xsl:text>
                            </xsl:if>
                        </xsl:attribute>
                        <label class="Form-label">
                            <span class="Form-label-caption">US Publisher min payment (<xsl:value-of select="Client/Locale/CurrencyFormat/CurrencyCode" />)</span>
                            <xsl:call-template name="helpIcon">
                                <xsl:with-param name="tip">
                                Minimum payment values entered here will act as the default minimum payment amount and will be applied to new US publisher payees, as well as existing US publisher payees that currently have no minimum payment value, or a minimum payment value of zero.&lt;br&gt; &lt;br&gt;
                                Please Note: Adding or updating the default minimum payment on this page will &lt;u&gt;not&lt;/u&gt; overwrite existing minimum payments values greater than zero.
                                </xsl:with-param>
                            </xsl:call-template>
                            <div class="Form-input-wrapper">
                                <input class="Input Form-input"
                                       type="text"
                                       name="Form_Payor_USPublisherMinPayment"
                                       id="Form_Payor_USPublisherMinPayment"
                                       value="{Form/Payor/USPublisherMinPayment}">
                                    <xsl:if test="$openRuns = 1">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                </input>
                            </div>
                        </label>
                        <xsl:call-template name="inlineError">
                            <xsl:with-param name="path">Form/Payor/USPublisherMinPayment</xsl:with-param>
                            <xsl:with-param name="displayName">Minimum Payment</xsl:with-param>
                        </xsl:call-template>
                    </div>
                </xsl:if>
                <xsl:if test="Access/rps/ca_publisher/edit = 1">
                    <div class="Form-item">
                        <xsl:attribute name="class">
                            <xsl:text>Form-item</xsl:text>
                            <xsl:if test="Form/Payor/CAPublisherMinPayment[@e]">
                                <xsl:text> Form-item-error</xsl:text>
                            </xsl:if>
                        </xsl:attribute>
                        <label class="Form-label">
                            <span class="Form-label-caption">CA Publisher min payment (<xsl:value-of select="Client/Locale/CurrencyFormat/CurrencyCode" />)</span>
                            <xsl:call-template name="helpIcon">
                                <xsl:with-param name="tip">
                                Minimum payment values entered here will act as the default minimum payment amount and will be applied to new CA publisher payees, as well as existing CA publisher payees that currently have no minimum payment value, or a minimum payment value of zero.&lt;br&gt; &lt;br&gt;
                                Please Note: Adding or updating the default minimum payment on this page will &lt;u&gt;not&lt;/u&gt; overwrite existing minimum payments values greater than zero.
                                </xsl:with-param>
                            </xsl:call-template>
                            <div class="Form-input-wrapper">
                                <input class="Input Form-input"
                                       type="text"
                                       name="Form_Payor_CAPublisherMinPayment"
                                       id="Form_Payor_CAPublisherMinPayment"
                                       value="{Form/Payor/CAPublisherMinPayment}">
                                    <xsl:if test="$openRuns = 1">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                </input>
                            </div>
                        </label>
                        <xsl:call-template name="inlineError">
                            <xsl:with-param name="path">Form/Payor/CAPublisherMinPayment</xsl:with-param>
                            <xsl:with-param name="displayName">Minimum Payment</xsl:with-param>
                        </xsl:call-template>
                    </div>
                </xsl:if>
                <div class="Form-item">
                    <label class="Form-label">
                    <span class="Form-label-caption">Status</span>
                        <div class="Form-input-wrapper">
                            <xsl:variable name="selectStatusList">
                                <map>
                                    <mapEntry>
                                        <name>Active</name><value>0</value>
                                    </mapEntry>
                                    <mapEntry>
                                        <name>Inactive</name><value>1</value>
                                    </mapEntry>
                                </map>
                            </xsl:variable>
                            <xsl:call-template name="uiDropdown">
                                <xsl:with-param name="items" select="$selectStatusList"/>
                                <xsl:with-param name="id" select="'Form_Payor_Inactive'"/>
                                <xsl:with-param name="name" select="'Form_Payor_Inactive'"/>
                                <xsl:with-param name="active" select="Form/Payor/Inactive"/>
                                <xsl:with-param name="className" select="'Form_Payor_Inactive'"/>
								<xsl:with-param name="onChange">inactivePayorWarning(this.value)</xsl:with-param>
								<xsl:with-param name="disabled">
									<xsl:if test="$openRuns = 1">true</xsl:if>
								</xsl:with-param>
	                        </xsl:call-template>
	                    </div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">Address 1</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_StreetAddress" id="Form_Payor_StreetAddress" value="{Form/Payor/StreetAddress}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
						</div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">Address 2</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_StreetAddress2" id="Form_Payor_StreetAddress2" value="{Form/Payor/StreetAddress2}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
						</div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">Address 3</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_StreetAddress3" id="Form_Payor_StreetAddress3" value="{Form/Payor/StreetAddress3}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
						</div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">City</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_City" id="Form_Payor_City" value="{Form/Payor/City}" maxlength="{Form/Payor/City/@maxLength}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
							<xsl:call-template name="inlineError">
								<xsl:with-param name="path">Form/Payor/City</xsl:with-param>
								<xsl:with-param name="displayName">City</xsl:with-param>
							</xsl:call-template>
						</div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">State/Province</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_StateProvince" id="Form_Payor_StateProvince" value="{Form/Payor/StateProvince}" maxlength="{Form/Payor/StateProvince/@maxLength}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
							<xsl:call-template name="inlineError">
								<xsl:with-param name="path">Form/Payor/StateProvince</xsl:with-param>
								<xsl:with-param name="displayName"></xsl:with-param>
							</xsl:call-template>
						</div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">ZIP/Postal</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_PostalCode" id="Form_Payor_PostalCode" value="{Form/Payor/PostalCode}" maxlength="{Form/Payor/PostalCode/@maxLength}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
							<xsl:call-template name="inlineError">
								<xsl:with-param name="path">Form/Payor/PostalCode</xsl:with-param>
								<xsl:with-param name="displayName">Zip/Postal</xsl:with-param>
							</xsl:call-template>
						</div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">Country</span>
	                    <div class="Form-input-wrapper">
	                        <xsl:variable name="selectCountriesList">
	                            <map>
								    <mapEntry>
	                                    <name>Choose...</name>
	                                    <value></value>
	                                </mapEntry>
	                                <xsl:for-each select="Form/CountryList/Country">
	                                    <mapEntry>
	                                        <name><xsl:value-of select="Name"/></name>
	                                        <value><xsl:value-of select="CountryCode"/></value>
	                                    </mapEntry>
	                                </xsl:for-each>
	                            </map>
	                        </xsl:variable>
	                        <xsl:call-template name="uiDropdown">
	                            <xsl:with-param name="items" select="$selectCountriesList"/>
	                            <xsl:with-param name="id" select="'Form_Payor_CountryCode'"/>
	                            <xsl:with-param name="name" select="'Form_Payor_CountryCode'"/>
	                            <xsl:with-param name="active" select="/Root/Form/Payor/CountryCode"/>
	                            <xsl:with-param name="className" select="'Form_Payor_CountryCode'"/>
								<xsl:with-param name="disabled">
									<xsl:if test="$openRuns = 1">true</xsl:if>
								</xsl:with-param>
	                        </xsl:call-template>
	                        <xsl:call-template name="inlineError">
	                            <xsl:with-param name="path">Form/Payor/CountryCode</xsl:with-param>
	                            <xsl:with-param name="displayName">Country</xsl:with-param>
	                        </xsl:call-template>
	                    </div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">E-mail</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_Email" id="Form_Payor_Email" value="{Form/Payor/Email}" maxlength="{Form/Payor/Email/@maxLength}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
							<xsl:call-template name="inlineError">
								<xsl:with-param name="path">Form/Payor/Email</xsl:with-param>
								<xsl:with-param name="displayName">E-mail</xsl:with-param>
							</xsl:call-template>
						</div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">Phone</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_PhoneNumber" id="Form_Payor_PhoneNumber" value="{Form/Payor/PhoneNumber}" maxlength="{Form/Payor/PhoneNumber/@maxLength}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
							<xsl:call-template name="inlineError">
								<xsl:with-param name="path">Form/Payor/PhoneNumber</xsl:with-param>
								<xsl:with-param name="displayName">Phone</xsl:with-param>
							</xsl:call-template>
						</div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">Fax</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_FaxNumber" id="Form_Payor_FaxNumber" value="{Form/Payor/FaxNumber}" maxlength="{Form/Payor/FaxNumber/@maxLength}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
							<xsl:call-template name="inlineError">
								<xsl:with-param name="path">Form/Payor/FaxNumber</xsl:with-param>
								<xsl:with-param name="displayName">FaxNumber</xsl:with-param>
							</xsl:call-template>
						</div>
					</label>
				</div>
				<xsl:if test="ClientTypes/ClientType[ClientTypeID = 6]/IsClientTypeFlag = 1">
					<div class="Form-item">
						<label class="Form-label">
							<span class="Form-label-caption">Payor Supplier Code</span>
							<div class="Form-input-wrapper">
								<input class="Input Form-input" type="text" name="Form_Payor_SupplierCode" id="Form_Payor_SupplierCode" value="{Form/Payor/SupplierCode}" maxlength="{Form/Payor/SupplierCode/@maxLength}">
									<xsl:if test="$openRuns = 1">
										<xsl:attribute name="disabled">disabled</xsl:attribute>
									</xsl:if>
								</input>
								<xsl:call-template name="inlineError">
									<xsl:with-param name="path">Form/Payor/SupplierCode</xsl:with-param>
									<xsl:with-param name="displayName">Payor Supplier Code</xsl:with-param>
								</xsl:call-template>
							</div>
						</label>
					</div>
					<div class="Form-item">
						<label class="Form-label">
							<span class="Form-label-caption">AP1 Supplier Code</span>
							<div class="Form-input-wrapper">
								<input class="Input Form-input" type="text" name="Form_Payor_AP1SupplierCode" id="Form_Payor_AP1SupplierCode" value="{Form/Payor/AP1SupplierCode}" maxlength="{Form/Payor/AP1SupplierCode/@maxLength}">
									<xsl:if test="$openRuns = 1">
										<xsl:attribute name="disabled">disabled</xsl:attribute>
									</xsl:if>
								</input>
								<xsl:call-template name="inlineError">
									<xsl:with-param name="path">Form/Payor/AP1SupplierCode</xsl:with-param>
									<xsl:with-param name="displayName">AP1 Supplier Code</xsl:with-param>
								</xsl:call-template>
							</div>
						</label>
					</div>
					<div class="Form-item">
						<label class="Form-label">
							<span class="Form-label-caption">AVP Supplier Code</span>
							<div class="Form-input-wrapper">
								<input class="Input Form-input" type="text" name="Form_Payor_AVPSupplierCode" id="Form_Payor_AVPSupplierCode" value="{Form/Payor/AVPSupplierCode}" maxlength="{Form/Payor/AVPSupplierCode/@maxLength}">
									<xsl:if test="$openRuns = 1">
										<xsl:attribute name="disabled">disabled</xsl:attribute>
									</xsl:if>
								</input>
								<xsl:call-template name="inlineError">
									<xsl:with-param name="path">Form/Payor/AVPSupplierCode</xsl:with-param>
									<xsl:with-param name="displayName">AVP Supplier Code</xsl:with-param>
								</xsl:call-template>
							</div>
						</label>
					</div>
					<div class="Form-item">
						<label class="Form-label">
							<span class="Form-label-caption">DVD1 Supplier Code</span>
							<div class="Form-input-wrapper">
								<input class="Input Form-input" type="text" name="Form_Payor_DVD1SupplierCode" id="Form_Payor_DVD1SupplierCode" value="{Form/Payor/DVD1SupplierCode}" maxlength="{Form/Payor/DVD1SupplierCode/@maxLength}">
									<xsl:if test="$openRuns = 1">
										<xsl:attribute name="disabled">disabled</xsl:attribute>
									</xsl:if>
								</input>
								<xsl:call-template name="inlineError">
									<xsl:with-param name="path">Form/Payor/DVD1SupplierCode</xsl:with-param>
									<xsl:with-param name="displayName">DVD1 Supplier Code</xsl:with-param>
								</xsl:call-template>
							</div>
						</label>
					</div>
				</xsl:if>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">Tax ID</span>
						<div class="Form-input-wrapper">
							<input class="Input Form-input" type="text" name="Form_Payor_TaxID" id="Form_Payor_TaxID" value="{Form/Payor/TaxID}" maxlength="{Form/Payor/TaxID/@maxLength}">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
							</input>
							<xsl:call-template name="inlineError">
								<xsl:with-param name="path">Form/Payor/TaxID</xsl:with-param>
								<xsl:with-param name="displayName">Tax ID</xsl:with-param>
							</xsl:call-template>
						</div>
					</label>
				</div>
				<div class="Form-item">
					<label class="Form-label">
						<span class="Form-label-caption">Comments</span>
						<div class="Form-input-wrapper">
							<textarea class="Input Form-input" rows="6" cols="40" name="Form_Payor_Comments">
								<xsl:if test="$openRuns = 1">
									<xsl:attribute name="disabled">disabled</xsl:attribute>
								</xsl:if>
								<xsl:value-of select="Form/Payor/Comments" />
							</textarea>
						</div>
					</label>
				</div>
			</fieldset>
		</div>
	</xsl:template>

	<xsl:template name="column2Edit">
	    <div class="PayeeEdit-form-part">
		    <fieldset class="User-edit-fieldset">
				<div class="Form-item" id="displayLogo">
					<label class="Form-label">
						<span class="Form-label-caption">Display Logo</span>
							<xsl:call-template name="helpIcon">
								<xsl:with-param name="tip">Allows label logos to display on the PDF versions of statements</xsl:with-param>
							</xsl:call-template>
	                    <div class="Form-input-wrapper">
	                        <xsl:variable name="selectStatusList">
	                            <map>
	                                <mapEntry>
	                                    <name>No</name><value>0</value>
	                                </mapEntry>
	                                <mapEntry>
	                                    <name>Yes</name><value>1</value>
	                                </mapEntry>
	                            </map>
	                        </xsl:variable>
	                        <xsl:call-template name="uiDropdown">
	                            <xsl:with-param name="items" select="$selectStatusList"/>
	                            <xsl:with-param name="id" select="'Form_Payor_ShowLogo'"/>
	                            <xsl:with-param name="name" select="'Form_Payor_ShowLogo'"/>
	                            <xsl:with-param name="active" select="Form/Payor/ShowLogo"/>
	                            <xsl:with-param name="className" select="'Form_Payor_ShowLogo'"/>
	                            <xsl:with-param name="disabled">
									<xsl:if test="$openRuns = 1">true</xsl:if>
								</xsl:with-param>
	                        </xsl:call-template>
	                    </div>
					</label>
				</div>
		    </fieldset>
		    <fieldset class="User-edit-fieldset">
				<div class="Form-item">
					<xsl:if test="normalize-space(Form/Payor/LogoSourceWeb)">
				        <img id="uploadImage" src="{Form/Payor/LogoSourceWeb}?v={/Root/Session}" />
	                </xsl:if>

	                <xsl:choose>
	                    <xsl:when test="$openRuns != 1">
	                        <div id="noFileUploader">
	                            <a class="js-tooltip" data-title='Display logo is set to "No" for this payor.'>
	                                <xsl:choose>
	                                    <xsl:when test="normalize-space(/Root/Form/Payor/LogoSourceWeb)">Replace Image:&#160;</xsl:when>
	                                    <xsl:otherwise>Select Image:&#160;</xsl:otherwise>
	                                </xsl:choose>
	                            </a>No image selected.
	                        </div>
	                        <xsl:call-template name="uiFileUploader">
	                            <xsl:with-param name="name" select="'fileUpload'"/>
	                            <xsl:with-param name="id" select="'fileUpload'"/>
	                            <xsl:with-param name="type" select="'logo'"/>
	                            <xsl:with-param name="buttonContent" select="'Upload Image'"/>
	                        </xsl:call-template>
	                        <xsl:if test="Messages/Message/Code = 'invalid_format'">
	                            <div id="ERRORfileUpload" class="Form-error">
	                                Logo format not supported. Please upload in either GIF (.gif) or JPEG (.jpg/.jpeg) format.
	                            </div>
	                        </xsl:if>
	                        <br />
	        				<div id="FileUploader-extra-information" class="Warning Warning-type-info">
	        				    <div class="Warning-title">Update Payor to upload your logo and save changes</div>
	        				</div>
	    				</xsl:when>
					    <xsl:otherwise>
					        <br /><br />
					    </xsl:otherwise>
					</xsl:choose>
				    <span class="finePrint">
	                    For the best appearance on your statements, we recommend an image at least 150 x 150 (pixels), which will render at 72dpi.  Larger images can be uploaded, which will display crisper images at a higher density. Note that your logo does not need to be square.
	                    <br /><br />
	                    Logos can be in GIF (.gif) or JPEG (.jpg/.jpeg) formats.
	                    <br /><br />
	                    For display on the Dashboard and Analytics, all logos are scaled down to approximately 67 pixels high.  Note that that you may want to avoid an excessively wide logo, as it may dominate the available space.
					</span>
	            </div>
	        </fieldset>
		</div>

		<script type="text/javascript">
		    toggleFileUploader();
	        $("#Form_Payor_ShowLogo").on( "change", function() {
	          toggleFileUploader();
	        });
		</script>
	</xsl:template>

</xsl:stylesheet>
