<script type='text/javascript'>
    var adminid={AdminID};
    Ext.onReady(function(){
        <!-- BEGIN DYNAMIC BLOCK: DisplayToolTip -->
        new Ext.ToolTip({
            target: '{ToolTipId}',
            anchor: 'left',
            width:300,
            html: '{ToolTipString}',
            dismissDelay: 15000 // auto hide after 15 seconds
        });
        <!-- END DYNAMIC BLOCK: DisplayToolTip -->
    });
</script>

<!-- BEGIN DYNAMIC BLOCK: ErrorMsg -->
<br>
{ErrorMsg}
<br>
<!-- END DYNAMIC BLOCK: ErrorMsg -->

<div id="errMessages" valign=top>
    <font class="redtext"><b>{MESSAGES}&nbsp;</b></font>
</div>

<!-- BEGIN DYNAMIC BLOCK: NewAdminGroup -->
<input type=hidden name=groupid value=2>
<!-- END DYNAMIC BLOCK: NewAdminGroup -->

<!-- BEGIN DYNAMIC BLOCK: profileHeader -->
<script type="text/javascript">
    var oldstatus = {oldstatus};
    var oldgroup = {oldgroup};
    var adminid = {userId};
</script>

<div id="profile-header-username" style="padding-top:5px;padding-bottom:24px;">
    <div style="float:left;padding-right:10px;padding-bottom:10px;padding-left:10px;">
        <span style="font-size:24px;">
            {userName}&nbsp;({userId})
        </span>
    </div>
    
    <!-- BEGIN DYNAMIC BLOCK: editAdminStatus -->
    <div id="profile-status" class="{profilestatusclass}" style="float:left;">
        <select id="dropdown_adminstatus" name="dropdown_adminstatus" size="10" style="display:none">
            <option value="1" {activeSelected} >[l]Active[/l]</option>
            <option value="-1" {inactiveSelected} >[l]Inactive[/l]</option>
        </select>
        
        <span id="label_adminstatus" style="text-transform:capitalize;display:''">
            <a href="javascript:ToggleStatus();">
                <span id="label_adminstatus_text">{statusname}</span>
            </a>
        </span>
    </div>
    <!-- END DYNAMIC BLOCK: editAdminStatus -->
    
    <!-- BEGIN DYNAMIC BLOCK: adminStatus -->
    <div id="profile-status" class="{profilestatusclass}" style="float:left;">
        <span id="label_adminstatus" style="text-transform:capitalize;display:''">
            <a>
                <span id="label_adminstatus_text">{statusname}</span>
            </a>
        </span>
    </div>
    <!-- END DYNAMIC BLOCK: adminStatus -->
</div>

<div id="profileheader" style="clear:both;">
    <table border="0" cellpadding="0" cellspacing="10">
        <tr>
            <td valign="top">
                <img src="{profileurl}" width="48" height="48" style="border:4px solid #D9D9D9;" alt="" />
            </td>
            <td  valign="top">
                <!-- BEGIN DYNAMIC BLOCK: editAdminGroup -->
                <div id="profile-header-group" class="profile-header-item">
                    <label style="float:left;padding-right:10px;">[l]Group[/l]:</label>
                    <div id="profile-group">
                        <select id="dropdown_adminGroup" name="dropdown_adminGroup" style="display:none">
                            <!-- BEGIN DYNAMIC BLOCK: adminGroupOption -->
                            <option value="{adminGroupValue}" {adminGroupSelected} >{adminGroupName}</option>
                            <!-- END DYNAMIC BLOCK: adminGroupOption -->
                        </select>
                        <span id="profile-group-label" style="display:''">
                            <a href="javascript:ToggleGroup();" >
                                <span id="profile-group-label_text">{assignedgroup}</span>
                            </a>
                        </span>
                    </div>
                </div>
                <!-- END DYNAMIC BLOCK: editAdminGroup -->
                
                <!-- BEGIN DYNAMIC BLOCK: adminGroup -->
                <div id="profile-header-group" class="profile-header-item">
                    <label style="float:left;padding-right:10px;">[l]Group[/l]:</label>
                    <div id="profile-group">
                        <span id="profile-group-label" style="display:''">
                            <span id="profile-group-label_text">{assignedgroup}</span>
                        </span>
                    </div>
                </div>
                <!-- END DYNAMIC BLOCK: adminGroup -->
                
                <div id="profile-header-lastseen" class="profile-header-item">
                    <label>[l]Last Seen[/l]:</label>
                    {lastSeenPretty}
                </div>
            </td>
        </tr>
    </table>
</div>
<!-- END DYNAMIC BLOCK: profileHeader -->

<form method=post action=index.php?fuse=admin&action={ACTION}>
    <input type=hidden name=id value={AdminID}>
    
    <dl class="form">
        <!-- BEGIN DYNAMIC BLOCK: AddAdminTitle -->
        <br>
        &nbsp;&nbsp;
        <b>
            <font class=bodyheader>
                [l]Enter the new admin's profile below[/l]:
            </font>
        </b>
        <br>
        <br>
        <!-- END DYNAMIC BLOCK: AddAdminTitle -->
        
        <!-- BEGIN DYNAMIC BLOCK: customFields -->
        <dt><label>{rowLabel}</label></dt>
        <dd class="ddelement" style="width:300px;">
            <!-- BEGIN DYNAMIC BLOCK: typeLanguage -->
            <select name='CT_{fieldId}' style="width:248px;">
                <!-- BEGIN DYNAMIC BLOCK: typeLanguageOption -->
                <option size=30 value='{typeLanguageOptionValue}' {typeLanguageOptionSelected}>{typeLanguageOptionLabel}</option>
                <!-- END DYNAMIC BLOCK: typeLanguageOption -->
            </select>
            <!-- END DYNAMIC BLOCK: typeLanguage -->
            
            <!-- BEGIN DYNAMIC BLOCK: typeCountry -->
            <select name=CT_{fieldId} style="width:248px;">
                {countryOptions}
            </select>
            <!-- END DYNAMIC BLOCK: typeCountry -->
            
            <!-- BEGIN DYNAMIC BLOCK: typeTextarea -->
            <textarea name='CT_{fieldId}' style="width:236px; height:65px;" cols='{fieldWidth}'>{value}</textarea>
            <!-- END DYNAMIC BLOCK: typeTextarea -->
            
            <!-- BEGIN DYNAMIC BLOCK: typeDropdown -->
            <select name=CT_{fieldId} style="width:248px;">
                <!-- BEGIN DYNAMIC BLOCK: typeDropdownOption -->
                <option size=30 value='{typeDropdownOptionValue}' {typeDropdownOptionSelected}>{typeDropdownOptionLabel}</option>
                <!-- END DYNAMIC BLOCK: typeDropdownOption -->
            </select>
            <!-- END DYNAMIC BLOCK: typeDropdown -->
            
            <!-- BEGIN DYNAMIC BLOCK: typeDate -->
            <input type="text" name="CT_{fieldId}" id="CT_{fieldId}" style="width:223px;" value="{value}" ></input>
            
            <script type="text/javascript">
                datefields.push("CT_{fieldId}");
            </script>
            <!-- END DYNAMIC BLOCK: typeDate -->
            
            <!-- BEGIN DYNAMIC BLOCK: typeYesNo -->
            <select name=CT_{fieldId} style="width:248px;">
                <option value="1" {yesSelected} >[l]Yes[/l]</option>
                <option value="0" {noSelected} >[l]No[/l]</option>
            </select>
            <!-- END DYNAMIC BLOCK: typeYesNo -->
            
            <!-- BEGIN DYNAMIC BLOCK: typeSimple -->
            <input type="text" class="x-form-text x-form-field" name="CT_{fieldId}" style="width:240px;" value="{value}" />
            <!-- END DYNAMIC BLOCK: typeSimple -->
            
            <!-- BEGIN DYNAMIC BLOCK: fieldInformation -->
            &nbsp;
            <img id='fieldInformation_{fieldId}' class='tip-target' src='../templates/admin/images/information-button.png'/>
            <!-- END DYNAMIC BLOCK: fieldInformation -->
            
            <!-- BEGIN DYNAMIC BLOCK: fieldRequired -->
                <!-- BEGIN DYNAMIC BLOCK: EmailOriginalName -->
                <input type=hidden name="e_CT_{fieldId}" value="{OriginalName} Format">
                <!-- END DYNAMIC BLOCK: EmailOriginalName -->
                
            <input type=hidden name="r_CT_{fieldId}" value="{OriginalName}">
            <!-- END DYNAMIC BLOCK: fieldRequired -->
        </dd>
        <!-- END DYNAMIC BLOCK: customFields -->
        
        <!-- BEGIN DYNAMIC BLOCK: newAdminGroup -->
        <dt><label>[l]Group[/l]</label></dt>
        <dd class="ddelement" style="width:300px;">
            <select name=groupid style="width:248px;">
                <!-- BEGIN DYNAMIC BLOCK: newAdminGroupOption -->
                <option value="{newAdminGroupValue}" {newAdminGroupSelected} >{newAdminGroupName}</option>
                <!-- END DYNAMIC BLOCK: newAdminGroupOption -->
            </select>
        </dd>
        <!-- END DYNAMIC BLOCK: newAdminGroup -->
        
        <!-- BEGIN DYNAMIC BLOCK: adminDepartments -->
        <dt><label>[l]Departments[/l]</label></dt>
        <dd class="ddelement" style="width:300px;">
            <select name="departments[]" style="width:248px;" multiple="true" size="5" onchange="onChangeDepartment(this)">
                <!-- BEGIN DYNAMIC BLOCK: adminDepartmentsOption -->
                <option value="{adminDepartmentValue}" {adminDepartmentSelected}>{adminDepartmentName}</option>
                <!-- END DYNAMIC BLOCK: adminDepartmentsOption -->
            </select>
            &nbsp;
            <img style="display: inline-block; vertical-align: top;" id='fieldInformation_departments' class='tip-target' src='../templates/admin/images/information-button.png' />
        </dd>
        <!-- END DYNAMIC BLOCK: adminDepartments -->
    </dl>
    
    <!-- BEGIN DYNAMIC BLOCK: adminSignature -->
    <dl class="form">
        <dt><label>[l]Signature[/l]</label></dt>
        <dd class="ddelement" style="width:300px;">
        </dd>
        <br>
        <br>
        <span style="padding-left:10px;">
            <textarea name='signature' id='signature' style="width:416px; height:65px;">{signature_value}</textarea>
        </span>
    </dl>
    <!-- END DYNAMIC BLOCK: adminSignature -->
    <br>
    <br>
    <dl class="form">
        <!-- BEGIN DYNAMIC BLOCK: passwordNotice -->
        <dt>
        </dt>
        <dd class="ddelement" style="width:300px;">
        </dd>
        <br>
        &nbsp;&nbsp;
        <b>
            <font class=bodyheader color=red>
                &nbsp;&nbsp;&nbsp;
                [l]Note[/l]: [l]Supply only if you want password changed[/l]
            </font>
        </b>
        <br>
        <br>
        <!-- END DYNAMIC BLOCK: passwordNotice -->
        
        <dt><label>[l]New Password[/l]</label></dt>
        <dd class="ddelement" style="width:300px;">
            <input class="x-form-text x-form-field" style="width:240px;" type="password" id="new_password" name="new_password" size="30" autocomplete="off">
            
            <!-- BEGIN DYNAMIC BLOCK: requireNewPassword -->
            <input type=hidden name=r_new_password value="[l]New Password[/l]">
            <!-- END DYNAMIC BLOCK: requireNewPassword -->
        </dd>
        
        <dt><label>[l]Confirm password[/l]</label></dt>
        <dd class="ddelement" style="width:300px;">
            <input class="x-form-text x-form-field" style="width:240px;" type="password" id="confirm_password" name="confirm_password" size="30" autocomplete="off">
            
            <!-- BEGIN DYNAMIC BLOCK: requireConfirmPassword -->
            <input type=hidden name=r_confirm_password value="[l]Confirm password[/l]">
            <!-- END DYNAMIC BLOCK: requireConfirmPassword -->
        </dd>
    </dl>
    
    <input type=hidden name=customTagsArray value='{custom_Tags_Array}'>
    
    <!-- BEGIN DYNAMIC BLOCK: AddAdminButtons -->
    <input type="submit" style="float:left" class="button" value='[l]Add Admin[/l]' onclick='if (checkPassword(form)) check(form,form.elements.length);return false;'></input>
    <!-- END DYNAMIC BLOCK: AddAdminButtons -->
    
    <!-- BEGIN DYNAMIC BLOCK: UpdateAdminButtons -->
    <input type="submit" style="float:left" class="button" value='[l]update[/l]' onclick='if (checkPassword(form)) check(form,form.elements.length);return false;'></input>
    <!-- END DYNAMIC BLOCK: UpdateAdminButtons -->
</form>

<!-- BEGIN DYNAMIC BLOCK: DeleteAdminButtons -->
<div style="padding-left:10px;float:left">
    <form method=post action=index.php?fuse=admin&action=DeleteAdminAccount>
        <input type=hidden name=deleteid value={AdminID}></input>
        <input type="submit" style="float:left" class="button" value='[l]delete[/l]' onClick='var answer=confirm("[lj]Click OK if you are sure you want to delete this account.  \n\nWARNING: All support ticket information for this user will be replaced to generic Tech Support[/lj]");if (!answer) return false;'></input>
    </form>
</div>
<!-- END DYNAMIC BLOCK: DeleteAdminButtons -->