<%@ page language="C#" autoeventwireup="true" inherits="EmailSMSSetup, App_Web_emailsmssetup.aspx.dbcc866c" enableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/UserControls/iERPToolBar.ascx" TagName="iERPToolBar" TagPrefix="dsit" %>
<%@ Register TagPrefix="HtmlColor" Namespace="UNLV.IAP.WebControls" Assembly="UNLV.IAP.WebControls.HtmlColorDropDown" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head id="Head1" runat="server">
    <title>..:: ICDAS 2.1 ::..</title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />

    <script type="text/javascript" language="javascript" src="../App_Include/JavaScript/js_functions.js"> </script>
    
    <script type="text/javascript" language="javascript" src="../App_Include/JavaScript/ScreenSaverStar.js"> </script>

    <script type="text/javascript" language="javascript">

        function resizeObject() {
            var w = getBrowserWindowSize().width;
            var h = getBrowserWindowSize().height - 10;
            //window.resizeTo(w, h);
            var cObj;
            cObj = document.getElementById("divChildBody");
            if (cObj != null) {
                //cObj.style.height = parseInt((h*79)/100) +"px";
                cObj.style.height = (parseInt(h) - 10) + "px";
                //cObj.style.width = parseInt(w) +"px";
            }

            cObj = document.getElementById("tabInstrument");
            if (cObj != null) {
                cObj.style.height = (parseInt(h) - 160) + "px";
            }
            cObj = document.getElementById("<%#tabInstrumentList.ClientID%>");
            if (cObj != null) {
                cObj.style.height = (parseInt(h) - 180) + "px";
            }
            cObj = document.getElementById("<%#pnlContainer.ClientID%>");
            if (cObj != null) {
                cObj.style.height = (parseInt(h) - 180) + "px";
            }


            cObj = document.getElementById("<%#PnlEmailStatus.ClientID%>");
            if (cObj != null) {

                cObj.style.height = (parseInt(h) - 220) + "px";
            }
            cObj = document.getElementById("<%#PnlSMSStatus.ClientID%>");
            if (cObj != null) {
                cObj.style.height = (parseInt(h) - 220) + "px";
            }
            hideWait();
        }


        function validateRecord() {
            var doc = document.forms[0];
            re = /[0-9]/;
            re1 = /[a-zA-Z]/;
            return true;
        }

        function maskParameterLimit(obj, objType) {
            var obj1
            var obj2
            if (objType == 1) {
                obj1 = Replace(obj.id, "txtParameterLowerLimit", "cmbParameterResolution");
                obj2 = Replace(obj.id, "txtParameterLowerLimit", "txtParameterUpperLimit");
            }
            else {
                obj1 = Replace(obj.id, "txtParameterUpperLimit", "cmbParameterResolution");
                obj2 = Replace(obj.id, "txtParameterUpperLimit", "txtParameterLowerLimit");
            }
            var cObj = document.getElementById(obj1);
            var tObj = document.getElementById(obj2);

            var tVal;
            tVal = tObj.value;
            if (cObj != null) {
                jm_currencymask(obj, cObj.selectedIndex);
            }

            var minVal;
            var maxVal;

            if (cObj.selectedIndex == 0) {
                minVal = "-999";
                maxVal = "999";
            }
            else if (cObj.selectedIndex == 1) {
                minVal = "-999.9";
                maxVal = "999.9";
            }

            else if (cObj.selectedIndex == 2) {
                minVal = "-999.99";
                maxVal = "999.99";
            }
            else if (cObj.selectedIndex == 3) {
                minVal = "-999.999";
                maxVal = "999.999";
            }
            if (parseFloat(obj.value) < parseFloat(minVal)) {
                alert("Please Enter Value > " + minVal);
                obj.value = "";
                obj.focus();
            }

            if (parseFloat(obj.value) > parseFloat(maxVal)) {
                alert("Please Enter Value < " + maxVal);
                obj.value = "";
                obj.focus();
            }
        }
       			
    </script>

    <script type="text/javascript">

        var selectedClientPermissions = [];

        //Because I'm working with a databound listbox, I grab the selected values
        //on page load & put them in the array.


        function ListBoxClient_SelectionChanged(sender, args) {
            var scrollPosition = sender.scrollTop;

            for (var i = 0; i < sender.length; i++) {
                //if this is the one clicked by the user, toggle it's state
                if (sender.options[i].selected) selectedClientPermissions[i] = !selectedClientPermissions[i];

                //Assign saved selections from array
                sender.options[i].selected = selectedClientPermissions[i] === true;
            }

            sender.scrollTop = scrollPosition;
        }
       
    </script>

</head>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0" onload="resizeObject(); resizeHolder(); init(); initScreenSaver('1',<%=Session["AutoLogOutTime"]%>);">
    <form id="Form1" runat="server" class="formbg">
    <asp:ToolkitScriptManager runat="Server" EnablePartialRendering="true" AsyncPostBackTimeout="0"
        ID="ToolkitScriptManager1" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="left" class="formbg">
        <tr>
            <td valign="top" align="left">
                <div id="divMainBody" align="center" runat="server" width="100%" height="100%">
                    <div id="divHeader" runat="server" style="border-style: none; height: 26px; width: 100%;
                        position: absolute; left: 1px; top: 8px;" align="center">
                        <dsit:iERPToolBar ID="iERPToolBar1" runat="server" Caption="Branch Master" PageAccess="11111"
                            ValidateLogin="true" />
                    </div>
                    <asp:UpdatePanel ID="uplChildBody" runat="server" UpdateMode="Always">
                        <ContentTemplate>
                            <asp:HiddenField ID="hdnRecordKeyId" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnRecordIds" runat="server" />
                            <asp:HiddenField ID="hdnUserId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBusinessUnitId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBranchId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnEquipmentId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnEquipmentType" runat="server" Value="" />
                            <asp:HiddenField ID="hdnstatus" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnLoginComments" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnRecordKeys" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnRecordRows" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnEquipmentMasterParameterId" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnEquipmentMasterId" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnParameterName" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnParameterUnit" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnParameterResolution" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnParameterColor" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnParameterColorCode" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnParameterLowerLimit" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnParameterUpperLimit" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnEquipmentMasterParameterNo" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnParameterAxis" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnParameterAlert" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnTempratureParameterValue" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnHumidityParameterValue" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnLUXParameterValue" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnUVParameterValue" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnBranchMasterEmailSyatem" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnBranchMasterSMSSystem" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnApplicationSetupEmailSystem" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnApplicationSetupSMSSystem" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnEmailSelectedItem" runat="server" Value="" />
                            <div id="divChildBody" runat="server" style="overflow: auto; width: 99%;">
                                <table width="100%" align="left" cellpadding="1" cellspacing="0" class="tablefont">
                                    <tr height="62px">
                                        <td colspan="5">
                                            &nbsp
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%">
                                            Equipment Name*
                                        </td>
                                        <td width="40%">
                                            <asp:TextBox ID="txtEquipmentName" runat="server" Width="70%" MaxLength="50" ReadOnly="true"></asp:TextBox>
                                        </td>
                                        <td width="1%">
                                        </td>
                                        <td width="9%">
                                            Status
                                        </td>
                                        <td width="40%">
                                            <asp:TextBox ID="txtStatus" runat="server" Width="30%" MaxLength="50" ReadOnly="true"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%">
                                        </td>
                                        <td width="40%">
                                         <asp:CheckBox ID="CheckBox1" runat="server" Text="Apply to all Similar Equipments" Visible="false" />
                                        </td>
                                        <td width="1%">
                                        </td>
                                        <td width="9%">
                                        </td>
                                        <td width="40%">
                                        </td>
                                    </tr>
                                   <tr>
                                        <td width="10%">
                                        &nbsp;
                                        </td>
                                        <td width="40%">
                                         &nbsp;
                                        </td>
                                        <td width="1%">
                                        &nbsp;
                                        </td>
                                        <td width="9%">
                                        &nbsp;
                                        </td>
                                        <td width="40%">
                                        &nbsp;
                                        </td>
                                    </tr>
                                   
                                   
                                </table>
                                <asp:Panel ID="pnlWait" runat="server" Visible="false">
                                    <table width="98%">
                                        <tr>
                                            <td align="center">
                                                <img id="ImgWait" runat="Server" src="~/Images/AnimatedProgressBar.gif" alt="" align="absmiddle" />
                                                Please Wait...
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                                <table width="100%" align="left" cellpadding="1" cellspacing="0" class="tablefont">
                                    <tr>
                                        <td>
                                            <asp:TabContainer ID="tabInstrument" runat="server" ActiveTabIndex="0" ScrollBars="Auto"
                                                CssClass="tabCont">
                                                <asp:TabPanel ID="tabInstrumentList" runat="server" TabIndex="1">
                                                    <HeaderTemplate>
                                                        Email / SMS Alarm Alert
                                                    </HeaderTemplate>
                                                    <ContentTemplate>
                                                        <asp:Panel runat="server" ID="pnlContainer" Width="100%" ScrollBars="Auto" 
                                                            Height="600px">
                                                            <table width="100%">
                                                                <tr>
                                                                    <td width="50%">
                                                                        &nbsp;<asp:CheckBox ID="ChkEmailAll" runat="server" 
                                                                            Text="" oncheckedchanged="ChkEmailAll_CheckedChanged" 
                                                                            AutoPostBack="True" />&nbsp;<b>Active Email Alert for Alarm</b>
                                                                    </td>
                                                                    <td width="50%">
                                                                       &nbsp;<asp:CheckBox ID="ChkSMSAll" runat="server" 
                                                                            Text="" oncheckedchanged="ChkSMSAll_CheckedChanged"  
                                                                            AutoPostBack="True"/>&nbsp;<b>Active SMS Alert for Alarm</b>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td width="50%">
                                                                    </td>
                                                                    <td width="50%">
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td width="50%">
                                                                        <asp:Panel ID="PnlEmailStatus" runat="server" BorderWidth="1px" 
                                                                            ScrollBars="Vertical">
                                                                            <asp:CheckBoxList ID="ChkEmailStatus" CssClass="tablefont" runat="server" 
                                                                                Height="250px" >
                                                                            </asp:CheckBoxList>
                                                                        </asp:Panel>
                                                                    </td>
                                                                    <td width="50%">
                                                                        <asp:Panel ID="PnlSMSStatus" runat="server" BorderWidth="1px" 
                                                                            ScrollBars="Vertical">
                                                                            <asp:CheckBoxList ID="ChkSMSStatus" runat="server" CssClass="tablefont"  
                                                                                Height="250px">
                                                                            </asp:CheckBoxList>
                                                                        </asp:Panel>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </asp:Panel>
                                                    </ContentTemplate>
                                                </asp:TabPanel>
                                            </asp:TabContainer>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </ContentTemplate>
                        <Triggers>
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
