<!--                                                                  -->
<!--  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">
      <xsl:call-template name="payorEdit" />
      <xsl:call-template name="buttons" />
    </form>
  </xsl:template>

  <xsl:template name="payorEdit">
    <div class="section">
      <xsl:call-template name="successMessageGeneral">
        <xsl:with-param name="successMessage">Payor successfully created!</xsl:with-param>
      </xsl:call-template>
      <xsl:if test="Params/_inline">
        <input type="hidden" name="_inline" value="1" />
      </xsl:if>
      <xsl:call-template name="openRunStatusMessage" />
      <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>
      <p class="formHeader">Enter payor information here.</p>
      <hr />
      <xsl:call-template name="errorMessageGeneral" />
      <xsl:call-template name="column1Edit" />
      <xsl:call-template name="column2Edit" />
      <br class="superBreak" />
      <br />
    </div>
  </xsl:template>

  <xsl:template name="column1Edit">
    <div class="column1">
      <table>
        <tr>
          <td class="leftCol"><label for="Form_Payor_Name">*Payor:</label></td>
          <td>
            <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>
            <input type="text" class="payorNameField" 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>
          </td>
        </tr>
        <tr>
          <td class="leftCol"><label for="Form_Payor_ClientPayorID">Client Payor #:</label></td>
          <td>
            <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>
            <input type="text" class="clientAccountIDField" 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>
          </td>
        </tr>
        <tr>
          <td class="leftCol"><label for="Form_Payor_Inactive">Status:</label></td>
          <td>
            <select name="Form_Payor_Inactive" id="Form_Payor_Inactive" onChange="inactivePayorWarning(this.value)">
              <xsl:if test="$openRuns = 1">
                <xsl:attribute name="disabled">disabled</xsl:attribute>
              </xsl:if>
              <option value="0">Active</option>
              <option value="1">
                <xsl:if test="Form/Payor/Inactive = 1">
                  <xsl:attribute name="selected">selected</xsl:attribute>
                </xsl:if>
                Inactive
              </option>
            </select>
          </td>
        </tr>
        <tr><td colspan="2"><hr /></td></tr>
        <tr>
            <td class="leftCol"><label for="Form_Payor_StreetAddress">Address 1:</label></td>
            <td>
                <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>                    
            </td>
        </tr>
        <tr>
            <td class="leftCol"><label for="Form_Payor_StreetAddress2">Address 2:</label></td>
            <td>
                <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>                    
            </td>
        </tr>  
        <tr>
            <td class="leftCol"><label for="Form_Payor_StreetAddress3">Address 3:</label></td>
            <td>
                <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>                    
            </td>
        </tr>           
        <tr>
          <td class="leftCol"><label for="Form_Payor_City">City:</label></td>
          <td>
            <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>
            <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>
          </td>
        </tr>
        <tr>
          <td class="leftCol"><label for="Form_Payor_StateProvince">State/Province:</label></td>
          <td>
            <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>
            <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>
          </td>
        </tr>
        <tr>
          <td class="leftCol"><label for="Form_Payor_PostalCode">ZIP/Postal:</label></td>
          <td>
            <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>
            <input type="text" class="zipField" 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>
          </td>
        </tr>
        <tr>
          <td class="leftCol"><label for="Form_Payor_CountryCode">Country:</label></td>
          <td>
            <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>
            <select name="Form_Payor_CountryCode" id="Form_Payor_CountryCode">
              <xsl:if test="$openRuns = 1">
                <xsl:attribute name="disabled">disabled</xsl:attribute>
              </xsl:if>
              <option value="">Choose...</option>
              <xsl:for-each select="Form/CountryList/Country">
                <option value="{CountryCode}">
                  <xsl:if test="CountryCode = /Root/Form/Payor/CountryCode">
                    <xsl:attribute name="selected">selected</xsl:attribute>
                  </xsl:if>
                  <xsl:value-of select="Name" />
                </option>
              </xsl:for-each>
            </select>
          </td>
        </tr>
        <tr><td colspan="2"><hr /></td></tr>
        <tr>
          <td class="leftCol"><label for="Form_Payor_Email">E-mail:</label></td>
          <td>
            <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>
            <input type="text" class="emailField" 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>
          </td>
        </tr>
        <tr>
          <td class="leftCol"><label for="Form_Payor_PhoneNumber">Phone:</label></td>
          <td>
            <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>
            <input type="text" class="phoneField" 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>
          </td>
        </tr>
        <tr>
          <td class="leftCol"><label for="Form_Payor_FaxNumber">Fax:</label></td>
          <td>
            <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>
            <input type="text" class="phoneField" 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>
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <br />*Required field
          </td>
        </tr>
      </table>
    </div>
  </xsl:template>


  <xsl:template name="column2Edit">

    <div class="column2">
      <table>

        <xsl:if test="ClientTypes/ClientType[ClientTypeID = 6]/IsClientTypeFlag = 1">
            <tr>
              <td class="leftCol"><label for="Form_Payor_SupplierCode">Payor Supplier Code:</label></td>
              <td>
                <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>
                <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>
              </td>
            </tr>
            <tr>
              <td class="leftCol"><label for="Form_Payor_AP1SupplierCode">AP1 Supplier Code:</label></td>
              <td>
                <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>
                <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>
              </td>
            </tr>
            <tr>
              <td class="leftCol"><label for="Form_Payor_AVPSupplierCode">AVP Supplier Code:</label></td>
              <td>
                <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>
                <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>
              </td>
            </tr>
            <tr>
              <td class="leftCol"><label for="Form_Payor_DVD1SupplierCode">DVD1 Supplier Code:</label></td>
              <td>
                <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>
                <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>
              </td>
            </tr>
            <tr><td colspan="2"><hr /></td></tr>
        </xsl:if>

        <tr>
          <td class="leftCol"><label for="Form_Payor_TaxID">Tax ID:</label></td>
          <td>
            <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>
            <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>
          </td>
        </tr>

        <tr><td colspan="2"><hr /></td></tr>

        <tr>
          <td class="leftCol"><label for="Form_Payor_ShowLogo">Display Logo:</label></td>
          <td>
            <select name="Form_Payor_ShowLogo" id="Form_Payor_ShowLogo">
              <xsl:if test="$openRuns = 1">
                <xsl:attribute name="disabled">disabled</xsl:attribute>
              </xsl:if>
              <option value="0">No</option>
              <option value="1">
                <xsl:if test="Form/Payor/ShowLogo = 1">
                  <xsl:attribute name="selected">selected</xsl:attribute>
                </xsl:if>
                Yes
              </option>
            </select>
            <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>
          </td>
        </tr>


				<!--
        <tr><td colspan="2"><hr /></td></tr>
        <tr>
          <td class="leftCol"><label for="Form_Payor_CycleCode">Cycle:</label></td>
          <td>
            <xsl:call-template name="inlineError">
              <xsl:with-param name="path">Form/Payor/CycleCode</xsl:with-param>
              <xsl:with-param name="displayName">Cycle</xsl:with-param>
            </xsl:call-template>
            <select name="Form_Payor_CycleCode" id="Form_Payor_CycleCode">
              <option value="">Choose...</option>
              <option value="1">
                <xsl:if test="Form/Payor/CycleCode = '1'">
                  <xsl:attribute name="selected">selected</xsl:attribute>
                </xsl:if>
                Quarterly
              </option>
              <option value="2">
                <xsl:if test="Form/Payor/CycleCode = '2'">
                  <xsl:attribute name="selected">selected</xsl:attribute>
                </xsl:if>
                Semi-Annually
              </option>
              <option value="3">
                <xsl:if test="Form/Payor/CycleCode = '3'">
                  <xsl:attribute name="selected">selected</xsl:attribute>
                </xsl:if>
                Annually
              </option>
            </select>
          </td>
        </tr>
        <tr>
          <td class="leftCol"><label for="Form_Payor_BeginMonthCode">Begin Month:</label></td>
          <td>
            <xsl:call-template name="inlineError">
              <xsl:with-param name="path">Form/Payor/BeginMonthCode</xsl:with-param>
              <xsl:with-param name="displayName">Begin Month</xsl:with-param>
            </xsl:call-template>
            <select name="Form_Payor_BeginMonthCode" id="Form_Payor_BeginMonthCode">
              <option value="">Choose...</option>
              <option value="1">
                <xsl:if test="Form/Payor/BeginMonthCode = '1'">
                  <xsl:attribute name="selected">selected</xsl:attribute>
                </xsl:if>
                January
              </option>
              <option value="2">
                <xsl:if test="Form/Payor/BeginMonthCode = '2'">
                  <xsl:attribute name="selected">selected</xsl:attribute>
                </xsl:if>
                April
              </option>
              <option value="3">
                <xsl:if test="Form/Payor/BeginMonthCode = '3'">
                  <xsl:attribute name="selected">selected</xsl:attribute>
                </xsl:if>
                July
              </option>
              <option value="4">
                <xsl:if test="Form/Payor/BeginMonthCode = '4'">
                  <xsl:attribute name="selected">selected</xsl:attribute>
                </xsl:if>
                October
              </option>
            </select>
          </td>
        </tr>
				-->
        <tr><td colspan="2"><hr /></td></tr>
        <tr>
          <td class="leftCol labelTop">Comments:</td>
          <td>
            <textarea 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>
          </td>
        </tr>
      </table>
    </div>
  </xsl:template>

</xsl:stylesheet>
