<%@ page language="C#" autoeventwireup="true" inherits="CompanyMaster, App_Web_companymaster.aspx.de3fb1ff" enableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/UserControls/iERPUtilityBar.ascx" TagName="iERPUtilityBar" TagPrefix="dsip" %>
<!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 - 5;
            //window.resizeTo(w, h);
            var 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";
            }

            hideWait();
        }

        function hidedivImg() {
            var cObj = document.getElementById("<%# divImg.ClientID %>");

            document.getElementById("lblImgMsg").innerHTML = "";
            //alert(cObj);
            if (cObj != null) {
                cObj.style.visibility = "visible";
                cObj.style.display = "hidden";
            }
        }
        
        function showdivImg(strFld) {
            var cObj = document.getElementById("<%# divImg.ClientID %>");
            //alert(cObj);
            if (cObj != null) {
                cObj.style.visibility = "visible";
                cObj.style.display = "block";
            } t
            var cObj1 = document.getElementById("<%# txtFileCaption.ClientID %>");
            var cObj2 = document.getElementById("<%# hdnImagePath_1x1.ClientID %>");
            cObj1.value = cObj2.value;

            var cObj3 = document.getElementById("<%# hdnImagePath.ClientID %>");
            cObj3.value = strFld;
            //            hdnImagePath.v
            //            hdnImagePath.v

        }

        function viewdivImg() {
            var cObj1 = document.getElementById("<%# txtFileCaption.ClientID %>");
            if (cObj1.value != "") {
                window.open("../UploadImages/" + cObj1.value)
            }
        }

        function suppresskey() {
            window.event.returnValue = false;
        }

        function CaptionName() {
            var ImgTL = document.getElementById("<%# ImgTL.ClientID %>");
            var txtFileCaption = document.getElementById("<%# txtFileCaption.ClientID %>");
            var hdnAttachFileValue = document.getElementById("<%# hdnAttachFileValue.ClientID %>");
            var hdnAttachPostedFile = document.getElementById("<%# hdnAttachPostedFile.ClientID %>");
            hdnAttachFileValue.value = Trim(ImgTL.value);

            var tmp = hdnAttachFileValue.value;
            var LastIndex = tmp.lastIndexOf("\\");
            hdnAttachPostedFile.value = tmp.substring(LastIndex + 1);

            var fileExt = Trim(ImgTL.value);
            if (fileExt != "") {
                var filename = Split(fileExt, "\\");
                var counter = 0;
                for (x in filename) {
                    counter = counter + 1;
                }
                var name1 = filename[counter - 1];
                //var name2 = Split(name1,".");
                //txtFileCaption.value = name2[0];
                txtFileCaption.value = name1;

            }
            var ext = $('#ImgTL').val().split('.').pop().toLowerCase();
            if ($.inArray(ext, ['jpg', 'jpeg']) == -1) {
                $('#ImgTL').val(''); 
                alert('Invalid File!!! Please Select only .jpg or .jpeg file.');
            }
        }

        function validateRecord() {
            var doc = document.forms[0];
            if (Trim(doc.txtCompanyName.value.trim()) == "") {
                alert("Please Enter Name...");
                document.forms[0].txtCompanyName.focus()
                return false;
            }
            if (Trim(doc.txtDate.value) == "") {
                alert("Please Enter System Implemented Date...");
                document.forms[0].txtDate.focus()
                return false;
            }
            else {
                return true;
            }
        }			
    </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">
                        <dsip:iERPUtilityBar ID="iERPUtilityBar1" runat="server" Caption="Company Master"
                            PageAccess="11111" />
                    </div>
                    <asp:UpdatePanel ID="uplChildBody" runat="server" UpdateMode="Always">
                        <ContentTemplate>
                            <asp:HiddenField ID="hdnRecordKeyId" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnRecordIds" runat="server" Value="" />
                            <asp:HiddenField ID="hdnUserId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBusinessUnitId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBranchId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnAttachFileValue" runat="server" Value="" />
                            <asp:HiddenField ID="hdnAttachPostedFile" runat="server" Value="" />
                            <asp:HiddenField ID="hdnImagePath_1x1" runat="server" Value="" />
                            <asp:HiddenField ID="hdnImagePath_1x8" runat="server" Value="" />
                            <asp:HiddenField ID="hdnImagePath" runat="server" Value="1" />
                            <%--<asp:Panel ID="divChildBody" ScrollBars="Vertical" runat="server" width="100%">--%>
                            <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%">
                                            Name*
                                        </td>
                                        <td width="40%">
                                            <asp:TextBox MaxLength="30" ID="txtCompanyName" runat="server" Width="99%"></asp:TextBox>
                                        </td>
                                        <td width="1%">
                                        </td>
                                        <td width="10%">
                                        </td>
                                        <td width="40%">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%">
                                            Address<br />
                                            <br />
                                            <br />
                                        </td>
                                        <td width="40%">
                                            <asp:TextBox ID="txtAddress" runat="server" Width="99%" Height="40" TextMode="MultiLine"
                                                MaxLength="250" onKeyUp="javascript:CheckTextBoxMaxLength(this, 250);" onChange="javascript:CheckTextBoxMaxLength(this, 250);"></asp:TextBox>
                                        </td>
                                        <td width="1%">
                                        </td>
                                        <td width="10%">
                                        </td>
                                        <td width="40%">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%">
                                            Logo
                                        </td>
                                        <td width="40%">
                                            <asp:Image ID="imgImagePath_1x1" runat="server" ImageUrl="" Height="75px" maxwidth="150px"
                                                BorderStyle="Ridge" BorderWidth="1" />
                                            <br />
                                            <span style="font-weight: bold;" runat="server" id="lblImgMsg"></span>
                                        </td>
                                        <td width="1%">
                                        </td>
                                        <td width="10%">
                                        </td>
                                        <td width="40%">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%">
                                            &nbsp;
                                        </td>
                                        <td width="40%">
                                            <asp:Button ID="btnImageLogo1x1Add" runat="server" Text="Attach" class="submit-bt"
                                                BorderWidth="1px" OnClientClick="showdivImg('1')"></asp:Button>
                                            <asp:Button ID="btnImageLogo1x1Clear" runat="server" Text="Clear" class="submit-bt"
                                                BorderWidth="1px" OnClick="btnImageLogo1x1Clear_Click"></asp:Button>
                                        </td>
                                        <td width="1%">
                                        </td>
                                        <td width="10%">
                                        </td>
                                        <td width="40%">
                                        </td>
                                    </tr>
                                    <asp:Panel ID="Panel1" runat="server" Visible="false">
                                        <tr>
                                            <td width="10%">
                                                System Implemented*
                                            </td>
                                            <td width="40%">
                                                <asp:TextBox ID="txtDate" runat="server" CssClass="dateInput" MaxLength="20" onBlur="GetDateField(this);"
                                                    onFocus="SetDateField(this);" ToolTip="Format : [ddmmyyyy], [d] or [dd], [ddm] or [ddmm], [ ]"
                                                    Width="25%"></asp:TextBox>
                                                <img id="imgCal1" style="cursor: pointer;" runat="server" alt="Click to Show Calendar"
                                                    align="absmiddle" src="../Images/date.gif" />
                                                <asp:CalendarExtender ID="cal1" runat="server" PopupButtonID="imgCal1" TargetControlID="txtDate"
                                                    Format="dd-MMM-yyyy" CssClass="zcCalendar" Enabled="True">
                                                </asp:CalendarExtender>
                                            </td>
                                            <td width="1%">
                                            </td>
                                            <td width="10%">
                                            </td>
                                            <td width="40%">
                                            </td>
                                        </tr>
                                    </asp:Panel>
                                </table>
                            </div>
                            <%--</asp:Panel>--%>
                        </ContentTemplate>
                        <Triggers>
                        </Triggers>
                    </asp:UpdatePanel>
                    <div id="divImg" runat="server" align="center" style="width: 100%; height: 1500px;
                        visibility: hidden; top: 0px; left: 0px; position: absolute; background-color: #333333;
                        padding-left: 10%; text-align: center; vertical-align: middle; filter: alpha(opacity=90);">
                        <%--filter: alpha(opacity=75); opacity: 0.75;--%>
                        <%--<div id="divImg" runat="server" class="LockOff">--%>
                        <br />
                        <br />
                        <asp:Panel ID="pnlImg" runat="server" BorderColor="Silver" BorderStyle="Ridge" BackColor="White"
                            BorderWidth="5" Width="70%" Height="80px">
                            <table class="subtitle" id="Table11" cellspacing="1" cellpadding="1" width="100%"
                                align="center" border="0">
                                <tr>
                                    <td align="left">
                                        <b>&nbsp;Image Upload</b>
                                    </td>
                                    <td align="right">
                                        <asp:ImageButton ID="ImgOk" runat="server" ImageUrl="~/ToolBarIcon/button-ok-icon.png"
                                            Height="24px" Width="54px" ToolTip="Ok" BackColor="Transparent" OnClick="ImgOk_Click" />
                                        <asp:ImageButton ID="ImgClose" runat="server" ImageUrl="~/ToolBarIcon/button-cancel-icon.png"
                                            Height="24px" Width="54px" ToolTip="Cancel" BackColor="Transparent" OnClick="ImgClose_Click" />
                                    </td>
                                </tr>
                            </table>
                            <table class="formbg" id="Table12" cellspacing="1" cellpadding="1" width="99%" align="left"
                                border="0">
                                <tr align="left">
                                    <td width="15%">
                                        &nbsp;Select File
                                    </td>
                                    <td width="85%">
                                        <input id="CTId" style="width: 17px" type="hidden" value="0" name="CTId" runat="server" />
                                        <input id="TType" style="width: 15px" type="hidden" value="a" name="TType" runat="server" />
                                        <input onkeypress="suppresskey();" onchange="CaptionName();" id="ImgTL" style="width: 90%;
                                            border-top-style: groove; border-right-style: groove; border-left-style: groove;
                                            height: 20px; border-bottom-style: groove" type="file" size="80" name="fileUpload"
                                            runat="server" accept="image/jpeg" />
                                    </td>
                                </tr>
                                <tr align="left">
                                    <td width="15%">
                                        &nbsp;File Caption
                                    </td>
                                    <td width="85%">
                                        <asp:TextBox ID="txtFileCaption" runat="server" Width="80%" MaxLength="95"></asp:TextBox>
                                        <%--<a target="_blank" onclick="viewdivImg();" style="cursor: pointer;">View File</a>--%>
                                    </td>
                                </tr>
                                <%--<tr align="left">
                                    <td width="15%">
                                    </td>
                                    <td width="85%">
                                        <asp:CheckBox ID="cbxExist" runat="server" Text="Overwright Existing File" Checked="false" />
                                    </td>
                                </tr>--%>
                            </table>
                        </asp:Panel>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
