<%@ page language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" validaterequest="false" inherits="System_EmailTemplates, MachSol.MachPanel.Web" %>

<%@ Register Assembly="obout_Editor" Namespace="OboutInc.Editor" TagPrefix="obout" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>

<%@ Register Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="System.Web.UI" TagPrefix="cc1" %>
<asp:Content ID="Content7" ContentPlaceHolderID="CPH_Content" runat="Server">


    <script type="text/javascript">
        function EditorOnLoad(editor) {
            if (HTMLEditor.is_ie) {
                // If '_editorEvent' is not redefined yet - do it
                if (typeof editor.___editorEvent__ != "function") {
                    editor.___editorEvent__ = editor._editorEvent;
                    editor._editorEvent = function (ev) {
                        var editor = this;
                        setTimeout(function () {
                            editor.savedRange = editor._doc.selection.createRange();
                        }, 0);
                        // call the saved '_editorEvent' method
                        return this.___editorEvent__(ev);
                    }
                }
                // If 'insertHTML' is not redefined yet - do it
                if (typeof editor.__insertHTML__ != "function") {
                    editor.__insertHTML__ = editor.insertHTML;
                    editor.insertHTML = function (html, range) {
                        if (this.savedRange != null && typeof this.savedRange != "undefined") {
                            this.savedRange.select();
                        }
                        var editor = this;
                        setTimeout(function () {
                            editor.savedRange = editor._doc.selection.createRange();
                        }, 0);
                        // call the saved 'insertHTML' method
                        return this.__insertHTML__(html, range);
                    };
                }
            }
        }
    </script>
    <div class="col-xs-12">
        <div class="card">
            <div class="body">
                <EM:TabContainer ID="TbCntr_EmailGroups" runat="server" OnClientActiveTabChanged="loadTabPanel" ActiveTabIndex="0">
                    <EM:TabPanel ID="Tab_EmailGroups" runat="server" HeaderText="<%$ Resources:Content,DGN1110137%>">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab0" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent0" runat="server">
                                <div class="row Div_OpsRow" id="Tbl_Operations" runat="server">
                                    <div class="col-xs-12">
                                        <div class="card">
                                            <div class="header">
                                                <h3><%= Resources.Content.GN00001320%>  </h3>
                                            </div>
                                            <div class="body">

                                                <asp:Button CssClass="btn btn-primary btnAction" class="btn btn-primary waves-effect" ID="Btn_UnKillAllTemplatesOFCompany" runat="server" Text="<%$ Resources:Content,String572%>" />
                                                <asp:Button CssClass="btn btn-primary btnAction" SkinID="cancelButton" ID="Btn_KillAllTemplatesOFCompany" runat="server" Text="<%$ Resources:Content,String567%>" />
                                                <EM:ConfirmButtonExtender ID="CBE_Remove" ConfirmText="<%$ Resources:Content,CBE002%>"
                                                    TargetControlID="Btn_KillAllTemplatesOFCompany" runat="server">
                                                </EM:ConfirmButtonExtender>
                                                
                                                <br />
                                                <asp:Button CssClass="btn btn-primary waves-effect btnAction" ID="Btn_UnKillAllTemplatesOFAllCompanies" runat="server" Text="<%$ Resources:Content,String573%>" />
                                                <asp:Button CssClass="btn btn-primary btnAction" SkinID="cancelButton" ID="Btn_KillAllTemplatesOFAllCompanies" runat="server" Text="<%$ Resources:Content,String568%>" />
                                                <EM:ConfirmButtonExtender ID="ConfirmButtonExtender1" ConfirmText="<%$ Resources:Content,CBE003%>"
                                                    TargetControlID="Btn_KillAllTemplatesOFAllCompanies" runat="server">
                                                </EM:ConfirmButtonExtender>
                                            </div>
                                        </div>
                                    </div>
                                </div>



                                <asp:Repeater ID="Rep_EmailGroups" runat="server">
                                    <ItemTemplate>
                                        <div class="row">
                                            <div class="col-xs-12">
                                                <div class="card">
                                                    <div class="header">
                                                        <h3>
                                                            <div id="Td_EmailGroupName" runat="server"></div>
                                                        </h3>
                                                    </div>
                                                    <div class="body">
                                                        <asp:HiddenField ID="HF_EmailGroupId" runat="server" />

                                                        <div class="row">
                                                            <div class="col-xs-6">
                                                                <div class="row">
                                                                    <div class="col-sm-6 col-xs-12 row-label">
                                                                        <asp:Literal ID="Div10" runat="server" Text='<%$ Resources:Content,GN00001245 %>' />:
                                                                    </div>
                                                                    <div class="col-sm-6 col-xs-12">
                                                                        <div class="form-group">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_FromName" Text='<%#DataBinder.Eval(Container, "DataItem.FromName")%>'
                                                                                    runat="server"></asp:TextBox>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="row">
                                                                    <div class="col-sm-6 col-xs-12 row-label">
                                                                        <asp:Literal ID="Div2" runat="server" Text='<%$ Resources:Content,GN0000417 %>' />:
                                                                    </div>
                                                                    <div class="col-sm-6 col-xs-12">
                                                                        <div class="form-group">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_FromAddress" Text='<%#DataBinder.Eval(Container, "DataItem.FromEmail")%>'
                                                                                    runat="server"></asp:TextBox>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="row">
                                                                    <div class="col-sm-6 col-xs-12 row-label">
                                                                        <asp:Literal ID="Div4" runat="server" Text='<%$ Resources:Content,GN00001248 %>' />:
                                                                    </div>
                                                                    <div class="col-sm-6 col-xs-12">
                                                                        <div class="form-group">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_CCAddress" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.CC")%>'></asp:TextBox>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-xs-6">
                                                                <div class="row">
                                                                    <div class="col-sm-6 col-xs-12 row-label">
                                                                        <asp:Literal ID="Div1" runat="server" Text='<%$ Resources:Content,GN00001246 %>' />:
                                                                    </div>
                                                                    <div class="col-sm-6 col-xs-12">
                                                                        <div class="form-group">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_ReplyToName" Text='<%#DataBinder.Eval(Container, "DataItem.ReplyToName")%>'
                                                                                    runat="server"></asp:TextBox>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="row">
                                                                    <div class="col-sm-6 col-xs-12 row-label">
                                                                        <asp:Literal ID="Div3" runat="server" Text='<%$ Resources:Content,GN00001247 %>' />:
                                                                    </div>
                                                                    <div class="col-sm-6 col-xs-12">
                                                                        <div class="form-group">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_ReplyToAddress" Text='<%#DataBinder.Eval(Container, "DataItem.ReplyToEmail")%>'
                                                                                    runat="server"></asp:TextBox>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="row">
                                                                    <div class="col-sm-6 col-xs-12 row-label">
                                                                        <asp:Literal ID="Div5" runat="server" Text='<%$ Resources:Content,GN00001249 %>' />:
                                                                    </div>
                                                                    <div class="col-sm-6 col-xs-12">
                                                                        <div class="form-group">
                                                                            <div class="form-line">
                                                                                <asp:TextBox ID="TxBx_BCCAddress" Text='<%#DataBinder.Eval(Container, "DataItem.BCC")%>'
                                                                                    runat="server"></asp:TextBox>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal5" runat="server" Text='<%$ Resources:Content,ApplyDontSendToCustomerSetting %>' />
                                                            </div>
                                                            <div class="col-sm-3 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:RadioButton ID="ChBx_NoChange" runat="server" Text='<%$ Resources:Content,GN0000712%>' GroupName="DNSTC" Checked="true" />
                                                                    <asp:RadioButton ID="ChBx_Enabled" runat="server" Text='<%$ Resources:Content,GN00001024%>' GroupName="DNSTC" />
                                                                    <asp:RadioButton ID="ChBx_Disabled" runat="server" Text='<%$ Resources:Content,GN00001025%>' GroupName="DNSTC" />
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <%--Start email templates repeater--%>
                                                        <asp:Repeater ID="Rep_EmailTemplates" runat="server">
                                                            <ItemTemplate>
                                                                <div class="row">
                                                                    <div class="col-sm-6 col-xs-12">
                                                                        <label><%#DataBinder.Eval(Container, "DataItem.TemplateName")%></label>
                                                                    </div>
                                                                    <div class="col-sm-6 col-xs-12">
                                                                        <%-- <asp:LinkButton CssClass="btn btn-primary" SkinID="linkButtonEdit" ID="LB_Edit" runat="server" Text='<%$ Resources:Content,DGN1110138 %>' />--%>
                                                                        <a class="btn btn-primary" href='EmailTemplates.aspx?t=<%#DataBinder.Eval(Container, "DataItem.CloneId")%>'>
                                                                            <asp:Literal ID="Link" runat="server" Text='<%$ Resources:Content,DGN1110138 %>'></asp:Literal>
                                                                        </a>
                                                                    </div>
                                                                </div>
                                                            </ItemTemplate>
                                                            <AlternatingItemTemplate>
                                                                <div class="row">
                                                                    <div class="col-sm-6 col-xs-12">
                                                                        <label><%#DataBinder.Eval(Container, "DataItem.TemplateName")%></label>
                                                                    </div>
                                                                    <div class="col-sm-6 col-xs-12">
                                                                        <a class="btn btn-primary" href='EmailTemplates.aspx?t=<%#DataBinder.Eval(Container, "DataItem.CloneId")%>'>
                                                                            <asp:Literal ID="Link" runat="server" Text='<%$ Resources:Content,DGN1110138 %>'></asp:Literal>
                                                                        </a>
                                                                    </div>
                                                                </div>
                                                            </AlternatingItemTemplate>
                                                        </asp:Repeater>
                                                        <%--End email templates repeater--%>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </ItemTemplate>
                                </asp:Repeater>

                                <div class="row">
                                    <div class="col-xs-12">
                                        <asp:Button CssClass="btn btn-primary btnAction" ID="Btn_SaveTemplates" SkinID="saveButton" CommandArgument='<%#DataBinder.Eval(Container, "DataItem.EmailGroupId")%>'
                                            CommandName="Save" runat="server" Text='<%$ Resources:Content,GN0000281 %>' />
                                    </div>
                                </div>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>

                    <EM:TabPanel ID="Tab_Edit" runat="server" Enabled="False" HeaderText="<%$ Resources:Content,DGN1110138%>">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab1" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent1" runat="server" Visible="false">
                                <ajax:UpdatePanel ID="UPD" runat="server">
                                    <ContentTemplate>
                                        <div class="row">
                                            <div class="col-xs-12">
                                                <div class="card">
                                                    <div class="header">
                                                        <h3><%= Resources.Content.TemplateGroup%>  </h3>
                                                    </div>
                                                    <div class="body">
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal2" runat="server" Text='<%$ Resources:Content,GN00001261 %>' />
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="DDL_EmailGroups" runat="server" AutoPostBack="true" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-3 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal3" runat="server" Text='<%$ Resources:Content,GN00001262 %>' />
                                                            </div>
                                                            <div class="col-sm-4 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="DDL_EmailTemplates" runat="server" AutoPostBack="true" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12">
                                                                <asp:Button CssClass="btn btn-primary btnAction" ID="Btn_LoadDefault" class="btn btn-primary waves-effect" runat="server"
                                                                    Text='<%$ Resources:Content,GN00001273 %>' />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-8 col-xs-12">
                                                <div class="card">
                                                    <div class="body">
                                                        <div class="row">
                                                            <div class="col-sm-4 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Content,GN00001263%>" />
                                                            </div>
                                                            <div class="col-sm-8 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_TemplateName" runat="server"></asp:TextBox>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <div class="row">
                                                            <div class="col-sm-4 col-xs-12 row-label">
                                                                <asp:Literal ID="Div3" runat="server" Text='<%$ Resources:Content,GN00001264 %>' />
                                                            </div>
                                                            <div class="col-sm-8 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="DDL_Locale" runat="server" AutoPostBack="true" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-4 col-xs-12 row-label">
                                                                <asp:Literal ID="Div4" runat="server" Text='<%$ Resources:Content,GN00001265 %>' />
                                                            </div>
                                                            <div class="col-sm-8 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:DropDownList ID="DDl_Priority" runat="server">
                                                                        <asp:ListItem Text='<%$ Resources:Content,GN00001270 %>' Value="1"></asp:ListItem>
                                                                        <asp:ListItem Text='<%$ Resources:Content,GN00001271 %>' Value="2"></asp:ListItem>
                                                                        <asp:ListItem Text='<%$ Resources:Content,GN00001272 %>' Value="3"></asp:ListItem>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-4 col-xs-12 row-label">
                                                                <asp:Literal ID="Div5" runat="server" Text='<%$ Resources:Content,GN0000371 %>' />
                                                            </div>
                                                            <div class="col-sm-8 col-xs-12">
                                                                <div class="form-group">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_Subject" runat="server"></asp:TextBox>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12">
                                                                <obout:Editor ID="Editor1" Submit="false" ShowWaitMessage="false" AjaxWait="false" runat="server" Appearance="custom">
                                                                    <Buttons>
                                                                        <obout:Select Name="FontName" />
                                                                        <obout:Select Name="FontSize" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Toggle Name="Bold" />
                                                                        <obout:Toggle Name="Italic" />
                                                                        <obout:Toggle Name="Underline" />
                                                                        <obout:Toggle Name="StrikeThrough" />
                                                                        <obout:Toggle Name="SuperScript" />
                                                                        <obout:Toggle Name="SubScript" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="ForeColor" />
                                                                        <obout:Method Name="ForeColorClear" />
                                                                        <obout:Method Name="BackColor" />
                                                                        <obout:Method Name="BackColorClear" />
                                                                        <obout:VerticalSeparator />
                                                                        <obout:Method Name="Redo" />
                                                                        <obout:Method Name="Undo" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="Cut" />
                                                                        <obout:Method Name="Copy" />
                                                                        <obout:Method Name="Paste" />
                                                                        <obout:Method Name="PasteText" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="Paragraph" />
                                                                        <obout:Method Name="GetFormat" />
                                                                        <obout:Method Name="ApplyFormat" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="JustifyLeft" />
                                                                        <obout:Method Name="JustifyCenter" />
                                                                        <obout:Method Name="JustifyRight" />
                                                                        <obout:Method Name="JustifyFull" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="OrderedList" />
                                                                        <obout:Method Name="BulletedList" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="InsertHR" />
                                                                        <obout:Method Name="CreateLink" />
                                                                        <obout:Method Name="InsertAnchor" />
                                                                        <obout:Method Name="InsertIMG" />
                                                                        <obout:HorizontalSeparator />
                                                                        <obout:Method Name="ClearStyles" />
                                                                    </Buttons>

                                                                </obout:Editor>
                                                                <%-- <EM:FreeTextBox ID="FTB_EmailBody" runat="server" BreakMode="LineBreak" ButtonSet="OfficeMac"
                                                        EnableHtmlMode="True" RenderMode="Rich" PasteMode="Default" ToolbarLayout="Bold,Italic,Underline,FontForeColorsMenu,FontBackColorsMenu,Strikethrough;Superscript,Subscript,RemoveFormat|Cut,Copy,Paste;Undo,Redo"
                                                        >
                                                    </EM:FreeTextBox>--%>
                                                            </div>
                                                        </div>
                                                        <br />
                                                        <div class="row">
                                                            <div class="form-group">
                                                                <div class="col-sm-4 col-xs-12">
                                                                    <asp:DropDownList ID="DDL_CompanyVariablesHtml" runat="server" />
                                                                </div>
                                                                <div class="col-sm-4 col-xs-12">
                                                                    <asp:DropDownList ID="DDL_CustomerVariablesHtml" runat="server" />
                                                                </div>
                                                                <div class="col-sm-4 col-xs-12">
                                                                    <asp:DropDownList ID="DDL_GroupVariablesHtml" runat="server" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <br />
                                                        <div class="row">
                                                            <div class="col-sm-6 col-xs-12 row-label">
                                                                <asp:Literal ID="Div9" runat="server" Text='<%$ Resources:Content,DisableEmail %>' />
                                                            </div>
                                                            <div class="col-sm-6 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:CheckBox ID="CB_KillTemplate" runat="server" Text="<%$ Resources:Content,SMI738%>" />
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <div class="row">
                                                            <div class="col-sm-6 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal8" runat="server" Text='<%$ Resources:Content,DisableEnableAllTemplatesGroup %>' />
                                                            </div>
                                                            <div class="col-sm-6 col-xs-12">
                                                                <div class="form-group">
                                                                    <%--<asp:CheckBox ID="CB_KillAllTemplatesOfGroup" runat="server" Text="<%$ Resources:Content,SMI738%>" />--%>
                                                                    <asp:DropDownList ID="DDL_KillAllTemplatesOfGroup" runat="server">
                                                                        <asp:ListItem Text="<%$ Resources:Content,GN0000380 %>" Value="-1" />
                                                                        <asp:ListItem Text="<%$ Resources:Content,EnableAllTemplatesOfGroup%>" Value="0" />
                                                                        <asp:ListItem Text="<%$ Resources:Content,DisableAllTemplatesOfGroup%>" Value="1" />
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-6 col-xs-12 row-label">
                                                                <asp:Literal ID="Literal4" runat="server" Text='<%$ Resources:Content,GN00001569 %>' />
                                                            </div>
                                                            <div class="col-sm-6 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:CheckBox ID="CB_IsDefault" runat="server" Text='<%$ Resources:Content,MarkSelectedLocale %>' />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row" id="TR_Delete" runat="server" style="display: none;">
                                                            <div class="col-sm-6 col-xs-12 row-label">

                                                                <asp:Literal ID="Literal6" runat="server" Text='<%$ Resources:Content,SMI009 %>' />
                                                            </div>
                                                            <div class="col-sm-6 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:CheckBox ID="CB_Delete" runat="server" Text='<%$ Resources:Content,DeleteSelectedLocale %>' />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-sm-6 col-xs-12 row-label">

                                                                <asp:Literal ID="Literal5" runat="server" Text='<%$ Resources:Content,doNotSendToCustomer %>' />
                                                            </div>
                                                            <div class="col-sm-6 col-xs-12">
                                                                <div class="form-group">
                                                                    <asp:CheckBox ID="ChBx_doNotSendToCustomer" runat="server" Text='&nbsp;' />
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="row">
                                                            <div class="col-xs-12">
                                                                <asp:Button CssClass="btn btn-primary btnAction" ID="Btn_Save" SkinID="saveButton" runat="server" Text='<%$ Resources:Content,GN0000281 %>' />
                                                                <asp:Button CssClass="btn btn-primary" ID="btn_Cancel" SkinID="cancelButton" runat="server" Text='<%$ Resources:Content,GN0000572 %>' />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <div class="card">
                                                    <div class="header">
                                                        <h3><%= Resources.Content.GN00001269%>  </h3>
                                                    </div>
                                                    <div class="body">
                                                        <div id="Div_EmailGroupKeysInfo" runat="server" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </ContentTemplate>
                                    <Triggers>
                                        <ajax:PostBackTrigger ControlID="btn_Cancel" />
                                    </Triggers>
                                </ajax:UpdatePanel>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>
                </EM:TabContainer>
            </div>
        </div>
    </div>
</asp:Content>
