<script type="text/javascript">
function showRichTextEditorForAutoresponders(autoresponderId)
{
    showRichTextEditor("oEdit" + autoresponderId, 650, '250px',
                        [
                            'Undo','Redo','|','Hyperlink','|','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','|','Numbering','Bullets','|','LTR','RTL','|','XHTMLFullSource','StyleAndFormatting','TextFormatting','ListFormatting','BoxFormatting','ParagraphFormatting','CssText','|','FontName','FontSize','|','Bold','Italic','Underline','|','ForeColor','BackColor'
                        ],
                        "value_" + autoresponderId + '[0]');
}
</script>
<table width="100%">
    <tr>
        <td>
            <div class="yellowbox">
                <h2>[l]Notice[/l]:</h2>
                [l]You may use tags in both the subject and content[/l] <a href="#" onclick="openHelpWindow('admin', 'EmailTemplatesSupport_Settings', 'Support+Ticket+Subject+Template', 'menubar=no,scrollbars=yes,width=240,height=420')" >([l]Click to view available tags[/l])</a><br />
                [l]A template can only be deleted if it has no associated E-mail routing rules.[/l]
            </div>
        </td>
    </tr>
</table>
<!-- BEGIN DYNAMIC BLOCK: templateRow -->
<form method="post" action="index.php?fuse=support&action=SaveAutoresponderTemplates">
    <input type="hidden" name="templateId" value="{templateId}" />
    <input type="hidden" name="delete" value="0" />
    <table width="100%">
        <tr>
            <td align="right" class="formlabel" width="1%" nowrap="true" >[l]Template name[/l]:</td>
            <td class="formfield">
                <input type="text" name="templateName" value="{templateName}" size="40" />
            </td>
        </tr>
        <tr>
            <td align="right" class="formlabel" width="1%" nowrap="true" >[l]Subject[/l]:</td>
            <td class="formfield">
                <input type="text" name="templateSubject" value="{templateSubject}" size="40" />
            </td>
        </tr>
        <tr>
            <td align="right" class="formlabel" width="1%" nowrap="true" >[l]Assigned to rules[/l]:</td>
            <td class="formfield">
                <!-- BEGIN DYNAMIC BLOCK: routingRulesList -->
                <ul>
                    <!-- BEGIN DYNAMIC BLOCK: routingRule -->
                    <li><a href="index.php?fuse=support&view=AddEditEmailRouting&routing={ruleId}">{ruleName}</a></li>
                    <!-- END DYNAMIC BLOCK: routingRule -->
                </ul>
                <!-- END DYNAMIC BLOCK: routingRulesList -->
                <!-- BEGIN DYNAMIC BLOCK: noRoutingRules -->
                [l]None[/l]
                <!-- END DYNAMIC BLOCK: noRoutingRules -->
            </td>
        </tr>
        <tr>
            <td colspan="2" class="formfield">
                <ul class="shadetabs">
                    <li class="selected">
                        <a href="javascript:void(0);" onclick="selectHTMLTab(this, 'value_{templateId}')">
                            [l]HTML[/l]
                        </a>
                    </li>
                    <li class="">
                        <a href="javascript:void(0);" onclick="selectPlainTextTab(this, 'value_{templateId}')">
                            [l]Plain-Text[/l]
                        </a>
                    </li>
                </ul>
                <div id="richTextWrapper_value_{templateId}">
                    <textarea id='value_{templateId}[0]' name='value_{templateId}[0]' style="width:650px; height:250px;">{contentsHTML}</textarea>
                    <script type="text/javascript">showRichTextEditorForAutoresponders({templateId});</script>
                </div>
                <textarea id='value_{templateId}[1]' name='value_{templateId}[1]' style="width:650px; height:250px; display:none;">{contentsPlainText}</textarea>
                <div style="width:650px; text-align:right; padding: 10px">
                    <input type="submit" class="button_medium" value="[l]Save[/l]" />&nbsp;&nbsp;
                    <!-- BEGIN DYNAMIC BLOCK: btnDeleteTemplate -->
                    <input type="button" class="button_medium" value="[l]Delete[/l]" onclick="this.form['delete'].value=1; this.form.submit()" />
                    <!-- END DYNAMIC BLOCK: btnDeleteTemplate -->
                </div>
            </td>
        </tr>
    </table>
</form>
<br /><br />
<!-- END DYNAMIC BLOCK: templateRow -->
{headerAddNewTemplate}
<form method="post" action="index.php?fuse=support&action=SaveAutoresponderTemplates">
    <input type="hidden" name="delete" value="0" />
    <table width="100%">
        <tr>
            <td align="right" class="formlabel" width="1%" nowrap="true" >[l]Template name[/l]:</td>
            <td class="formfield">
                <input type="text" name="templateName" value="" size="40" />
            </td>
        </tr>
        <tr>
            <td align="right" class="formlabel" width="1%" nowrap="true" >[l]E-mail subject[/l]:</td>
            <td class="formfield">
                <input type="text" name="templateSubject" value="" size="40" />
            </td>
        </tr>
        <tr>
            <td colspan="2" class="formfield">
                <ul class="shadetabs">
                    <li class="selected">
                        <a href="javascript:void(0);" onclick="selectHTMLTab(this, 'value_0')">
                            [l]HTML[/l]
                        </a>
                    </li>
                    <li class="">
                        <a href="javascript:void(0);" onclick="selectPlainTextTab(this, 'value_0')">
                            [l]Plain-Text[/l]
                        </a>
                    </li>
                </ul>
                <div id="richTextWrapper_value_0">
                    <textarea id='value_0[0]' name='value_0[0]' style="width:650px; height:250px;"></textarea>
                    <script type="text/javascript">showRichTextEditorForAutoresponders(0);</script>
                </div>
                <textarea id='value_0[1]' name='value_0[1]' style="width:650px; height:250px; display:none;"></textarea>
                <div style="width:650px; text-align:right; padding: 10px">
                    <input type="submit" class="button_medium" value="[l]Save[/l]" />&nbsp;&nbsp;
                </div>
            </td>
        </tr>
    </table>
</form>
