<%@ Page EnableEventValidation="false" Language="C#" MasterPageFile="~/CITAD.Master"
    AutoEventWireup="true" Codebehind="frmDetailOrg.aspx.cs" Inherits="CITAD.Modules.TaoLenhChuyenTien.Web.frmDetailOrg"
    Title="Nhập dữ liệu lệnh chuyển tiền" Culture="auto" meta:resourcekey="PageResource1"
    UICulture="auto" %>

<%@ Register Src="../../Controls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script language="javascript" type="text/javascript">
        //Cài đặt sự kiện phím tắt
        window.document.onkeyup=ShortcutKeys;
        function ShortcutKeys()
        {
            if(event.ctrlKey)
            {
                switch (event.keyCode)
                {
                    case 49://Ctrl + 1
                        $get('ctl00$ContentPlaceHolder1$btnNew').click();
                        break;
                    case 83://Ctrl + S
                        $get('ctl00$ContentPlaceHolder1$btnSave').click();
                        break;
                    case 51://Ctrl + 3
                        $get('ctl00$ContentPlaceHolder1$btnDelete').click();
                        break;
                    case 37://Ctrl + <-
                        $get('ctl00$ContentPlaceHolder1$btnPrevios').click();
                        break;
                    case 39://Ctrl + ->
                        $get('ctl00$ContentPlaceHolder1$btnNext').click();
                        break;
                    case 69://Ctrl + E
                        $get('ctl00$ContentPlaceHolder1$btnClose').click();
                        break;
               } 
            }
        }
    </script>

    <ajaxToolkit:ToolkitScriptManager runat="server" ID="ScriptManager1" EnableScriptGlobalization="True"
        EnableScriptLocalization="True" CombineScripts="True" EnablePageMethods="True" />
    <asp:UpdatePanel ID="UpdatePanel5" runat="server">
        <ContentTemplate>
            <div style="width: 770px;" id="divMain">
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td rowspan="2" style="width: 683px">
                            <fieldset style="margin-top: 2px;">
                                <table cellpadding="0" cellspacing="1">
                                    <tr>
                                    <td style="width: 106px" ></td>
                                        <td colspan="3">
                                             
                                            <asp:CheckBox runat="server" ID="chkInterbankMarket" Checked="false"  OnCheckedChanged="chkInterbankMarket_CheckedChanged"  AutoPostBack="true"
                                              Text="Giao dịch trên thị trường LNH" ForeColor="blue" meta:resourcekey="chkInterbankMarket_chkResource1" />
                                        </td>
                                       
                                    </tr>
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblRelation_No" runat="server" Text="Số b&#250;t to&#225;n" meta:resourcekey="lblRelation_NoResource1"></asp:Label></td>
                                        <td style="width: 213px">
                                            <asp:TextBox ID="txtRelation_No" runat="server" onchange="onTxtRelation_change(this);"
                                                onfocus="SetEnd(this)" onkeyup="onTxtRelationNo_KeyUp(this);" onpropertychange="Upper()"
                                                CssClass="citad-txt" Width="195px" MaxLength="40" AutoPostBack="True" OnTextChanged="txtRelation_No_TextChanged"
                                                meta:resourcekey="txtRelation_NoResource1" TabIndex="1"></asp:TextBox>
                                            <asp:Label ID="Label1" runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label1Resource1"></asp:Label>
                                        </td>
                                        <td align="right" style="width: 108px">
                                            &nbsp;<asp:Label ID="lblServ_Code" runat="server" Text="Loại giao dịch" meta:resourcekey="lblServ_CodeResource1"></asp:Label>&nbsp;</td>
                                        <td>
                                            <asp:DropDownList ID="cboServ_Code" runat="server" OnSelectedIndexChanged="cboServ_Code_SelectedIndexChanged" AutoPostBack="true"  Width="235px" meta:resourcekey="cboServ_CodeResource1"
                                                TabIndex="2">
                                            </asp:DropDownList><asp:Label ID="Label2" runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label2Resource1"></asp:Label></td>
                                    </tr>
                                </table>
                                <table cellpadding="0" cellspacing="1">
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblO_CI_ID" runat="server" Text="Ng&#226;n h&#224;ng gửi" meta:resourcekey="lblO_CI_IDResource1"></asp:Label></td>
                                        <td colspan="2">
                                            <table cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td>
                                                        <asp:TextBox ID="txtOCI_Code" runat="server" CssClass="citad-txt citad-txtReadonly"
                                                            Width="85px" ReadOnly="True" MaxLength="12" meta:resourcekey="txtOCI_CodeResource1"
                                                            TabIndex="-1" Text="000000000000"></asp:TextBox>
                                                    </td>
                                                    <td style="padding-left: 4px;">
                                                        <asp:Label ID="lblOCI_Name" runat="server" ForeColor="#0046D5" meta:resourcekey="lblOCI_NameResource1"></asp:Label>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td style="width: 67px">
                                            <asp:Label ID="lblDate" runat="server" Text="Ng&#224;y lệnh" meta:resourcekey="lblDateResource1"></asp:Label></td>
                                        <td>
                                            <asp:TextBox ID="txtDate" runat="server" CssClass="citad-txt citad-txtReadonly" Width="68px"
                                                ReadOnly="True" meta:resourcekey="txtDateResource1" TabIndex="-1"></asp:TextBox><asp:TextBox
                                                    ID="txtTime" runat="server" CssClass="citad-txt citad-txtReadonly" Width="68px"
                                                    Style="margin-left: 2px" ReadOnly="True" meta:resourcekey="txtTimeResource1"
                                                    TabIndex="-1"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblRCI_ID" runat="server" Text="Ng&#226;n h&#224;ng nhận" meta:resourcekey="lblRCI_IDResource1"></asp:Label></td>
                                        <td colspan="2">
                                            <table cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td>
                                                        <asp:TextBox ID="txtRCI_Code" runat="server" CssClass="citad-txt txtPopup" Width="85px"
                                                            MaxLength="12" meta:resourcekey="txtRCI_CodeResource1" TabIndex="3"></asp:TextBox><asp:Label
                                                                ID="Label3" runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label3Resource1"></asp:Label>
                                                    </td>
                                                    <td style="padding-left: 4px;">
                                                        <asp:Label ID="lblRCI_Name" runat="server" ForeColor="#0046D5" meta:resourcekey="lblRCI_NameResource1"></asp:Label></td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td style="width: 67px">
                                            <asp:Label ID="lblUser_ID" runat="server" Text="TELLER ID" meta:resourcekey="lblUser_IDResource1"></asp:Label></td>
                                        <td>
                                            <asp:TextBox ID="txtUser_ID" runat="server" CssClass="citad-txt citad-txtReadonly"
                                                Width="143px" ReadOnly="True" meta:resourcekey="txtUser_IDResource1" TabIndex="-1"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblAmount" runat="server" Text="Số tiền chuyển" meta:resourcekey="lblAmountResource1"></asp:Label></td>
                                        <td colspan="2">
                                            <asp:TextBox ID="txtAmount" runat="server" CssClass="citad-txt" Width="180px" Style="text-align: right;"
                                                MaxLength="30" meta:resourcekey="txtAmountResource1" TabIndex="4" onchange="javascript:fcnAmountBlur(this);"></asp:TextBox><asp:Label
                                                    ID="Label4" runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label4Resource1"></asp:Label>
                                            <asp:TextBox Text="VND" ID="txtCurrency" runat="server" CssClass="citad-txt citad-txtReadonly"
                                                Width="32px" ReadOnly="True" meta:resourcekey="txtCurrencyResource1" TabIndex="-1"></asp:TextBox></td>
                                        <td style="width: 67px">
                                            <asp:Label ID="lblSerial_No" runat="server" Text="Số giao dịch" meta:resourcekey="lblSerial_NoResource1"></asp:Label></td>
                                        <td>
                                            <asp:TextBox ID="txtSerial_No" runat="server" CssClass="citad-txt citad-txtReadonly"
                                                Width="143px" ReadOnly="True" meta:resourcekey="txtSerial_NoResource1" TabIndex="-1"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblSD_Time" runat="server" Text="Thời điểm gửi lệnh" meta:resourcekey="lblSD_TimeResource1"></asp:Label></td>
                                        <td>
                                            <asp:TextBox ID="txtDisplaySDTime" runat="server" CssClass="citad-txt citad-txtReadonly"
                                                Width="180px" ReadOnly="True" meta:resourcekey="txtDisplaySDTimeResource1" TabIndex="-1"></asp:TextBox></td>
                                        <td style="width: 152px" align="right">
                                            <asp:Label ID="lblTrx_Status" runat="server" Text="T&#236;nh trạng giao dịch" meta:resourcekey="lblTrx_StatusResource1"></asp:Label>&nbsp;</td>
                                        <td colspan="2">
                                            <asp:TextBox ID="txtStatus" runat="server" CssClass="citad-txt citad-txtReadonly"
                                                Width="211px" ReadOnly="True" Font-Bold="True" ForeColor="Red" meta:resourcekey="txtStatusResource1"
                                                TabIndex="-1"></asp:TextBox></td>
                                    </tr>
                                </table>
                            </fieldset>
                            <fieldset>
                                <legend>
                                    <asp:Label ID="GroupBox1" runat="server" Text="Th&#244;ng tin người gửi" meta:resourcekey="GroupBox1Resource1"></asp:Label></legend>
                                <table cellpadding="0" cellspacing="1">
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblSD_Name" runat="server" Text="T&#234;n" meta:resourcekey="lblSD_NameResource1"></asp:Label></td>
                                        <td align="left" colspan="4">
                                            <asp:TextBox ID="txtSD_Name" runat="server" CssClass="citad-txt" Width="550px" MaxLength="70"
                                                meta:resourcekey="txtSD_NameResource1" TabIndex="5"></asp:TextBox><asp:Label ID="Label5"
                                                    runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label5Resource1"></asp:Label></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblSD_ADDR" runat="server" Text="Địa chỉ" meta:resourcekey="lblSD_ADDRResource1"></asp:Label></td>
                                        <td colspan="4">
                                            <asp:TextBox ID="txtSD_ADDR" runat="server" CssClass="citad-txt" Width="550px" MaxLength="100"
                                                meta:resourcekey="txtSD_ADDRResource1" TabIndex="6"></asp:TextBox></td>
                                    </tr>
                                </table>
                                <table cellpadding="0" cellspacing="1" style="width: 671px">
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblSD_ACCNT" runat="server" Text="Số t&#224;i khoản" meta:resourcekey="lblSD_ACCNTResource1"></asp:Label></td>
                                        <td style="width: 219px">
                                            <asp:TextBox ID="txtSD_ACCNT" runat="server" CssClass="citad-txt" Width="180px" MaxLength="25"
                                                meta:resourcekey="txtSD_ACCNTResource1" TabIndex="7" Text="0000000000000000000000000"></asp:TextBox><asp:Label
                                                    ID="Label7" runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label7Resource1"></asp:Label></td>
                                        <td align="right" style="width: 90px">
                                            <asp:Label ID="lblSD_Code" runat="server" Text="Code" meta:resourcekey="lblSD_CodeResource1"></asp:Label>&nbsp;</td>
                                        <td>
                                            <asp:TextBox ID="txtSD_Code" runat="server" CssClass="citad-txt" Width="239px" MaxLength="20"
                                                meta:resourcekey="txtSD_CodeResource1" TabIndex="8" Text="00000000000000000000"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblO_Indirect" runat="server" Text="Tại" meta:resourcekey="lblO_IndirectResource1"></asp:Label></td>
                                        <td colspan="3">
                                            <table cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td style="width: 98px">
                                                        <asp:TextBox ID="txtO_Indirect_Code" runat="server" CssClass="citad-txt txtPopup"
                                                            Width="85px" meta:resourcekey="txtO_Indirect_CodeResource1" TabIndex="10" MaxLength="12"></asp:TextBox><asp:Label
                                                                ID="Label15" runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label15Resource1"></asp:Label>
                                                    </td>
                                                    <td style="padding-left: 4px;">
                                                        <asp:Label ID="lblO_Indirect_Name" runat="server" ForeColor="#0046D5" meta:resourcekey="lblO_Indirect_NameResource1"></asp:Label></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </fieldset>
                            <fieldset>
                                <legend>
                                    <asp:Label ID="GroupBox2" runat="server" Text="Th&#244;ng tin người nhận" meta:resourcekey="GroupBox2Resource1"></asp:Label></legend>
                                <table cellpadding="0" cellspacing="1">
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblRV_Name" runat="server" Text="T&#234;n" meta:resourcekey="lblRV_NameResource1"></asp:Label></td>
                                        <td align="left">
                                            <asp:TextBox ID="txtRV_Name" runat="server" CssClass="citad-txt" Width="550px" MaxLength="70"
                                                meta:resourcekey="txtRV_NameResource1" TabIndex="11"></asp:TextBox><asp:Label ID="Label6"
                                                    runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label6Resource1"></asp:Label></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblRV_ADDR" runat="server" Text="Địa chỉ" meta:resourcekey="lblRV_ADDRResource1"></asp:Label></td>
                                        <td>
                                            <asp:TextBox ID="txtRV_ADDR" runat="server" CssClass="citad-txt" Width="550px" MaxLength="100"
                                                meta:resourcekey="txtRV_ADDRResource1" TabIndex="12"></asp:TextBox></td>
                                    </tr>
                                </table>
                                <table cellpadding="0" cellspacing="1" style="width: 664px">
                                    <tr>
                                        <td style="width: 106px">
                                            <asp:Label ID="lblRV_ACCNT" runat="server" Text="Số t&#224;i khoản" meta:resourcekey="lblRV_ACCNTResource1"></asp:Label></td>
                                        <td style="width: 219px">
                                            <asp:TextBox ID="txtRV_ACCNT" runat="server" CssClass="citad-txt" Width="150px" MaxLength="25"
                                                meta:resourcekey="txtRV_ACCNTResource1" TabIndex="13"></asp:TextBox><asp:Label ID="Label8"
                                                    runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label8Resource1"></asp:Label></td>
                                        <td style="width: 90px" align="right">
                                            <asp:Label ID="lblRV_Code" runat="server" Text="Code" meta:resourcekey="lblRV_CodeResource1"></asp:Label>&nbsp;</td>
                                        <td style="width: 244px">
                                                <table cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td>
                                                        <asp:TextBox ID="txtRV_Code" runat="server" CssClass="citad-txt"
                                                            Width="85px" meta:resourcekey="txtRV_CodeResource1" TabIndex="14" MaxLength="8" ></asp:TextBox><asp:Label
                                                             ID="lblMaKH" runat="server" Enabled="false"  ForeColor="Red" Text="*" ></asp:Label>
                                                             
                                                    </td>
                                                    <td style="padding-left: 4px;">
                                                        <asp:Label ID="lblRV_Code_Name" runat="server" ForeColor="#0046D5" meta:resourcekey="lblRV_Code_NameResource1"></asp:Label></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                   
                                    <tr>
                                        <td style="width: 106px;">
                                            <asp:Label ID="lblR_Indirect_ID" runat="server" Text="Tại" meta:resourcekey="lblR_Indirect_IDResource1"></asp:Label></td>
                                        <td style="width: 219px">
                                            <table cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td>
                                                        <asp:TextBox ID="txtR_Indirect_Code" runat="server" CssClass="citad-txt txtPopup"
                                                            Width="85px" meta:resourcekey="txtR_Indirect_CodeResource1" TabIndex="16" MaxLength="12"></asp:TextBox><asp:Label
                                                                ID="Label14" runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label14Resource1"></asp:Label>
                                                    </td>
                                                    <td style="padding-left: 4px;">
                                                        <asp:Label ID="lblR_Indirect_Name" runat="server" ForeColor="#0046D5" meta:resourcekey="lblR_Indirect_NameResource1"></asp:Label></td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td colspan="1" align="right">
                                            <asp:Label ID="lblTax_Code" runat="server" Text="M&#227; số thuế " meta:resourcekey="lblTax_CodeResource1"></asp:Label>&nbsp;</td>
                                        <td colspan="1" style="width: 244px">
                                            <asp:TextBox ID="txtTax_Code" runat="server" CssClass="citad-txt" Width="237px" MaxLength="25"
                                                meta:resourcekey="txtTax_CodeResource1" TabIndex="17"></asp:TextBox></td>
                                    </tr>
                                </table> 
                               
                                <table cellpadding="0" cellspacing="1" style="width: 544px">
                                    <tr>
                                        <td colspan="2" style="width: 112px;">
                                            <asp:Label ID="lblReference" runat="server" Text="Chương - khoản tiểu mục" meta:resourcekey="lblReferenceResource1"
                                                Width="105px"></asp:Label>
                                        </td>
                                        <td colspan="1" style="width: 559px">
                                            <asp:TextBox ID="txtReference" runat="server" CssClass="citad-txt" Width="550px"
                                                MaxLength="100" meta:resourcekey="txtReferenceResource1" TabIndex="18"></asp:TextBox></td>
                                    </tr>
                                </table>
                            </fieldset>
                            <fieldset id="fdsInterbankMarket" runat="server" visible="False" >
                                <legend>
                                    <asp:Label ID="lblLNH" runat="server" Text="Th&#244;ng tin giao dịch tr&#234;n thị trường LNH" meta:resourcekey="lblLNHResource1"></asp:Label>
                                </legend>
                                <table cellpadding="0" cellspacing="1" >
                                    <tr>
                                        <td style="width: 106px" >
                                            <asp:Label ID="lblNgayGiaoDich" runat="server" Text="Ng&#224;y giao dịch" meta:resourcekey="lblNgayGiaoDichResource1"></asp:Label></td>
                        
                        <td style="width: 107px" >
                            <asp:TextBox ID="dtpTRX_Date" runat="server"
                                Width="70px" MaxLength="8" CssClass="citad-txt"  TabIndex="18" meta:resourcekey="dtpTRX_DateResource1"></asp:TextBox>
                           
                            <cc1:MaskedEditExtender ID="mee" runat="server" TargetControlID="dtpTRX_Date" Mask="99/99/9999"
                                MaskType="Date" AcceptNegative="Left" ErrorTooltipEnabled="True" CultureAMPMPlaceholder=""
                                CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder=""
                                CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder=""
                                Enabled="True" />
                            <cc1:MaskedEditValidator ID="MaskedEditValidator5" runat="server" ControlExtender="mee"
                                ControlToValidate="dtpTRX_Date" EmptyValueMessage="Date is required" InvalidValueMessage="Date is invalid"
                                Display="Dynamic" EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" ValidationGroup="MKE"
                                ErrorMessage="mee" meta:resourcekey="MaskedEditValidator5Resource1" />
                         
                        </td>
                        <td align="right" style="padding-right:3px;width: 78px">
                            <asp:Label ID="lblLoaiGiaoDich" runat="server" Text="Loại giao dịch" meta:resourcekey="lblLoaiGiaoDichResource1"></asp:Label>
                        </td>
                        <td><asp:TextBox ID="txtTrxType" runat="server"  TabIndex="18"
                                Width="30px" MaxLength="3" CssClass="citad-txt txtPopup" meta:resourcekey="txtTrxTypeResource1"></asp:TextBox>
                        
                            </td>
                      <td colspan="3" style="width:170px;"><asp:Label ID="lblTrxType" ForeColor="Blue" runat="server" meta:resourcekey="lblTrxTypeResource1" /></td>
                        <td align="right" style="padding-right:3px">
                            <asp:Label ID="lblLaiSuat" runat="server" Text="L&#227;i suất" meta:resourcekey="lblLaiSuatResource1"></asp:Label>
                        </td>
                        <td><asp:TextBox ID="txtLaiSuat" runat="server" meta:resourcekey="txtLaiSuatResource1" TabIndex="18" 
                                  Width="35px" MaxLength="5" CssClass="citad-txt"></asp:TextBox> <asp:Label ID="lblNam" runat="server" Text="Năm" meta:resourcekey="lblNamResource1"/>
                               <cc1:MaskedEditExtender ID="meeLaiSuat" runat="server" TargetControlID="txtLaiSuat" Mask="99.99"
                                MaskType="Number" AcceptNegative="Left" ErrorTooltipEnabled="True"  CultureAMPMPlaceholder=""
                                CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" 
                                CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder=""
                                Enabled="True" />
                            <cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="meeLaiSuat"
                                ControlToValidate="txtLaiSuat" InvalidValueMessage="Nhập sai định dạng l&#227;i suất"
                                Display="Dynamic" EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" ValidationGroup="MKE"
                                ErrorMessage="mee" meta:resourcekey="MaskedEditValidator5Resource1" />
                                </td>
                    </tr>
                    <tr>
                    <td><asp:Label ID="lblKyHan" runat="server" Text="Kỳ hạn" meta:resourcekey="lblKyHanResource1"></asp:Label></td>
                    <td> 
                    <asp:TextBox ID="txtKyHan" runat="server"  TabIndex="18" 
                                Width="50px" MaxLength="4" CssClass="citad-txt" meta:resourcekey="txtKyHanResource1"></asp:TextBox>
                                <asp:Label ID="lblNgay" runat="server" Text="Ng&#224;y" meta:resourcekey="lblNgayResource1"></asp:Label>
                    </td>
                    <td align="right" style="padding-right:3px">
                    <asp:Label ID="lblLoaiTien" runat="server" Text="Loại tiền" meta:resourcekey="lblLoaiTienResource1" />
                    </td>
                    <td><asp:TextBox ID="txtCurrency2" runat="server"  TabIndex="18"
                                Width="30px" MaxLength="2" CssClass="citad-txt txtPopup" meta:resourcekey="txtCurrency2Resource1" /></td>
                    <td><asp:Label ID="lblCurrency" runat="server" ForeColor="Blue" meta:resourcekey="lblCurrencyResource1" /></td>
                    <td align="right" style="padding-right:3px">
                    <asp:Label ID="lblLoaiGTCG" runat="server" Text="Loại GTCG" meta:resourcekey="lblLoaiGTCGResource1" />
                    </td>
                    <td><asp:TextBox ID="txtValuablePapers" runat="server"  TabIndex="18"
                                Width="40px" MaxLength="4" CssClass="citad-txt txtPopup" meta:resourcekey="txtValuablePapersResource1"></asp:TextBox>
                                </td>
                                <td colspan="2"><asp:Label ID="lblValuablePapers" ForeColor="Blue" runat="server" meta:resourcekey="lblValuablePapersResource1" /></td>
                    </tr>
                </table>
                
                </fieldset>
                <fieldset style="margin-top: 5px;">
                    <table cellpadding="0" cellspacing="1">
                        <tr>
                            <td style="width: 106px" valign="top">
                                <asp:Label ID="lblContent" runat="server" Text="Nội dung" meta:resourcekey="lblContentResource1"></asp:Label></td>
                            <td valign="top">
                                <asp:TextBox ID="txtContent" runat="server" CssClass="citad-txt" Height="42px" TextMode="MultiLine"
                                    onkeyup="checkMaxLength(this, 210);" Width="550px" MaxLength="210" meta:resourcekey="txtContentResource1"
                                    TabIndex="19"></asp:TextBox></td>
                            <td valign="top">
                                <asp:Label ID="Label9" runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label9Resource1"></asp:Label></td>
                        </tr>
                    </table>
                    <table cellpadding="0" cellspacing="1" style="width: 672px">
                        <tr>
                            <td style="width: 106px">
                                <asp:Label ID="lblOPRT1" runat="server" Text="Loại nghiệp vụ 1" meta:resourcekey="lblOPRT1Resource1"></asp:Label></td>
                            <td style="width: 204px">
                                <asp:TextBox ID="txtOPRT1" runat="server" CssClass="citad-txt" Width="40px" MaxLength="2"
                                    meta:resourcekey="txtOPRT1Resource1" TabIndex="-1" ReadOnly="True" Enabled="False"></asp:TextBox>
                                <asp:Label ID="lblDisplay_OP1" runat="server" ForeColor="#0046D5" meta:resourcekey="lblDisplay_OP1Resource1"></asp:Label></td>
                            <td style="width: 110px">
                                <asp:Label ID="lblOPRT2" runat="server" Text="Loại nghiệp vụ 2" meta:resourcekey="lblOPRT2Resource1"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtOPRT2" runat="server" CssClass="citad-txt txtPopup" Width="40px"
                                    MaxLength="3" meta:resourcekey="txtOPRT2Resource1" TabIndex="21" ></asp:TextBox><asp:Label
                                        ID="Label11" runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label11Resource1" ></asp:Label>
                                <asp:Label ID="lblDisplay_OP2" runat="server" ForeColor="#0046D5" meta:resourcekey="lblDisplay_OP2Resource1"></asp:Label></td>
                        </tr>
                        <tr>
                            <td style="width: 106px;">
                                <asp:Label ID="lblFee_Flag" runat="server" Text="M&#227; loại t&#237;nh ph&#237;"
                                    meta:resourcekey="lblFee_FlagResource1"></asp:Label></td>
                            <td style="width: 204px;">
                                <asp:DropDownList ID="cboFee_Flag" runat="server" Width="180px" meta:resourcekey="cboFee_FlagResource1"
                                    TabIndex="-1" Enabled="False">
                                    <asp:ListItem meta:resourcekey="ListItemResource3"></asp:ListItem>
                                    <asp:ListItem Value="0" meta:resourcekey="ListItemResource1" Text="T&#237;nh mức ph&#237; 0 "></asp:ListItem>
                                    <asp:ListItem Value="1" meta:resourcekey="ListItemResource2" Text="T&#237;nh mức ph&#237; 1"></asp:ListItem>
                                </asp:DropDownList></td>
                            <td style="width: 110px;">
                                <asp:Label ID="lblFeeCI" runat="server" Text="Ng&#226;n h&#224;ng chịu ph&#237;"
                                    meta:resourcekey="lblFeeCIResource1"></asp:Label>&nbsp;</td>
                            <td>
                                <table cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td style="width: 86px">
                                            <asp:TextBox ID="txtFeeCICode" runat="server" CssClass="citad-txt txtPopup" Width="68px"
                                                MaxLength="12" meta:resourcekey="txtFeeCICodeResource1" TabIndex="23"></asp:TextBox>
                                            <asp:Label ID="Label13" runat="server" ForeColor="Red" Text="*" meta:resourcekey="Label13Resource1"></asp:Label>
                                        </td>
                                        <td style="padding-left: 4px;">
                                            <asp:Label ID="lblFeeCIName" runat="server" ForeColor="#0046D5" meta:resourcekey="lblFeeCINameResource1"></asp:Label></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </fieldset>
                <fieldset id="fdsDebit" runat="server" visible="False">
                    <legend>
                        <asp:Label ID="lblDebit" runat="server" Text="Trả lời" meta:resourcekey="lblDebitResource1"></asp:Label></legend>
                    <asp:RadioButton ID="rdbAccept" meta:resourcekey="rdbAcceptResource1" runat="server"
                        Text="Chấp nhận" Checked="True" GroupName="debit" Enabled="False" TabIndex="-1" />
                    <asp:RadioButton ID="rdbReject" meta:resourcekey="rdbRejectResource1" runat="server"
                        Text="Từ chối" GroupName="debit" Enabled="False" TabIndex="-1" /><br />
                    <asp:TextBox ID="txtReject_Reason" runat="server" CssClass="citad-txt citad-txtReadOnly"
                        Height="30px" ReadOnly="True" TextMode="MultiLine" Width="667px" TabIndex="-1"
                        meta:resourcekey="txtReject_ReasonResource1"></asp:TextBox>
                </fieldset>
                <asp:Label ID="lblReqField" runat="server" ForeColor="Red" Text="* : Bắt buộc nhập"
                    meta:resourcekey="lblReqFieldResource1"></asp:Label></td>
                <td valign="top" align="right" style="padding-left: 4px; padding-top: 2px">
                    <table cellpadding="0" cellspacing="0" style="padding-bottom: 5px;">
                        <tr>
                            <td align="right">
                                <asp:Button ID="btnNew" runat="server" CssClass="citad-btn" Text="Th&#234;m mới"
                                    OnClick="btnNew_Click" meta:resourcekey="btnNewResource1" TabIndex="31" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Button ID="btnSave" runat="server" ValidationGroup="vgORG" CssClass="citad-btn"
                                    Text="Ghi" OnClick="btnSave_Click" OnClientClick="return onBtnSave_Click(this);"
                                    meta:resourcekey="btnSaveResource1" TabIndex="30" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Button ID="btnDelete" runat="server" CssClass="citad-btn" Text="X&#243;a" OnClick="btnDelete_Click"
                                    meta:resourcekey="btnDeleteResource1" TabIndex="32" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Button ID="btnPrevios" runat="server" CssClass="citad-btn" Text="Trước" OnClick="btnPrevios_Click"
                                    meta:resourcekey="btnPreviosResource1" TabIndex="33" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Button ID="btnNext" runat="server" CssClass="citad-btn" Text="Tiếp theo" OnClick="btnNext_Click"
                                    meta:resourcekey="btnNextResource1" TabIndex="34" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Button ID="btnClose" runat="server" CssClass="citad-btn" Text="Đ&#243;ng" meta:resourcekey="btnCloseResource1"
                                    OnClick="btnClose_Click" TabIndex="35" />
                            </td>
                        </tr>
                        <tr>
                            <td align="center">
                                <asp:Label ID="lblCount" runat="server" Text="Tổng số" Font-Bold="True" ForeColor="#0046D5"
                                    meta:resourcekey="lblCountResource1"></asp:Label><br />
                                <asp:Label ID="lblTongSo" runat="server" Text="0/0" Font-Bold="True" ForeColor="#0046D5"
                                    meta:resourcekey="lblTongSoResource1"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </td>
                </tr>
                <tr>
                    <td align="right" valign="bottom">
                        <asp:Button ID="btnImport" runat="server" CssClass="citad-btn" Text="Import" Visible="False"
                            meta:resourcekey="btnImportResource1" />
                    </td>
                </tr>
                </table>
            </div>
            <asp:Label ID="lblRV_Indentify" runat="server" Text="Số CMND/hộ chiếu" meta:resourcekey="lblRV_IndentifyResource1"
                Visible="False"></asp:Label>
            <asp:TextBox ID="txtRV_Indentify" runat="server" CssClass="citad-txt" Width="180px"
                MaxLength="25" meta:resourcekey="txtRV_IndentifyResource1" TabIndex="15" Visible="False"></asp:TextBox>
            &nbsp;
            <asp:Label ID="lblSD_Indentify" runat="server" Text="Số CMND/hộ chiếu" meta:resourcekey="lblSD_IndentifyResource1"
                Visible="False"></asp:Label>
            <asp:TextBox ID="txtSD_Indentify" runat="server" CssClass="citad-txt" Width="180px"
                MaxLength="25" meta:resourcekey="txtSD_IndentifyResource1" TabIndex="9" Visible="False"></asp:TextBox>
            <asp:HiddenField ID="hidMsg_Key" runat="server" />
            <asp:HiddenField ID="hidMAC" runat="server" />
            <asp:HiddenField ID="hidO_CI_ID" runat="server" />
            <asp:HiddenField ID="hidR_CI_ID" runat="server" />
            <asp:HiddenField ID="hidO_Indirect_ID" runat="server" />
            <asp:HiddenField ID="hidRV_Code_ID" runat="server" />
            <asp:HiddenField ID="hidR_Indirect_ID" runat="server" />
            <asp:HiddenField ID="hidFeeCI_ID" runat="server" />
            <asp:HiddenField ID="hidlblRCI_Name" runat="server" />
            <asp:HiddenField ID="hidlblO_Indirect_Name" runat="server" />
            <asp:HiddenField ID="hidlblRV_Code_Name" runat="server" />
            <asp:HiddenField ID="hidlblR_Indirect_Name" runat="server" />
            <asp:HiddenField ID="hidlblFeeCIName" runat="server" />
            <asp:HiddenField ID="hidlblDisplay_OP1" runat="server" />
            <asp:HiddenField ID="hidlblDisplay_OP2" runat="server" />
            <asp:HiddenField ID="hidlblTrxType" runat="server" />
            <asp:HiddenField ID="hidlblValuablePapers" runat="server" />
            <asp:HiddenField ID="hidlblCurrency" runat="server" />
            <asp:HiddenField ID="hidFocusControlName" runat="server" />
            <cc1:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtAmount"
                Mask="99,999,999,999,999,999,999" MaskType="Number" InputDirection="RightToLeft"
                ErrorTooltipEnabled="True" CultureName="vi-VN" Enabled="True" AutoComplete="False" BehaviorID="mmeAmount" CultureAMPMPlaceholder="SA;CH" CultureCurrencySymbolPlaceholder="₫" CultureDateFormat="DMY" CultureDatePlaceholder="/" CultureDecimalPlaceholder="," CultureThousandsPlaceholder="." CultureTimePlaceholder=":" />
            <cc1:FilteredTextBoxExtender ID="ftbRelation_No" runat="server" TargetControlID="txtRelation_No" ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_"
                Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbRCI_Code" runat="server" TargetControlID="txtRCI_Code"
                ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbO_Indirect_Code" runat="server" TargetControlID="txtO_Indirect_Code"
                FilterType="Custom, Numbers" ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_"
                Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbR_Indirect_Code" runat="server" TargetControlID="txtR_Indirect_Code"
                FilterType="Custom, Numbers" ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_"
                Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbFeeCICode" runat="server" TargetControlID="txtFeeCICode"
                FilterType="Custom, Numbers" ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_"
                Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbSD_Name" runat="server" TargetControlID="txtSD_Name"
                FilterMode="InvalidChars" InvalidChars="@#$^*`/'|%~?" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbRV_Name" runat="server" TargetControlID="txtRV_Name"
                FilterMode="InvalidChars" InvalidChars="@#$^*`/'|%~?" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbSD_ADDR" runat="server" TargetControlID="txtSD_ADDR"
                FilterMode="InvalidChars" InvalidChars="@#$^*`/'|%~?" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbRV_ADDR" runat="server" TargetControlID="txtRV_ADDR"
                FilterMode="InvalidChars" InvalidChars="@#$^*`/'|%~?" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbSD_Indentify" runat="server" TargetControlID="txtSD_Indentify"
                FilterMode="InvalidChars" InvalidChars="@#$^*`/'|%~?" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbRV_Indentify" runat="server" TargetControlID="txtRV_Indentify"
                FilterMode="InvalidChars" InvalidChars="@#$^*`/'|%~?" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbSD_ACCNT" runat="server" TargetControlID="txtSD_ACCNT"
                ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbRV_ACCNT" runat="server" TargetControlID="txtRV_ACCNT"
                FilterType="Custom, Numbers" ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_"
                Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbSD_Code" runat="server" TargetControlID="txtSD_Code"
                FilterType="Custom, Numbers" ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_"
                Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbRV_Code" runat="server" TargetControlID="txtRV_Code"
                ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbTax_Code" runat="server" TargetControlID="txtTax_Code"
                FilterType="Custom, Numbers" ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -_"
                Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbReference" runat="server" TargetControlID="txtReference"
                FilterMode="InvalidChars" InvalidChars="@#$^*`/'|%~?" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbContent" runat="server" TargetControlID="txtContent"
                FilterMode="InvalidChars" InvalidChars="@#$^*`/'|%~?" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbOPRT1" runat="server" TargetControlID="txtOPRT1"
                FilterType="Numbers" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbOPRT2" runat="server" TargetControlID="txtOPRT2"
                FilterType="Numbers" Enabled="True" />
                
            <cc1:FilteredTextBoxExtender ID="ftbTrxType" runat="server" TargetControlID="txtTrxType"
                ValidChars="1234567890" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbCurrency" runat="server" TargetControlID="txtCurrency2"
                ValidChars="1234567890" Enabled="True" />
            <cc1:FilteredTextBoxExtender ID="ftbValuablePapers" runat="server" TargetControlID="txtValuablePapers"
                ValidChars="1234567890" Enabled="True" />
                <cc1:FilteredTextBoxExtender ID="ftbKyHan" runat="server" TargetControlID="txtKyHan"
                ValidChars="1234567890" Enabled="True" />
                
            <uc1:MessageBox ID="MessageBox1" runat="server" />
            <asp:HiddenField ID="hidButtonName" runat="server" />
            <asp:HiddenField ID="F_cboServ_Code" runat="server" />
            <asp:HiddenField ID="F_txtRCI_Code" runat="server" />
            <asp:HiddenField ID="F_txtAmount" runat="server" />
            <asp:HiddenField ID="F_txtSD_Name" runat="server" />
            <asp:HiddenField ID="F_txtSD_ADDR" runat="server" />
            <asp:HiddenField ID="F_txtSD_ACCNT" runat="server" />
            <asp:HiddenField ID="F_txtO_Indirect_Code" runat="server" />
            <asp:HiddenField ID="F_txtSD_Indentify" runat="server" />
            <asp:HiddenField ID="F_txtSD_Code" runat="server" />
            <asp:HiddenField ID="F_txtRV_Name" runat="server" />
            <asp:HiddenField ID="F_txtRV_ADDR" runat="server" />
            <asp:HiddenField ID="F_txtRV_ACCNT" runat="server" />
            <asp:HiddenField ID="F_txtR_Indirect_Code" runat="server" />
            <asp:HiddenField ID="F_txtRV_Indentify" runat="server" />
            <asp:HiddenField ID="F_txtRV_Code" runat="server" />
            <asp:HiddenField ID="F_txtTax_Code" runat="server" />
            <asp:HiddenField ID="F_txtReference" runat="server" />
            <asp:HiddenField ID="F_txtContent" runat="server" />
            <asp:HiddenField ID="F_txtOPRT1" runat="server" />
            <asp:HiddenField ID="F_txtOPRT2" runat="server" />
            <asp:HiddenField ID="F_cboFee_Flag" runat="server" />
            <asp:HiddenField ID="F_txtFeeCICode" runat="server" />            
            
            <%-- 17052012-thuynm-them field an cho loai nghiep vu 2, txtOPRT2--%>
            <asp:HiddenField ID="F_Old_txtOPRT2" runat="server" />
            <asp:HiddenField ID="F_Old_lblOPRT2" runat="server" />
            
            <%-- 17052012-thuynm-them field luu gia tri tam thoi cho cac o LNH va reference-chuongmuc--%>            
            <asp:HiddenField ID="hdf_txtReference" runat="server" />
            <asp:HiddenField ID="hdf_dtpTRX_Date" runat="server" />
            <asp:HiddenField ID="hdf_txtTrxType" runat="server" />
            <asp:HiddenField ID="hdf_lblTrxType" runat="server" />
            <asp:HiddenField ID="hdf_txtLaiSuat" runat="server" />
            <asp:HiddenField ID="hdf_txtKyHan" runat="server" />
            <asp:HiddenField ID="hdf_txtCurrency2" runat="server" />
            <asp:HiddenField ID="hdf_lblCurrency" runat="server" />
            <asp:HiddenField ID="hdf_txtValuablePapers" runat="server" />
            <asp:HiddenField ID="hdf_lblValuablePapers" runat="server" />

            <script type="text/javascript" language="javascript">
            function IsFormChange()
            {
                if($get('<%=btnSave.ClientID %>').disabled) return false;
                if($get('<%=F_cboServ_Code.ClientID %>').value != $get('<%=cboServ_Code.ClientID %>').value) return true;
                if($get('<%=F_txtRCI_Code.ClientID %>').value != $get('<%=txtRCI_Code.ClientID %>').value) return true;
                if($get('<%=F_txtAmount.ClientID %>').value != $get('<%=txtAmount.ClientID %>').value.replace(/_/g,'').replace(/\x2E/g,'')) return true;
                if($get('<%=F_txtSD_Name.ClientID %>').value != $get('<%=txtSD_Name.ClientID %>').value) return true;
                if($get('<%=F_txtSD_ADDR.ClientID %>').value != $get('<%=txtSD_ADDR.ClientID %>').value) return true;
                if($get('<%=F_txtSD_ACCNT.ClientID %>').value != $get('<%=txtSD_ACCNT.ClientID %>').value) return true;
                if($get('<%=F_txtO_Indirect_Code.ClientID %>').value != $get('<%=txtO_Indirect_Code.ClientID %>').value) return true;
                //if($get('<%=F_txtSD_Indentify.ClientID %>').value != $get('<%=txtSD_Indentify.ClientID %>').value) return true;
                if($get('<%=F_txtSD_Code.ClientID %>').value != $get('<%=txtSD_Code.ClientID %>').value) return true;
                if($get('<%=F_txtRV_Name.ClientID %>').value != $get('<%=txtRV_Name.ClientID %>').value) return true;
                if($get('<%=F_txtRV_ADDR.ClientID %>').value != $get('<%=txtRV_ADDR.ClientID %>').value) return true;
                if($get('<%=F_txtRV_ACCNT.ClientID %>').value != $get('<%=txtRV_ACCNT.ClientID %>').value) return true;
                if($get('<%=F_txtR_Indirect_Code.ClientID %>').value != $get('<%=txtR_Indirect_Code.ClientID %>').value) return true;
                //if($get('<%=F_txtRV_Indentify.ClientID %>').value != $get('<%=txtRV_Indentify.ClientID %>').value) return true;
                if($get('<%=F_txtRV_Code.ClientID %>').value != $get('<%=txtRV_Code.ClientID %>').value) return true;
                if($get('<%=F_txtReference.ClientID %>').value != $get('<%=txtReference.ClientID %>').value) return true;
                if($get('<%=F_txtContent.ClientID %>').value != $get('<%=txtContent.ClientID %>').value) return true;
                if($get('<%=F_txtOPRT1.ClientID %>').value != $get('<%=txtOPRT1.ClientID %>').value) return true;
                if($get('<%=F_txtOPRT2.ClientID %>').value != $get('<%=txtOPRT2.ClientID %>').value) return true;
                if($get('<%=F_cboFee_Flag.ClientID %>').value != $get('<%=cboFee_Flag.ClientID %>').value) return true;
                if($get('<%=F_txtFeeCICode.ClientID %>').value != $get('<%=txtFeeCICode.ClientID %>').value) return true;
                
                return false;
            }
            function checkFormChange(sender)
            {
                $get('<%=hidButtonName.ClientID %>').value = '';
                if(IsFormChange())
                {
                    var result = confirm(MSG900);
                    if(result)
                    {
                        $get('<%=hidButtonName.ClientID %>').value = sender.id;
                        $get('<%=btnSave.ClientID %>').click();
                        return false;
                    }
                }

                return true;
            }
            </script>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:RequiredFieldValidator runat="server" ID="rfvRelation_No" ControlToValidate="txtRelation_No"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="Số b&#250;t to&#225;n kh&#244;ng được để trống"
        meta:resourcekey="rfvRelation_NoResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceRelation_No"
        TargetControlID="rfvRelation_No" ScriptPath="~/js/ValidatorCalloutBehavior.js"
        HighlightCssClass="validatorCalloutHighlight" Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvServ_Code" ControlToValidate="cboServ_Code"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="Loại giao dịch kh&#244;ng được để trống"
        meta:resourcekey="rfvServ_CodeResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceServ_Code"
        TargetControlID="rfvServ_Code" ScriptPath="~/js/ValidatorCalloutBehavior.js"
        HighlightCssClass="validatorCalloutHighlight" Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvRCI_Code" ControlToValidate="txtRCI_Code"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="Ng&#226;n h&#224;ng nhận kh&#244;ng được để trống"
        meta:resourcekey="rfvRCI_CodeResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceRCI_Code" TargetControlID="rfvRCI_Code"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvAmount" ControlToValidate="txtAmount"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="Số tiền gửi kh&#244;ng được để trống"
        meta:resourcekey="rfvAmountResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceAmount" TargetControlID="rfvAmount"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvSD_Name" ControlToValidate="txtSD_Name"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="T&#234;n người gửi kh&#244;ng được để trống"
        meta:resourcekey="rfvSD_NameResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceSD_Name" TargetControlID="rfvSD_Name"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvSD_ACCNT" ControlToValidate="txtSD_ACCNT"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="T&#224;i khoản người gửi kh&#244;ng được để trống"
        meta:resourcekey="rfvSD_ACCNTResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceSD_ACCNT" TargetControlID="rfvSD_ACCNT"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvO_Indirect_Code" ControlToValidate="txtO_Indirect_Code"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="Ng&#226;n h&#224;ng gửi gi&#225;n tiếp kh&#244;ng được để trống"
        meta:resourcekey="rfvO_Indirect_CodeResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceO_Indirect_Code" TargetControlID="rfvO_Indirect_Code"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvRV_Name" ControlToValidate="txtRV_Name"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="T&#234;n người nhận kh&#244;ng được để trống"
        meta:resourcekey="rfvRV_NameResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceRV_Name" TargetControlID="rfvRV_Name"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvRV_ACCNT" ControlToValidate="txtRV_ACCNT"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="T&#224;i khoản người nhận kh&#244;ng được để trống"
        meta:resourcekey="rfvRV_ACCNTResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceRV_ACCNT" TargetControlID="rfvRV_ACCNT"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvR_Indirect_Code" ControlToValidate="txtR_Indirect_Code"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="Ng&#226;n h&#224;ng nhận kh&#244;ng được để trống"
        meta:resourcekey="rfvR_Indirect_CodeResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceR_Indirect_Code" TargetControlID="rfvR_Indirect_Code"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvContent" ControlToValidate="txtContent"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="Nội dung lệnh chuyển tiền kh&#244;ng được để trống"
        meta:resourcekey="rfvContentResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceContent" TargetControlID="rfvContent"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvOPRT1" ControlToValidate="txtOPRT1"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="Loại nghiệp vụ 1 kh&#244;ng được để trống"
        meta:resourcekey="rfvOPRT1Resource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceOPRT1" TargetControlID="rfvOPRT1"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvOPRT2" ControlToValidate="txtOPRT2"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="Loại nghiệp vụ 2 kh&#244;ng được để trống"
        meta:resourcekey="rfvOPRT2Resource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceOPRT2" TargetControlID="rfvOPRT2"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvFee_Flag" ControlToValidate="cboFee_Flag"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="M&#227; loại t&#237;nh ph&#237; kh&#244;ng được để trống"
        meta:resourcekey="rfvFee_FlagResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="vceFee_Flag" TargetControlID="rfvFee_Flag"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />
    <asp:RequiredFieldValidator runat="server" ID="rfvFeeCICode" ControlToValidate="txtFeeCICode"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="Ng&#226;n h&#224;ng t&#237;nh ph&#237; kh&#244;ng được để trống"
        meta:resourcekey="btnImportResource1" />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="cveFeeCICode" TargetControlID="rfvFeeCICode"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />


   <%-- <asp:RequiredFieldValidator runat="server" ID="rfvRV_Code" ControlToValidate="txtRV_Code" Enabled="False"
        Display="None" SetFocusOnError="True" ValidationGroup="vgORG" ErrorMessage="M&#227; KH kh&#244;ng được để trống" meta:resourcekey="rfvRV_CodeResource1"
        />
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="cveRV_Code" TargetControlID="rfvRV_Code"
        ScriptPath="~/js/ValidatorCalloutBehavior.js" HighlightCssClass="validatorCalloutHighlight"
        Enabled="True" />--%>
   
    

    <script type="text/javascript">
    /*
	$(function () {
	    $('fieldset.InterbankMarket').hide();
	    $('input[name="InterbankMarket"]').click(function () {
	        if (this.checked) {
	            $('fieldset.InterbankMarket').show();
	        } else {
	            $('fieldset.InterbankMarket').hide();
	        }
	    });
	});
	*/

        var activeControl;

        try
        {
            Sys.Net.WebRequestManager.add_invokingRequest(onInvoke);            
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(onEndRequest);
        }
        catch(err){alert(err);}

        function onEndRequest(sender, args)
        {
            try
            {
                document.onkeydown = KeyDown;
                if(AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout != null)
                {
                    AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout.hide();
                }
                fcnUpdateUI();
            }
            catch(err){}
        }

        function onInvoke(sender, args)
        {
            try
            {
            //alert("vao invoke");
                activeControl = document.activeElement;
                $get('<%=hidlblRCI_Name.ClientID %>').value=$get('<%=lblRCI_Name.ClientID %>').innerHTML;
                $get('<%=hidlblO_Indirect_Name.ClientID %>').value=$get('<%=lblO_Indirect_Name.ClientID %>').innerHTML;
                $get('<%=hidlblRV_Code_Name.ClientID %>').value=$get('<%=lblRV_Code_Name.ClientID %>').innerHTML;
                $get('<%=hidlblR_Indirect_Name.ClientID %>').value=$get('<%=lblR_Indirect_Name.ClientID %>').innerHTML;
                $get('<%=hidlblFeeCIName.ClientID %>').value=$get('<%=lblFeeCIName.ClientID %>').innerHTML;
                $get('<%=hidlblDisplay_OP1.ClientID %>').value=$get('<%=lblDisplay_OP1.ClientID %>').innerHTML;
                $get('<%=hidlblDisplay_OP2.ClientID %>').value=$get('<%=lblDisplay_OP2.ClientID %>').innerHTML;
                //thuynm2205
                if(document.getElementById('<%= chkInterbankMarket.ClientID %>').checked)
                {                    
                    $get('<%=hidlblTrxType.ClientID %>').value=$get('<%=lblTrxType.ClientID %>').innerHTML;
                    $get('<%=hidlblCurrency.ClientID %>').value= $get('<%=lblCurrency.ClientID %>').innerHTML;
                    $get('<%=hidlblValuablePapers.ClientID %>').value = $get('<%=lblValuablePapers.ClientID %>').innerHTML;
                }
                if(!document.getElementById('<%= chkInterbankMarket.ClientID %>').checked)
                {
                //alert("vao invoke gan oprt");
                    //$get('<%=F_Old_lblOPRT2.ClientID %>').value = $get('<%=lblDisplay_OP2.ClientID %>').innerHTML;
                    $get('<%=F_Old_txtOPRT2.ClientID %>').value = $get('<%=txtOPRT2.ClientID %>').value;
                }
            }
            catch(err){}
        }

        function fcnUpdateUI()
        {
            try
            {//alert("vao update ui");
                if($get('MBox').style.display == 'none')
                {
                    try
                    {
                        var focusControlName=$get('<%=hidFocusControlName.ClientID %>').value;
                        if(focusControlName!='')
                        {
                            var ctlFocusControl = $get(focusControlName)
                            if (ctlFocusControl.disabled!='disabled' || ctlFocusControl.disabled!=true) ctlFocusControl.focus();
                            $get('<%=hidFocusControlName.ClientID %>').value = '';
                        }
                        else
                        {
                            $get(activeControl.id).focus();
                            if(activeControl.type = 'text') SetEnd(activeControl);
                        }
                    }
                    catch (err){}
                }
                $get('<%=lblRCI_Name.ClientID %>').innerHTML = $get('<%=hidlblRCI_Name.ClientID %>').value;
                $get('<%=lblO_Indirect_Name.ClientID %>').innerHTML = $get('<%=hidlblO_Indirect_Name.ClientID %>').value;
                $get('<%=lblRV_Code_Name.ClientID %>').innerHTML = $get('<%=hidlblRV_Code_Name.ClientID %>').value;
                $get('<%=lblR_Indirect_Name.ClientID %>').innerHTML = $get('<%=hidlblR_Indirect_Name.ClientID %>').value;
                $get('<%=lblFeeCIName.ClientID %>').innerHTML = $get('<%=hidlblFeeCIName.ClientID %>').value;
                $get('<%=lblDisplay_OP1.ClientID %>').innerHTML = $get('<%=hidlblDisplay_OP1.ClientID %>').value;
                //thuynm 22/05  
                            
               
                //$get('<%=lblDisplay_OP2.ClientID %>').innerHTML = $get('<%=hidlblDisplay_OP2.ClientID %>').value;                              
                //alert(!document.getElementById('<%= chkInterbankMarket.ClientID %>').value);
                if(document.getElementById('<%= chkInterbankMarket.ClientID %>').checked)
                {
                     $get('<%=lblTrxType.ClientID %>').innerHTML = $get('<%=hidlblTrxType.ClientID %>').value;            
                      $get('<%=lblCurrency.ClientID %>').innerHTML = $get('<%=hidlblCurrency.ClientID %>').value;
                     $get('<%=lblValuablePapers.ClientID %>').innerHTML = $get('<%=hidlblValuablePapers.ClientID %>').value;
                //alert("vao update gan oprt");
                    var v_trxtype = $get('<%= txtTrxType.ClientID %>').value;
                    if(v_trxtype == "901" || v_trxtype == "902")
                    {
                        $get('<%=lblDisplay_OP2.ClientID %>').innerHTML = $get('<%=hidlblTrxType.ClientID %>').value;
                        $get('<%=txtOPRT2.ClientID %>').value = $get('<%=txtTrxType.ClientID %>').value;
                    }
                    else
                    {
                        $get('<%=lblDisplay_OP2.ClientID %>').innerHTML = $get('<%=F_Old_lblOPRT2.ClientID %>').value;
                        $get('<%=txtOPRT2.ClientID %>').value = $get('<%=F_Old_txtOPRT2.ClientID %>').value;
                    }
                }
                else
                {
                //alert("vao else");
                    //$get('<%=lblDisplay_OP2.ClientID %>').innerHTML = $get('<%=hidlblDisplay_OP2.ClientID %>').value;
                    $get('<%=lblDisplay_OP2.ClientID %>').innerHTML = $get('<%=F_Old_lblOPRT2.ClientID %>').value;
                    
                    $get('<%=txtOPRT2.ClientID %>').value = $get('<%=F_Old_txtOPRT2.ClientID %>').value;
                }
            }
            catch(err){}
        }

        function pageUnload()
        {
            try
            {
                Sys.Net.WebRequestManager.remove_invokingRequest(onInvoke);
                Sys.Net.WebRequestManager.remove_completedRequest(onComplete);
                Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(onEndRequest);
            }
            catch(err){}
        }

        function onMBoxOK_Click()
        {
            try
            {
                var focusControlName=$get('<%=hidFocusControlName.ClientID %>').value;
                if(focusControlName!="")
                {
                    var ctlFocusControl = $get(focusControlName)
                    if (ctlFocusControl.disabled!='disabled' || ctlFocusControl.disabled!=true) ctlFocusControl.focus();
                    $get('<%=hidFocusControlName.ClientID %>').value = "";
                }
                else
                {
                    $get(activeControl.id).focus();
                }
            }
            catch (err){}
        }

        function onBtnSave_Click(sender)
        {
            try
            {
                WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(sender.name, '', true, 'vgORG', '', false, false));
                if($get('<%=hidR_CI_ID.ClientID %>').value == '' && $get('<%=txtRCI_Code.ClientID %>').value != '')
                {
                    $get('<%=txtRCI_Code.ClientID %>').focus();
                    return false;
                }
                if($get('<%=hidO_Indirect_ID.ClientID %>').value == '' && $get('<%=txtO_Indirect_Code.ClientID %>').value != '')
                {
                    $get('<%=txtO_Indirect_Code.ClientID %>').focus();
                    return false;
                }
                if($get('<%=hidR_Indirect_ID.ClientID %>').value == '' && $get('<%=txtR_Indirect_Code.ClientID %>').value != '')
                {
                    $get('<%=txtR_Indirect_Code.ClientID %>').focus();
                    return false;
                }
            }
            catch(err){}
        }
    </script>

    <script type="text/javascript">
        var RELATION_NO_CHANGED = false;

        function onTxtRelation_change(objTB)
        {
            //document.onkeydown = lockkeys;
            __doPostBack(objTB.name,'');
        }
        
        function onTxtRelation_No_blur()
        {
            try
            {
                var textRelation_No = $get('<%=txtRelation_No.ClientID %>');
                if(textRelation_No.value.trim() == '')
                {
                    var activecontrol = document.activeElement;
                    
                    switch(activecontrol.type)
                    {
                        case 'select-one':
                        case 'text':
                        case 'textarea':
                            if(activecontrol.id != '<%=txtRelation_No.ClientID %>')
                            {
                                alert(Vmsg32);
                                return;
                            }
                            break;
                    }
                }
                else if (RELATION_NO_CHANGED)
                {
                    RELATION_NO_CHANGED = false;
                    //document.onkeydown = lockkeys;
                    __doPostBack(textRelation_No.name,'');
                }
            }
            catch(err){}
        }
        
        function onTxtRelationNo_KeyUp(objTB)
        {
//            try
//            {
//				var iCaretPos = getCaretPosition(objTB);
//                var regex = new RegExp(objTB.regex);
//			    for(i=0;i<objTB.value.length;i++)
//			    {
//				    var c = objTB.value.charAt(i);
//				    
//			        if(!regex.test(c) || c=='[' || c==']')
//			        {
//			            objTB.value = objTB.value.substr(0,i) + objTB.value.substring(i+1);
//			            i--;
//			        }
//			    }
//			    objTB.value = objTB.value.toUpperCase();
//                RELATION_NO_CHANGED = true;

//                setCaretPosition(objTB, iCaretPos);
//            }
//            catch(err)
//            {
//                //alert(err);
//            }
        }
    </script>

    <script type="text/javascript">
        /*
        Nhóm hàm xử lý thông tin ngân hàng
        */
        
        //thuynm xử lý khi giá trị kỳ hạn thay đổi
        
//        function trim(str) {
//            return str.replace(/^\s+|\s+$/g,'');
//        } 
////        
        function padLeft(s,len,c){
          c=c || '0';
          while(s.length< len) s= c+s;
          return s;
        }
        
        function fcnKyHanOnblur(){             
             var v_KyHan = $get('<%= txtKyHan.ClientID %>').value; 
             if(v_KyHan != '' )   
             {     
                if (v_KyHan.length < 4)  
                {       
                    $get('<%= txtKyHan.ClientID %>').value = padLeft(v_KyHan, 4);
                    
                }  
             } 
        }
//        
////       
//        function fcnLaiSuatOnblur(){        
//            var v_LaiSuat = $get('<%= txtLaiSuat.ClientID %>').value;  
////          
//            v_LaiSuat = trim(v_LaiSuat);
//           
//            if(v_LaiSuat != ' __,__')
//            {
//                if (v_LaiSuat.length < 5)
//                {
//                //alert(1);
//                    $get('<%= txtLaiSuat.ClientID %>').value = padLeft(v_LaiSuat, 5);
//                    
//                }
//            }
//            $get('<%= txtKyHan.ClientID %>').focus();
//       // }
        

        //Ngân hàng nhận
        function GetRCI(Results)
        {
            if(Results[0].length==0)
            {
                $get('<%= lblRCI_Name.ClientID %>').innerHTML = Results[1];
                $get('<%= lblRCI_Name.ClientID %>').style.color = 'red';
                $get('<%= hidlblRCI_Name.ClientID %>').value = Results[1];
                $get('<%= hidR_CI_ID.ClientID %>').value = Results[0];
                if(!v_isShowPopup)
                {
                    fcnShowPopupCIList('<%= txtRCI_Code.ClientID %>');
                }
                v_isShowPopup = false;
            }
            else
            {
                if($get('<%= txtRCI_Code.ClientID %>').value!=$get('<%= txtOCI_Code.ClientID %>').value)
                {
                    $get('<%= lblRCI_Name.ClientID %>').innerHTML = Results[1];
                    $get('<%= lblRCI_Name.ClientID %>').style.color = 'blue';
                    $get('<%= hidlblRCI_Name.ClientID %>').value = Results[1];
                    $get('<%= hidR_CI_ID.ClientID %>').value = Results[0];
                    if($get('<%= hidR_Indirect_ID.ClientID %>').value.length==0)
                    {
                        $get('<%= txtR_Indirect_Code.ClientID %>').value = $get('<%= txtRCI_Code.ClientID %>').value;                        
                        $get('<%= lblR_Indirect_Name.ClientID %>').innerHTML = Results[1];
                        $get('<%= lblR_Indirect_Name.ClientID %>').style.color = 'blue';
                        $get('<%= hidlblR_Indirect_Name.ClientID %>').value = Results[1];
                        $get('<%= hidR_Indirect_ID.ClientID %>').value = Results[0];
                    }
                }
                else
                {
                    $get('<%= lblRCI_Name.ClientID %>').innerHTML = "";
                    $get('<%= hidlblRCI_Name.ClientID %>').value = "";
                    $get('<%= hidR_CI_ID.ClientID %>').value = "";
                    if(!v_isShowPopup) 
                    {
                        fcnShowPopupCIList('<%= txtRCI_Code.ClientID %>');
                    }
                    v_isShowPopup = false;                    
                }
            }
        }
        
      

        //Ngân hàng gửi gián tiếp
        function GetO_Indirect_CI(Results)
        {
            if(Results[0].length==0)
            {
                $get('<%= lblO_Indirect_Name.ClientID %>').innerHTML = Results[1];
                $get('<%= lblO_Indirect_Name.ClientID %>').style.color = 'red';
                $get('<%= hidlblO_Indirect_Name.ClientID %>').value = Results[1];
                $get('<%= hidO_Indirect_ID.ClientID %>').value = Results[0];

                if(!v_isShowPopup)
                {
                    fcnShowPopupCIList('<%= txtO_Indirect_Code.ClientID %>');
                }
                v_isShowPopup = false;
            }
            else
            {
                $get('<%= lblO_Indirect_Name.ClientID %>').innerHTML = Results[1];
                $get('<%= lblO_Indirect_Name.ClientID %>').style.color = 'blue';
                $get('<%= hidlblO_Indirect_Name.ClientID %>').value = Results[1];
                $get('<%= hidO_Indirect_ID.ClientID %>').value = Results[0];
            }
        }
        
//        //Mã khách hàng
        function GetRV_Code(Results)
        {
            if(Results[0].length==0)
            {
                $get('<%= lblRV_Code_Name.ClientID %>').innerHTML = Results[1];
                $get('<%= lblRV_Code_Name.ClientID %>').style.color = 'red';
                $get('<%= hidlblRV_Code_Name.ClientID %>').value = Results[1];
                $get('<%= hidRV_Code_ID.ClientID %>').value = Results[0];

                if(!v_isShowPopup)
                {
                    fcnShowPopupCIList('<%= txtRV_Code.ClientID %>');
                }
                v_isShowPopup = false;
            }
            else
            {
                $get('<%= lblRV_Code_Name.ClientID %>').innerHTML = Results[1];
                $get('<%= lblRV_Code_Name.ClientID %>').style.color = 'blue';
                $get('<%= hidlblRV_Code_Name.ClientID %>').value = Results[1];
                $get('<%= hidRV_Code_ID.ClientID %>').value = Results[0];
            }
        }

        //Ngân hàng nhận gián tiếp
        function GetR_Indirect_CI(Results)
        {
            if(Results[0].length==0)
            {
                $get('<%= lblR_Indirect_Name.ClientID %>').innerHTML = Results[1];
                $get('<%= lblR_Indirect_Name.ClientID %>').style.color = 'red';
                $get('<%= hidlblR_Indirect_Name.ClientID %>').value = Results[1];
                $get('<%= hidR_Indirect_ID.ClientID %>').value = Results[0];
                if(!v_isShowPopup)
                {
                    fcnShowPopupCIList('<%= txtR_Indirect_Code.ClientID %>');
                }
                v_isShowPopup = false;
            }
            else
            {
                $get('<%= lblR_Indirect_Name.ClientID %>').innerHTML = Results[1];
                $get('<%= lblR_Indirect_Name.ClientID %>').style.color = 'blue';
                $get('<%= hidlblR_Indirect_Name.ClientID %>').value = Results[1];
                $get('<%= hidR_Indirect_ID.ClientID %>').value = Results[0];
            }
        }

        //Ngân hàng chịu phí
        function GetFee_CI(Results)
        {
            $get('<%= lblFeeCIName.ClientID %>').innerHTML = Results[1];
            $get('<%= lblFeeCIName.ClientID %>').style.color = 'blue';
            $get('<%= hidlblFeeCIName.ClientID %>').value = Results[1];
            $get('<%= hidFeeCI_ID.ClientID %>').value = Results[0];

            if(Results[0].length==0 && Results[1].length>0)
            {
                if(!v_isShowPopup)
                {
                    fcnShowPopupCIList('<%= txtFeeCICode.ClientID %>');
                }
                v_isShowPopup = false;
            }
        }

        function fcnOnTxtRV_Code_blur(Results)
        {
            var v_ci_code = $get('<%= txtRV_Code.ClientID %>').value;
                        
            if(Results == 'true')
            {
                PageMethods.fcnGetCI(v_ci_code,'0',GetRV_Code);
            }
            else
            {
                $get('<%= lblRV_Code_Name.ClientID %>').innerHTML = "";
                $get('<%= hidRV_Code_ID.ClientID %>').value = "";
                $get('<%= hidlblRV_Code_Name.ClientID %>').value = "";
            }
           
        }

        //Hàm xử lý khi ô ci code bị thay đổi giá trị
        function fcnShowCIListOnChange(txtci_id)
        {
            var v_ci_code = $get(txtci_id).value;
            if(v_ci_code.trim().length>0)
            {
                if(txtci_id.match("txtRCI_Code")!=null)
                {
                    if($get(txtci_id).value.trim()==$get('<%= txtOCI_Code.ClientID %>').value.trim())
                    {
                        $get(txtci_id).value = "";
                        fcnShowCIListOnChange(txtci_id);
                        fcnShowPopupCIList(txtci_id);
                    }
                    else
                    {
                        PageMethods.fcnGetCI(v_ci_code,'1',GetRCI);
                    }
                }
                else if(txtci_id.match("txtO_Indirect_Code")!=null)
                {
                    PageMethods.fcnGetCI(v_ci_code,'0',GetO_Indirect_CI);
                }
                else if(txtci_id.match("txtR_Indirect_Code")!=null)
                {
                    PageMethods.fcnGetCI(v_ci_code,'0',GetR_Indirect_CI);
                }
                else if(txtci_id.match("txtFeeCICode")!=null)
                {
                    PageMethods.fcnGetCI(v_ci_code,'0',GetFee_CI);
                }
                else if(txtci_id.match("txtRV_Code")!=null)
                {
                    var txtRV_Code = $(txtci_id);
                    PageMethods.fcnCheckExistRV_Code(txtRV_Code.value, fcnOnTxtRV_Code_blur);
                }
            }
            else
            {
                if(txtci_id.match("txtRCI_Code")!=null)
                {
                    $get('<%= lblRCI_Name.ClientID %>').innerHTML = "";
                    $get('<%= hidR_CI_ID.ClientID %>').value = "";
                    $get('<%= hidlblRCI_Name.ClientID %>').value = "";
                }
                else if(txtci_id.match("txtO_Indirect_Code")!=null)
                {
                    $get('<%= lblO_Indirect_Name.ClientID %>').innerHTML = "";
                    $get('<%= hidO_Indirect_ID.ClientID %>').value = "";
                    $get('<%= hidlblO_Indirect_Name.ClientID %>').value = "";
                }
                else if(txtci_id.match("txtR_Indirect_Code")!=null)
                {
                    $get('<%= lblR_Indirect_Name.ClientID %>').innerHTML = "";
                    $get('<%= hidR_Indirect_ID.ClientID %>').value = "";
                    $get('<%= hidlblR_Indirect_Name.ClientID %>').value = "";
                }
                else if(txtci_id.match("txtFeeCICode")!=null)
                {
                    $get('<%= lblFeeCIName.ClientID %>').innerHTML = "";
                    $get('<%= hidFeeCI_ID.ClientID %>').value = "";
                    $get('<%= hidlblFeeCIName.ClientID %>').value = "";
                }
                else if(txtci_id.match("txtRV_Code")!=null)
                {
                     $get('<%= lblRV_Code_Name.ClientID %>').innerHTML = "";
                    $get('<%= hidRV_Code_ID.ClientID %>').value = "";
                    $get('<%= hidlblRV_Code_Name.ClientID %>').value = "";
                       
                }
            }
        }

        //Hàm xử lý khi ô ci code bị thay đổi giá trị
        function fcnShowCIListOnChangeF4(txtci_id)
        {
            var v_ci_code = $get(txtci_id).value;
            if(txtci_id.match("txtRCI_Code")!=null)
            {
                PageMethods.fcnGetCI(v_ci_code,'1',GetRCI);
            }
            else if(txtci_id.match("txtO_Indirect_Code")!=null)
            {
                PageMethods.fcnGetCI(v_ci_code,'0',GetO_Indirect_CI);
            }
            else if(txtci_id.match("txtR_Indirect_Code")!=null)
            {
                PageMethods.fcnGetCI(v_ci_code,'0',GetR_Indirect_CI);
            }
            else if(txtci_id.match("txtFeeCICode")!=null)
            {
                PageMethods.fcnGetCI(v_ci_code,'0',GetFee_CI);
            }
            else if(txtci_id.match("txtRV_Code")!=null)
            {
                 var txtRV_Code = $(txtci_id);
                 PageMethods.fcnCheckExistRV_Code(txtRV_Code.value, fcnOnTxtRV_Code_blur);
                
            }
        }
        var v_isShowPopup = false;
        //Hàm xử lý hiện danh sách ngân hàng
        function fcnShowPopupCIList(txtci_id)
        {
            if(!$get(txtci_id).readOnly)
            {
                var strCICode = $get(txtci_id).value;
                if (txtci_id.match("txtRCI_Code"))
                {
                    rValue = window.showModalDialog('../DanhSachNganHang/CIList.aspx' + '?randomNumber=' + Math.random() + "&CICode=" + strCICode + "&Direct=1&NotCICode=" + $get('<%= txtOCI_Code.ClientID %>').value,"",popupCIFeature);
                }
                else
                {
                    rValue = window.showModalDialog('../DanhSachNganHang/CIList.aspx' + '?randomNumber=' + Math.random() + "&CICode=" + strCICode,"",popupCIFeature);
                }
                if(rValue!=undefined)
                {
                    $get(txtci_id).value = rValue[1];
                    if(txtci_id.match("txtRCI_Code")!=null)
                    {
                        $get('<%= lblRCI_Name.ClientID %>').innerHTML = rValue[2];
                        $get('<%= lblRCI_Name.ClientID %>').style.color = 'blue';
                        $get('<%= hidR_CI_ID.ClientID %>').value = rValue[0];
                        $get('<%= hidlblRCI_Name.ClientID %>').value = rValue[2];
                        if($get('<%= hidR_Indirect_ID.ClientID %>').value.length==0)
                        {
                            $get('<%= txtR_Indirect_Code.ClientID %>').value = $get('<%= txtRCI_Code.ClientID %>').value;                        
                            $get('<%= lblR_Indirect_Name.ClientID %>').innerHTML = $get('<%= lblRCI_Name.ClientID %>').innerHTML;
                            $get('<%= lblR_Indirect_Name.ClientID %>').style.color = 'blue';
                            $get('<%= hidlblR_Indirect_Name.ClientID %>').value = $get('<%= lblRCI_Name.ClientID %>').innerHTML;
                            $get('<%= hidR_Indirect_ID.ClientID %>').value = $get('<%= hidlblRCI_Name.ClientID %>').value;
                        }
                    }
                    else if(txtci_id.match("txtO_Indirect_Code")!=null)
                    {
                        $get('<%= lblO_Indirect_Name.ClientID %>').innerHTML = rValue[2];
                        $get('<%= lblO_Indirect_Name.ClientID %>').style.color = 'blue';
                        $get('<%= hidO_Indirect_ID.ClientID %>').value = rValue[0];
                        $get('<%= hidlblO_Indirect_Name.ClientID %>').value = rValue[2];
                    }
                    else if(txtci_id.match("txtR_Indirect_Code")!=null)
                    {
                        $get('<%= lblR_Indirect_Name.ClientID %>').innerHTML = rValue[2];
                        $get('<%= lblR_Indirect_Name.ClientID %>').style.color = 'blue';
                        $get('<%= hidR_Indirect_ID.ClientID %>').value = rValue[0];
                        $get('<%= hidlblR_Indirect_Name.ClientID %>').value = rValue[2];
                    }
                    else if(txtci_id.match("txtFeeCICode")!=null)
                    {
                        $get('<%= lblFeeCIName.ClientID %>').innerHTML = rValue[2];
                        $get('<%= lblFeeCIName.ClientID %>').style.color = 'blue';
                        $get('<%= hidFeeCI_ID.ClientID %>').value = rValue[0];
                        $get('<%= hidlblFeeCIName.ClientID %>').value = rValue[2];
                    }
                    else if(txtci_id.match("txtRV_Code")!=null)
                    {
                        $get('<%= lblRV_Code_Name.ClientID %>').innerHTML = rValue[2];
                        $get('<%= lblRV_Code_Name.ClientID %>').style.color = 'blue';
                        $get('<%= hidRV_Code_ID.ClientID %>').value = rValue[0];
                        $get('<%= hidlblRV_Code_Name.ClientID %>').value = rValue[2];
                    }
                }
            }
        }

        //Hàm xử lý khi người dùng ấn nút F4
        function fcnShowCIList(txtci_id)
        {
            if (event.keyCode==115) //F4
            {
                var f_blur = $get(txtci_id).onblur;
                $get(txtci_id).onblur = null;
                fcnShowPopupCIList(txtci_id);
                $get(txtci_id).onblur = f_blur;
                v_isShowPopup = true;
                event.keyCode=9;
            }
        }

    </script>

    <script type="text/javascript">
        /*
        Nhóm hàm xử lý loại nghiệp vụ
        */

        function fcnShowOprt1()
        {
            var v_ID = $get('<%= txtOPRT1.ClientID %>').value;
            if (v_ID.trim().length>0)
            {
                PageMethods.fcnGetOprt1(v_ID,fcnSetOPRT1);
            }
            else
            {
                $get('<%= txtOPRT1.ClientID %>').value = "";
                $get('<%= lblDisplay_OP1.ClientID %>').innerHTML = "";
            }
            $get('<%= hidlblDisplay_OP1.ClientID %>').value = $get('<%= lblDisplay_OP1.ClientID %>').innerHTML;
        }

        function fcnSetOPRT1(Results)
        {
            $get('<%= txtOPRT1.ClientID %>').value = Results[0];
            if(Results[0] == "")
            {
                $get('<%= lblDisplay_OP1.ClientID %>').style.color = 'red';
            }
            else
            {
                $get('<%= lblDisplay_OP1.ClientID %>').style.color = 'blue';
                try
                {
                    $get('<%=rfvOPRT1.ClientID %>').style.display='none';
                }catch(err){}
            }
            $get('<%= lblDisplay_OP1.ClientID %>').innerHTML = Results[1];
            $get('<%= hidlblDisplay_OP1.ClientID %>').value = Results[1];
            
            if($get('<%= txtOPRT1.ClientID %>').value == '')
            {
                fcnShowPopupOPList('<%= txtOPRT1.ClientID %>');
            }
        }

        function fcnShowOprt2()
        {
        //alert("vao ham show oprt2");
            var v_ID = $get('<%= txtOPRT2.ClientID %>').value;
            if (v_ID.trim().length>0)
            {
                PageMethods.fcnGetOprt2(v_ID,fcnSetOPRT2);
            }
            else
            {
                $get('<%= txtOPRT2.ClientID %>').value = "";
                $get('<%= lblDisplay_OP2.ClientID %>').innerHTML = "";
            }
            $get('<%= hidlblDisplay_OP2.ClientID %>').value = $get('<%= lblDisplay_OP2.ClientID %>').innerHTML;
        }
        function fcnShowTrxType()
        {
            var v_ID = $get('<%= txtTrxType.ClientID %>').value;
            if (v_ID.trim().length>0)
            {
                PageMethods.fcnGetTrxType(v_ID,fcnSetTrxType);
            }
            else
            {
                $get('<%= txtTrxType.ClientID %>').value = "";
                $get('<%= lblTrxType.ClientID %>').innerHTML = "";
                
                fcnChangeTrxType('','', false);
            }
            $get('<%= hidlblTrxType.ClientID %>').value = $get('<%= lblTrxType.ClientID %>').innerHTML;
            
        }
        function fcnShowCurrency()
        {
            var v_ID = $get('<%= txtCurrency2.ClientID %>').value;
            if (v_ID.trim().length>0)
            {
                PageMethods.fcnGetCurrency(v_ID,fcnSetCurrency);
            }
            else
            {
                $get('<%= txtCurrency2.ClientID %>').value = "";
                $get('<%= lblCurrency.ClientID %>').innerHTML = "";
            }
            $get('<%= hidlblCurrency.ClientID %>').value = $get('<%= lblCurrency.ClientID %>').innerHTML;
        }
        function fcnShowValuablePapers()
        {
            var v_ID = $get('<%= txtValuablePapers.ClientID %>').value;
            if (v_ID.trim().length>0)
            {
                PageMethods.fcnGetValuablePapers(v_ID,fcnSetValuablePapers);
            }
            else
            {
                $get('<%= txtValuablePapers.ClientID %>').value = "";
                $get('<%= lblValuablePapers.ClientID %>').innerHTML = "";
            }
            $get('<%= hidlblValuablePapers.ClientID %>').value = $get('<%= lblValuablePapers.ClientID %>').innerHTML;
        }

        function fcnSetOPRT2(Results)
        {
            $get('<%= txtOPRT2.ClientID %>').value = Results[0];
            if(Results[0] == "")
            {
                $get('<%= lblDisplay_OP2.ClientID %>').style.color = 'red';
            }
            else
            {
                $get('<%= lblDisplay_OP2.ClientID %>').style.color = 'blue';
            }
            //alert("trong ham setoprt2 1474");
            $get('<%= lblDisplay_OP2.ClientID %>').innerHTML = Results[1];
            $get('<%= hidlblDisplay_OP2.ClientID %>').value = Results[1];
            
            if($get('<%= txtOPRT2.ClientID %>').value == '')
            {
                fcnShowPopupOPList('<%= txtOPRT2.ClientID %>');
            }
            $get('<%= F_Old_lblOPRT2.ClientID %>').value = $get('<%= lblDisplay_OP2.ClientID %>').innerHTML;
        }
        function fcnSetTrxType(Results)
        {
            $get('<%= txtTrxType.ClientID %>').value = Results[0];
            
            if(Results[0] == "")
            {
                $get('<%= lblTrxType.ClientID %>').style.color = 'red';
                fcnChangeTrxType('','', false);
            }
            else
            {
                $get('<%= lblTrxType.ClientID %>').style.color = 'blue';
                fcnChangeTrxType(Results[0],Results[1], true);
                
            }
            $get('<%= lblTrxType.ClientID %>').innerHTML = Results[1];
            $get('<%= hidlblTrxType.ClientID %>').value = Results[1];
           
            
            if($get('<%= txtTrxType.ClientID %>').value == '')
            {
                fcnShowPopupTrxTypeList('<%= txtTrxType.ClientID %>');
            }
        }
        
        function fcnSetCurrency(Results)
        {
            $get('<%= txtCurrency2.ClientID %>').value = Results[0];
            if(Results[0] == "")
            {
                $get('<%= lblCurrency.ClientID %>').style.color = 'red';
            }
            else
            {
                $get('<%= lblCurrency.ClientID %>').style.color = 'blue';
            }
            $get('<%= lblCurrency.ClientID %>').innerHTML = Results[1];
            $get('<%= hidlblCurrency.ClientID %>').value = Results[1];
            
            if($get('<%= txtCurrency2.ClientID %>').value == '')
            {
                fcnShowPopupCurrencyList('<%= txtCurrency2.ClientID %>');
            }
        }
        function fcnSetValuablePapers(Results)
        {
            $get('<%= txtValuablePapers.ClientID %>').value = Results[0];
            if(Results[0] == "")
            {
                $get('<%= lblValuablePapers.ClientID %>').style.color = 'red';
            }
            else
            {
                $get('<%= lblValuablePapers.ClientID %>').style.color = 'blue';
            }
            $get('<%= lblValuablePapers.ClientID %>').innerHTML = Results[1];
            $get('<%= hidlblValuablePapers.ClientID %>').value = Results[1];
            
            if($get('<%= txtValuablePapers.ClientID %>').value == '')
            {
                fcnShowPopupValuablePapersList('<%= txtValuablePapers.ClientID %>');
            }
        }
        
        //Hàm xử lý khi người dùng ấn nút F4
        function fcnShowTrxTypeList(txtop_id)
        {
            if (event.keyCode==115) //F4
            {
                fcnShowPopupTrxTypeList(txtop_id);
                event.keyCode=9;
            }
        }
        //Hàm xử lý khi người dùng ấn nút F4
        function fcnShowCurrencyList(txtop_id)
        {
            if (event.keyCode==115) //F4
            {
                fcnShowPopupCurrencyList(txtop_id);
                event.keyCode=9;
            }
        }
        //Hàm xử lý khi người dùng ấn nút F4
        function fcnShowValuablePapersList(txtop_id)
        {
            if (event.keyCode==115) //F4
            {
                fcnShowPopupValuablePapersList(txtop_id);
                event.keyCode=9;
            }
        }
        //Hàm xử lý khi người dùng ấn nút F4
        function fcnShowOPList(txtop_id)
        {
            if (event.keyCode==115) //F4
            {
                fcnShowPopupOPList(txtop_id);
                event.keyCode=9;
            }
        }

        //Hàm xử lý hiện danh sách loại nghiệp vụ
        function fcnShowPopupOPList(txtop_id)
        {
            if(!$get(txtop_id).readOnly)
            {
                var bytOp = 1;
                if(txtop_id.match("txtOPRT1")!=null)
                {
                   bytOp = 1
                }
                else if(txtop_id.match("txtOPRT2")!=null)
                {
                   bytOp = 2;
                }
                var rValue = new Array();
                rValue = window.showModalDialog('../DanhSachLoaiNghiepVu/Operation.aspx' + '?randomNumber=' + Math.random() + "&bytOp=" + bytOp,"",strFeatureMDlg_OP);
                if(rValue!=undefined)
                {
                    $get(txtop_id).value = rValue[0];
                    //if(rValue[0] == "")
                    if(txtop_id.match("txtOPRT1")!=null)
                    {
                        $get('<%= lblDisplay_OP1.ClientID %>').style.color = 'blue';
                        $get('<%= lblDisplay_OP1.ClientID %>').innerHTML = rValue[1];
                        $get('<%= hidlblDisplay_OP1.ClientID %>').value = rValue[1];
                    }
                    else if(txtop_id.match("txtOPRT2")!=null)
                    {
                        $get('<%= lblDisplay_OP2.ClientID %>').style.color = 'blue';
                        $get('<%= lblDisplay_OP2.ClientID %>').innerHTML = rValue[1];
                        $get('<%= hidlblDisplay_OP2.ClientID %>').value = rValue[1];
                    }
                }
            }
        }
        
        //Hàm xử lý hiện danh sách trx type
        function fcnShowPopupTrxTypeList(txt_id)
        {
            if(!$get(txt_id).readOnly)
            {
                var rValue = new Array();
                rValue = window.showModalDialog('../../Popup/frmTrxType.aspx' + '?randomNumber=' + Math.random(),"",strFeatureMDlg_OP);
                
                if(rValue!=undefined)
                {
                    $get(txt_id).value = rValue[0];
                    //if(rValue[0] == "")
                    if(txt_id.match("txtTrxType")!=null)
                    {
                        $get('<%= lblTrxType.ClientID %>').style.color = 'blue';
                        $get('<%= lblTrxType.ClientID %>').innerHTML = rValue[1];
                        $get('<%= hidlblTrxType.ClientID %>').value = rValue[1];
                        
                        fcnChangeTrxType(rValue[0],rValue[1], true);
                    }
                }
            }
        }
        
        function fcnChangeTrxType(code, label, change_flag)
        {
            //disable txtReference
            var txtReference = $get('<%= txtReference.ClientID %>');
            var txtOPRT2 = $get('<%= txtOPRT2.ClientID %>');
            if(change_flag){
                txtReference.value = '';
                txtReference.disabled='disabled';
                txtOPRT2.disabled='disabled';
            
                //set value txtOPRT2//lblDisplay_OP2//hidlblDisplay_OP2
                
                txtOPRT2.value = code;
                $get('<%= lblDisplay_OP2.ClientID %>').style.color = 'blue';
                $get('<%= lblDisplay_OP2.ClientID %>').innerHTML = label;
                $get('<%= hidlblDisplay_OP2.ClientID %>').value = label;
            }
            else {
                txtReference.disabled= false;
                txtOPRT2.disabled= false;
                //set value txtOPRT2//lblDisplay_OP2//hidlblDisplay_OP2
                
                if(txtOPRT2.value == '100' || txtOPRT2.value == '101')
                {
                    
                }
                else
                {
                    txtOPRT2.value = '';
                    $get('<%= lblDisplay_OP2.ClientID %>').style.color = 'blue';
                    $get('<%= lblDisplay_OP2.ClientID %>').innerHTML = '';
                    $get('<%= hidlblDisplay_OP2.ClientID %>').value = '';
                }
            }
            //disable txtOPRT2

            var txtValuablePapers = $get('<%= txtValuablePapers.ClientID %>');
            //an hien valid
            try
            {
              
                if(code=='902')// || code == '906')
                {                   
                    $get('<%= txtValuablePapers.ClientID %>').disabled= false;
                }
                else
                {                               
                    
                    txtValuablePapers.disabled='disabled';
                    //$get('<%= txtValuablePapers.ClientID %>').disabled= "disabled";
                    $get('<%= lblValuablePapers.ClientID %>').innerHTML = '';
                    $get('<%= hidlblValuablePapers.ClientID %>').value = '';
                    txtValuablePapers.value = '';
                }
            }
            catch(err){alert(err);}
        }
        
        
        //Hàm xử lý hiện danh sách trx type
        function fcnShowPopupCurrencyList(txt_id)
        {
            if(!$get(txt_id).readOnly)
            {
                var rValue = new Array();
                rValue = window.showModalDialog('../../Popup/frmCurrency.aspx' + '?randomNumber=' + Math.random(),"",strFeatureMDlg_OP);
                if(rValue!=undefined)
                {
                    $get(txt_id).value = rValue[0];
                    //if(rValue[0] == "")
                    if(txt_id.match("txtCurrency2")!=null)
                    {
                        $get('<%= lblCurrency.ClientID %>').style.color = 'blue';
                        $get('<%= lblCurrency.ClientID %>').innerHTML = rValue[1];
                        $get('<%= hidlblCurrency.ClientID %>').value = rValue[1];
                    }
                }
            }
        }

        //Hàm xử lý hiện danh sách trx type
        function fcnShowPopupValuablePapersList(txt_id)
        {
            if(!$get(txt_id).readOnly)
            {
                var rValue = new Array();
                rValue = window.showModalDialog('../../Popup/frmValueablePapers.aspx' + '?randomNumber=' + Math.random(),"",strFeatureMDlg_OP);
                if(rValue!=undefined)
                {
                    $get(txt_id).value = rValue[0];
                    //if(rValue[0] == "")
                    if(txt_id.match("txtValuablePapers")!=null)
                    {
                        $get('<%= lblValuablePapers.ClientID %>').style.color = 'blue';
                        $get('<%= lblValuablePapers.ClientID %>').innerHTML = rValue[1];
                        $get('<%= hidlblValuablePapers.ClientID %>').value = rValue[1];
                    }
                }
            }
        }
    </script>

    <script type="text/javascript" language="javascript">
        function onCboTRX_TYPEChange()
        {
            try
            {
                var cboTRX_TYPE = $get('<%=cboServ_Code.ClientID %>');
                if(cboTRX_TYPE.value != '')
                {
                    var SERV_CODE = cboTRX_TYPE.options[cboTRX_TYPE.selectedIndex].text.substring(0,2);
                    switch(SERV_CODE)
                    {
                        case 'LF':
                        case 'HF':
                        case 'HN':
                            $get('<%=txtOPRT1.ClientID %>').value = opCREDIT;
                            $get('<%=lblDisplay_OP1.ClientID %>').innerHTML = opCREDITname;
                            $get('<%=hidlblDisplay_OP1.ClientID %>').value = opCREDITname;
                            break;
                        case 'PA':
                        case 'HP':
                        case 'PN':
                            $get('<%=txtOPRT1.ClientID %>').value = opDEBIT;
                            $get('<%=lblDisplay_OP1.ClientID %>').innerHTML = opDEBITname;
                            $get('<%=hidlblDisplay_OP1.ClientID %>').value = opDEBITname;
                            break;
                    }
                    try
                    {
                        $get('<%=rfvOPRT1.ClientID %>').style.display='none';
                    }catch(err){}
                }
            }
            catch(err){}
        }
    </script>

    <script type="text/javascript">
        //Nhóm hàm khởi tạo form popup để khi gọi load nhanh hơn
        //
        function InitPopupForm()
        {
            var xmlHttp;
            var xmlHttpOp;
            try
            {
                // Firefox, Opera 8.0+, Safari
                xmlHttp = new XMLHttpRequest();
                xmlHttpOp = new XMLHttpRequest();
            }
            catch (e)
            {
                // Internet Explorer
                try
                {
                    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
                    xmlHttpOp = new ActiveXObject("Msxml2.XMLHTTP");
                }
                catch (e)
                {
                    try
                    {
                        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                        xmlHttpOp = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    catch (e)
                    {
                        alert("Your browser does not support AJAX!");
                        return false;
                    }
                }
            }
            xmlHttp.onreadystatechange = function()
            {
                if(xmlHttp.readyState==4)
                {
                    v_isCIInit = true;
                }
            }
            xmlHttpOp.onreadystatechange = function()
            {
                if(xmlHttpOp.readyState==4)
                {
                    v_isOpInit = true;
                }
            }
            xmlHttp.open('GET',BASE_URL + 'Modules/DanhSachNganHang/CIList.aspx?mode=init',true);
            xmlHttp.send(null);
            xmlHttpOp.open('GET',BASE_URL + 'Modules/DanhSachLoaiNghiepVu/Operation.aspx?mode=init',true);
            xmlHttpOp.send(null);
            
            try
            {
                if($get('MBox').style.display == "none")
                {
                    try
                    {
                        var focusControlName=$get('<%=hidFocusControlName.ClientID %>').value;
                        if(focusControlName!="")
                        {
                            var ctlFocusControl = $get(focusControlName)
                            if (ctlFocusControl.disabled!='disabled' || ctlFocusControl.disabled!=true) ctlFocusControl.focus();
                            $get('<%=hidFocusControlName.ClientID %>').value = "";
                        }
                    }
                    catch (err){}
                }
                $get('<%=lblRCI_Name.ClientID %>').innerHTML = $get('<%=hidlblRCI_Name.ClientID %>').value;
                $get('<%=lblO_Indirect_Name.ClientID %>').innerHTML = $get('<%=hidlblO_Indirect_Name.ClientID %>').value;
                $get('<%=lblR_Indirect_Name.ClientID %>').innerHTML = $get('<%=hidlblR_Indirect_Name.ClientID %>').value;
                $get('<%=lblRV_Code_Name.ClientID %>').innerHTML = $get('<%=hidlblRV_Code_Name.ClientID %>').value;
                $get('<%=lblFeeCIName.ClientID %>').innerHTML = $get('<%=hidlblFeeCIName.ClientID %>').value;                
                $get('<%=lblDisplay_OP1.ClientID %>').innerHTML = $get('<%=hidlblDisplay_OP1.ClientID %>').value;      
                //alert("trong ham popup form 1857");         
                $get('<%=lblDisplay_OP2.ClientID %>').innerHTML = $get('<%=hidlblDisplay_OP2.ClientID %>').value;
            }
            catch(err){}
            
        }
        
       
        
    </script>
    
    
     <script type="text/javascript" language="javascript">
     //thu ham onkeyup dung chung thuynm1705
        function onKeyUpCommon(type)
        { 
            switch(type)
            {
                case "refer" :                    
                    $get('<%=hdf_txtReference.ClientID %>').value = $get('<%=txtReference.ClientID %>').value;
                    break;
            
//                case "date" :
//                    $get('<%=hdf_dtpTRX_Date.ClientID %>').value = $get('<%=dtpTRX_Date.ClientID %>').value;
//                    break;
//                case "trxtype" :
//                    $get('<%=hdf_txtTrxType.ClientID %>').value = $get('<%=txtTrxType.ClientID %>').value;
//                    $get('<%=hdf_lblTrxType.ClientID %>').value = $get('<%=lblTrxType.ClientID %>').innerHTML;
//                    break;
//                case "laisuat" :
//                    $get('<%=hdf_txtLaiSuat.ClientID %>').value = $get('<%=txtLaiSuat.ClientID %>').value;
//                    break;
//                case "kyhan" :
//                    $get('<%=hdf_txtKyHan.ClientID %>').value = $get('<%=txtKyHan.ClientID %>').value;
//                    break;          
//                case "currency" :
//                    $get('<%=hdf_txtCurrency2.ClientID %>').value = $get('<%=txtCurrency2.ClientID %>').value;
//                    $get('<%=hdf_lblCurrency.ClientID %>').value = $get('<%=lblCurrency.ClientID %>').innerHTML;
//                    break;
//                case "vpaper" :
//                    $get('<%=hdf_txtValuablePapers.ClientID %>').value = $get('<%=txtValuablePapers.ClientID %>').value;
//                    $get('<%=hdf_lblValuablePapers.ClientID %>').value = $get('<%=lblValuablePapers.ClientID %>').innerHTML;
//                    break;
                case "oprt" :               
                    $get('<%=F_Old_txtOPRT2.ClientID %>').value = $get('<%=txtOPRT2.ClientID %>').value;
                    $get('<%=F_Old_lblOPRT2.ClientID %>').value = $get('<%=lblDisplay_OP2.ClientID %>').innerHTML;
                    break;
                default:
                    break;
            }
        }

    </script>

    <script type="text/javascript">
        window.document.onkeydown = KeyDown;
        window.onload = InitPopupForm;
       
        
    </script>

</asp:Content>
