<!-- BEGIN DYNAMIC BLOCK: packageSections -->
    <script language='Javascript'>
        var gAddingNew = false;
        var thereAreAddons = false;
        var serverips = new Array();
        var serverplugin = new Array();
        serverips['0'] = new Array('', '');
        serverplugin['0'] = '';
        <!-- BEGIN DYNAMIC BLOCK: serverIPsArr -->
            serverips['{serverId}'] = new Array('{sharedIP}'{secondaryIP});
            serverplugin['{serverId}'] = '{serverPlugin}';
        <!-- END DYNAMIC BLOCK: serverIPsArr -->
        var excludeFields = new Array();
        <!-- BEGIN DYNAMIC BLOCK: excludeFields -->
            excludeFields[{excludeFieldsKey}] = "{excludeFieldsValues}";
        <!-- END DYNAMIC BLOCK: excludeFields -->
        function getTLDFields(domain)
        {
          var selectedDomain = {selectedDomain};
          domain = encodeURIComponent(domain);
          new Ajax.Updater('tld_specific_fields', 'index.php?fuse=clients&view=GetTLDFields&domain='+domain+'&selectedDomain='+selectedDomain,
                           {onLoading : function(request) {resetStatus(lang('Loading TLD attributes'))},
                             onComplete: function(request) {unsetStatus(lang('Loaded'), 1000)}})
        }
        <!-- BEGIN DYNAMIC BLOCK: ifCurrentDomain -->
              onLoadFunctions.push(function() {getTLDFields('{currentDomain}');})
        <!-- END DYNAMIC BLOCK: ifCurrentDomain -->
    </script>


    <form name="mainform" method="post" action='index.php?fuse=clients&action=Admin_UpdateDomain'>
        <input type="hidden" name="domainid" value="{selectedDomainId}"/>
        <input type="hidden" name="userid" value="{userId}"/>
        <input type="hidden" name="nextaction" value="Admin_Profile_Domains"/>
        <input type="hidden" name="id" value="{selectedDomainId}"/>
        <input type="hidden" name="selectedDomain" value="{selectedDomainId}"/>
        <!-- BEGIN DYNAMIC BLOCK: customerIdVar -->
        <input type=hidden name=customerid value="{customerId}"/>
        <!-- END DYNAMIC BLOCK: customerIdVar -->
        <!-- BEGIN DYNAMIC BLOCK: pendingClient -->
        <input type="hidden" name="" value="{pendingClientId}"/>
        <!-- END DYNAMIC BLOCK: pendingClient -->


        <div class="section" style="padding-bottom:0px;padding-top:0px;">
            <h4 style="padding-left:10px;">Package #{selectedDomainId} {currentDomain}</h4>
        </div>

        <dl class="form">

            <dt><label>[l]Status[/l]</label></dt>
            <dd class="ddelement" style="width:300px;">{packageStatus}</dd>
        
            <dt><label>[l]Type[/l]</label></dt>
            <dd class="ddelement" style="width:300px;">
                <select name="promotionid" onChange='packageBillingChanged = true; GetPackage(); updateCustomFields();'>
                    <!-- BEGIN DYNAMIC BLOCK: packageTypeOptions -->
                        <option value="{packageTypeOptionsValue}" {packageTypeOptionsSelected} >{packageTypeOptionsLabel}</option>
                    <!-- END DYNAMIC BLOCK: packageTypeOptions -->
                </select>
            </dd>

            <!-- BEGIN DYNAMIC BLOCK: package -->
            <dt><label>[l]Name[/l]</label></dt>
            <dd class="ddelement" style="width:300px;">
                <select name="plan"  onChange="switchPackages(this.value); packageBillingChanged = true;">
                    <!-- BEGIN DYNAMIC BLOCK: packageOptions -->
                    <option value="{packageOptionsValue}" {packageOptionsSelected} >{packageOptionsLabel}</option>
                    <!-- END DYNAMIC BLOCK: packageOptions -->
                </select>
            </dd>
            <!-- END DYNAMIC BLOCK: package -->
               
            
            <!-- BEGIN DYNAMIC BLOCK: customField -->
            <span id="CT_{fieldId}_span">
            <dt><label>{fieldLabel}</label></dt>
            <dd class="ddelement" style="width:300px;">
                <!-- BEGIN DYNAMIC BLOCK: customFieldTypeText -->
                <input class="x-form-text x-form-field" type="text" name='CT_{fieldId}' size="{fieldWidth}" value="{fieldValue}" />
                <!-- END DYNAMIC BLOCK: customFieldTypeText -->
                <!-- BEGIN DYNAMIC BLOCK: customFieldTypeTextarea -->
                <textarea name='CT_{fieldId}' class="body" cols='{fieldWidth}' {fieldDisabled}>{fieldValue}</textarea>
                <!-- END DYNAMIC BLOCK: customFieldTypeTextarea -->
                <!-- BEGIN DYNAMIC BLOCK: customFieldTypeDropdown -->
                <select name="CT_{fieldId}">
                    <!-- BEGIN DYNAMIC BLOCK: customFieldTypeDropdownOptions -->
                    <option size="30" value="{customFieldTypeDropdownOptionsValue}" {customFieldTypeDropdownOptionsValueSelected} >{customFieldTypeDropdownOptionsLabel}</option>
                    <!-- END DYNAMIC BLOCK: customFieldTypeDropdownOptions -->
                </select>
                <!-- END DYNAMIC BLOCK: customFieldTypeDropdown -->
                <!-- BEGIN DYNAMIC BLOCK: customFieldTypeCountry -->
                <select name="CT_{fieldId}">
                    {countries}
                </select>
                <!-- END DYNAMIC BLOCK: customFieldTypeCountry -->
                <!-- BEGIN DYNAMIC BLOCK: customFieldTypeDate -->
                <input type="hidden" name="CTT_{fieldId}" id="CTT_{fieldId}" value="{typeDATE}"  >
                <input type=text class="x-form-text x-form-field" name=CT_{fieldId} id=CT_{fieldId} value="{dateString}" {readOnly}>
                <!-- END DYNAMIC BLOCK: customFieldTypeDate -->
                <!-- BEGIN DYNAMIC BLOCK: customFieldTypeDateSimple -->
                <input type="hidden" name="CTT_{fieldId}" id="CTT_{fieldId}" value="{typeDATE}">{dateString}
                <!-- END DYNAMIC BLOCK: customFieldTypeDateSimple -->
                <!-- BEGIN DYNAMIC BLOCK: customFieldTypeOther -->
                <select style='width:{fieldWidth}px;' name='CT_{fieldId}'>
                    <option value='1' {yesSelected}>[l]Yes[/l]</option>
                    <option value='0' {noSelected}>[l]No[/l]</option>
                </select>
                <!-- END DYNAMIC BLOCK: customFieldTypeOther -->
            </dd>
            </span>
            <!-- END DYNAMIC BLOCK: customField -->


            <div id="addonsDiv"></div>

            <input type=hidden name='isDomainPackage' value="{isDomainPackage}" />
            <div id='domain_frame'  class="section" style="display:{displayDomainFrame}">
                <h4>[l]Domain Information[/l]</h4>
                <!-- BEGIN DYNAMIC BLOCK: domainHandling -->
                <span style="font-size:80%;font-weight:normal;">{domainHandlingString}</span>
                <!-- END DYNAMIC BLOCK: domainHandling -->
                <div style='color:red;font-weight:bold;' id='domainMessage'name='domainMessage'></div>

                <dt><label>[l]Domain Name[/l]</label></dt>
                <dd class="ddelement" style="width:300px;">
                    <input class="x-form-text x-form-field" type='text' name='DomainName' value='{currentDomain}'  onchange="CheckDomain(form,this.value)" >
                </dd>

                <dt><label>[l]Registration Length[/l]</label></dt>
                <dd class="ddelement" style="width:300px;">
                  <select name="registration_years">
                  <!-- BEGIN DYNAMIC BLOCK: registrationLength -->
                    <option value="{registrationLengthValue}" {registrationLengthSelected} >{registrationLengthLabel}</option>
                  <!-- END DYNAMIC BLOCK: registrationLength -->
                  </select>
                </dd>

                <dt><label>[l]Order ID[/l]</label></dt>
                <dd class="ddelement" style="width:300px;">
                    <input type="text" class="x-form-text x-form-field" name="registrar_orderid" value="{domainOrderId}" />&nbsp;{domainOrderIdHelp}
                </dd>

                <!-- BEGIN DYNAMIC BLOCK: domainUsernameInfo -->
                <dt><label>[l]User Name[/l]</label></dt>
                <dd class="ddelement" style="width:300px;">
                    <input type="text" class="x-form-text x-form-field" name="UserName" value="{domainUsername}" class="required" />
                </dd>
                <!-- END DYNAMIC BLOCK: domainUsernameInfo -->

                <dt><label>[l]Password[/l]</label></dt>
                <dd class="ddelement" style="width:300px;">
                    <input type="text" class="x-form-text x-form-field" name="Password" value="{domainPassword}" class="required"/>
                    {passwordWarning}
                </dd>

                <!-- fields specific to a certain tld registrar plugin -->
                <span id="tld_specific_fields">&nbsp;</span>
            </div>

            <!-- BEGIN DYNAMIC BLOCK: serverFields -->
            <input type=hidden name='isServerPackage' value='0' />
            <div id="server_frame" class="section" style="display:none">
                <h4>[l]Server Information[/l]</h4>

                <dt><label>[l]Server[/l]</label></dt>
                <dd class="ddelement" style="width:300px;">
                    <select id='serverid' name='serverid' onchange="switchServer(this.options[this.selectedIndex].value)"></select>
                </dd>

                <dt><label>[l]IP Address[/l]</label></dt>
                <dd class="ddelement" style="width:300px;">
                    <input type="text" class="x-form-text x-form-field"  name="CT_1" value="{IPAddress}" /> <input type='checkbox' name='shared' onClick="EnableSelect(this);" {checkedString} />&nbsp;[l]Use Shared IP[/l]
                    <br/>
                    <select name='serverips' onChange="SetIP();">
                        <option value='0'>[l]Available Server IPs[/l]</option>
                    </select>
                </dd>
            </div>
            <!-- END DYNAMIC BLOCK: serverFields -->

            <!-- BEGIN DYNAMIC BLOCK: billingSection -->
            <div id="adminsection" class="section">
                 <h4>[l]Billing Information[/l]</h4>

                 <dt><label>[l]Date Created[/l]</label></dt>
                 <dd class="ddelement" style="width:300px;">
                    <input type="text" name="dateActivated" id="dateActivated" value="{DATE_CREATED}" />
                    <script type="text/javascript">datefields.push("dateActivated");</script>
                </dd>

                 <dt><label>[l]Recurring[/l]</label></dt>
                 <dd class="ddelement" style="width:300px;">
                    <select name="recurring" onChange="packageBillingChanged = true; togglerecurringfields();">
                        <option value="0" {NO_SELECTED}>[l]No[/l]</option>
                        <option value="1" {YES_SELECTED}>[l]Yes[/l]</option>
                    </select>
                </dd>

                <div id="recurringinfo" style="display:{DISP_RECURRING}">

                    <dt><label>[l]Billing Cycle[/l]</label></dt>
                    <dd class="ddelement" style="width:300px;">
                        <select name="paymentterm" onChange="packageBillingChanged = true; getPackageAddons();">
                          <option value="1" {1_SEL}>[l]Monthly[/l]&nbsp;&nbsp;</option>
                          <option value="3" {3_SEL}>[l]Quarterly[/l]&nbsp;&nbsp;</option>
                          <option value="6" {6_SEL}>[l]Semiannually[/l]&nbsp;&nbsp;</option>
                          <option value="12" {12_SEL}>[l]Annually[/l]&nbsp;&nbsp;</option>
                          <option value="24" {24_SEL}>[l]Every 2 Years[/l]&nbsp;&nbsp;</option>
                        </select>
                    </dd>

                    <dt><label>[l]Next Due Date[/l]</label></dt>
                    <dd class="ddelement" style="width:300px;">
                        <input type="text" name="nextbilldate" id="nextbilldate" value="{NEXTBILLDATE}" />
                        <!-- BEGIN DYNAMIC BLOCK: subscriptions -->
                            <br/>
                            <input type="submit" style="margin-right:0" value="[lh]Reset Invoice[/lh]" onclick="if (AskAboutResettingRecurring2(form)){addExtraInfo();ToggleDomainRequirement();check(form,form.elements.length);};return false;" />
                            <img id="subtip" alt="" class="tip-target" src="../templates/admin/images/information-button.png"/>
                            <input type="hidden" id="subpopup" value="{SUB_POPUP}" />
                        <!-- END DYNAMIC BLOCK: subscriptions -->
                    </dd>
                    <script type="text/javascript">datefields.push("nextbilldate");</script>


                 </div>
                 <input type="hidden" id="altprice" name="altprice" value="0.00" />
                <dt><label><input type="checkbox" id="price_override" name="price_override" onclick="togglePriceOverride();" {PRICE_CHECKED} />&nbsp;[l]Overide Price[/l]</label></dt>
                <dd class="ddelement" style="width:300px;">
                    <input type="text" class="x-form-text x-form-field" id="price" name="price"  value="{PRICE_VALUE}" {PRICE_DISABLED}/>
                </dd>

            </div>
            <script type="text/javascript">GetPackage("{domainPlan}");updateCustomFields();</script>
            <!-- END DYNAMIC BLOCK: billingSection -->



            <table style="clear:both;" id='buttonContainer' width='400' border='0'>
                <tr>
                <!-- BEGIN DYNAMIC BLOCK: showDomainData -->
                <td>
                <input type='hidden' name='resetgenerateinvoice' value='{resetGenerateInvoice}' />
                <div id="actionsection">
                    <div class="clearline"></div>
                    {packageButtons}
                    <div class="clearline"></div>
                </div>
                </td>
                <!-- END DYNAMIC BLOCK: showDomainData -->
                </tr>
            </table>
</dl>
        <input type='hidden' name='customTagsArray' value='{queryString2}' />
    </form>
<!-- END DYNAMIC BLOCK: packageSections -->