<%--
    Document   : accountCreation
    Created on : Mar 8, 2016, 1:20:58 PM
    Author     : Tcs Helpdesk10
--%>

<%@page import="LoginDb.DbHandler"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%@page import="java.sql.Connection"%>
<%@page import="DataEntryBean.AccountCreationBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.UUID" %>
<%String uuid = UUID.randomUUID().toString();%>
<% try {
%>
<html>
    <head>
        <title>Deposit Account Creation</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="${pageContext.request.contextPath}/js/Calendar.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/TableCSSCode.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="shortcut icon" href="${pageContext.request.contextPath}/img/favicon.ico?pacs=<%=((new java.util.Date()).getTime())%>" type="image/x-icon" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/styles.css?pacs=<%=((new java.util.Date()).getTime())%>"/>
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/ButtonAndText.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <link rel="stylesheet" type="text/css" href="/PacsApplication/css/info.css?pacs=<%=((new java.util.Date()).getTime())%>" />
        <script type="text/javascript" src="${pageContext.request.contextPath}/jquery-ui-1.10.4.custom/development-bundle/jquery-1.10.2.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <script type="text/javascript" src="/PacsApplication/chromejs/chrome.js?pacs=<%=((new java.util.Date()).getTime())%>"></script>
        <script type="text/javascript" src="/PacsApplication/js/iFrame_killer.js"></script>
    </head>
    <body  onload="noBack()">
        <script type="text/javascript">
            function noBack()
            {
                window.history.forward();
            }
            function submitform(accCreatForm)
            {
                if (checkDiv(accCreatForm))
                {
                    document.forms[0].action = '/PacsApplication/DepositAccountCreationServlet';
                    document.forms[0].submit();
                }
            }
            function checkDiv(accCreatForm)
            {
                if (accCreatForm.productCodeDetails.value == "")
                {
                    alert("Product Code must be filled.");
                    accCreatForm.productCodeDetails.focus();
                    return false;
                }
                if (accCreatForm.inttCategory.value == "")
                {
                    alert("Interest Category must be filled.");
                    accCreatForm.inttCategory.focus();
                    return false;
                }
                if (accCreatForm.segmentCode.value == "")
                {
                    alert("Segment Code must be filled.");
                    accCreatForm.segmentCode.focus();
                    return false;
                }
                if (accCreatForm.cifNumber.value == "")
                {
                    alert("CIF Number must be filled.");
                    accCreatForm.cifNumber.focus();
                    return false;
                }
                if (accCreatForm.customerType.value == "")
                {
                    alert("Customer Type must be filled.");
                    accCreatForm.customerType.focus();
                    return false;
                }
                if (accCreatForm.activityCode.value == "")
                {
                    alert("Activity Code must be filled.");
                    accCreatForm.activityCode.focus();
                    return false;
                }
            <%--if (accCreatForm.holdType.value == "2" && accCreatForm.cifNumber2.value == "")
            {
                alert("Please provide secondary CIF for joint account");
                accCreatForm.cifNumber2.focus();
                return false;
            }--%>
            <%--Added By Bitan for Validating Secondary CIF Fields--%>
                if (accCreatForm.holdType.value == "2")
                {
                    var counter = 10;
                    for (i = 1; i < counter; i++) {
                        if (document.getElementById('jt_cifNumber' + i)) {
                            var val = document.getElementById('jt_cifNumber' + i).value;
                            if (val == "") {
                                alert("Please provide secondary CIF for joint account");
                                document.getElementById('jt_cifNumber' + i).focus();
                                return false;
                            }
                        }
                    }
                }
            <%--END--%>
                if ((document.getElementById("nomineebtn").value == "Delete Nominee") && document.getElementById("nominee").value == "") {
                    alert("Please enter the nominee details");
                    return false;
                }


                var res = accCreatForm.productCode.value;
                var res2 = res.substring(0, 1);
                if (res2 == "2") {
                    if (accCreatForm.inttrepmethod.value == "")
                    {
                        alert("All fields must be filled.");
                        accCreatForm.inttrepmethod.focus();
                        return false;
                    }
                }

                if ((accCreatForm.inttrepmethod.value == "T" || accCreatForm.inttrepmethod.value == "TR") && accCreatForm.intttransacc.value == "") {


                    alert("Intt Transfer Account must be filled.");
                    accCreatForm.intttransacc.focus();
                    return false;


                }
                var detectPCode = accCreatForm.productCode.value.charAt(0);
                if (detectPCode === "2")
                {
                    if (accCreatForm.termValue.value == "")
                    {
                        alert("Term Value must be filled.");
                        accCreatForm.termValue.focus();
                        return false;
                    }
                    if (accCreatForm.termYears.value == "")
                    {
                        alert("Term in No. of Years must be filled.");
                        accCreatForm.termYears.focus();
                        return false;
                    }
                    if (accCreatForm.termMonth.value == "")
                    {
                        alert("Term in No. of Months must be filled.");
                        accCreatForm.termMonth.focus();
                        return false;
                    }
                    if (accCreatForm.termDays.value == "")
                    {
                        alert("Term in No. of Days must be filled.");
                        accCreatForm.termDays.focus();
                        return false;
                    }
                    if (accCreatForm.matAmt.value == "")
                    {
                        alert("Please click the 'Calculate Maturity' button to get the maturity amount");
                        accCreatForm.matAmt.focus();
                        return false;
                    }
                }

                if (detectPCode === "3")
                {
                    if (accCreatForm.instAmt.value == "")
                    {
                        alert("Installment amount must be filled.");
                        accCreatForm.instAmt.focus();
                        return false;
                    }

                    if (accCreatForm.termMonth.value == "")
                    {
                        alert("Please enter term length in months.");
                        accCreatForm.termMonth.focus();
                        return false;
                    }

                    if (accCreatForm.matAmt.value == "")
                    {
                        alert("Please click the 'Calculate Maturity' button to get the maturity amount");
                        accCreatForm.matAmt.focus();
                        return false;
                    }

                }

                re = /^\d+$/; //this checks whether field contains digits
                if (!re.test(accCreatForm.cifNumber.value))
                {
                    alert("CIF number could only contain numbers.");
                    accCreatForm.cifNumber.focus();
                    return false;
                }

                re = /^(?=.*\d)\d*(?:\.\d*)?$/; //this checks whether field contains digits
                if (accCreatForm.inttrepmethod.value == "T" || accCreatForm.inttrepmethod.value == "TR") {
                    if (!re.test(accCreatForm.intttransacc.value))
                    {
                        alert("Intt Transfer Account could only contain numbers.");
                        accCreatForm.intttransacc.focus();
                        return false;
                    }
                }

                if (detectPCode === "2")
                {
                    re = /^(?=.*\d)\d*(?:\.\d*)?$/; //this checks whether field contains digits
                    if (!re.test(accCreatForm.termValue.value))
                    {
                        alert("Term Value could only contain numbers.");
                        accCreatForm.termValue.focus();
                        return false;
                    }
                    if (accCreatForm.termYears.value == "")
                    {
                        alert("Term in No. of Years could only contain numbers.");
                        accCreatForm.termYears.focus();
                        return false;
                    }
                    if (accCreatForm.termMonth.value == "")
                    {
                        alert("Term in No. of Months could only contain numbers.");
                        accCreatForm.termMonth.focus();
                        return false;
                    }
                    if (accCreatForm.termDays.value == "")
                    {
                        alert("Term in No. of Days could only contain numbers.");
                        accCreatForm.termDays.focus();
                        return false;
                    }

                }

                if (detectPCode === "3")
                {
                    re = /^(?=.*\d)\d*(?:\.\d*)?$/; //this checks whether field contains digits
                    if (!re.test(accCreatForm.instAmt.value))
                    {
                        alert("Installment amount could only contain numbers.");
                        accCreatForm.instAmt.focus();
                        return false;
                    }

                    if (!re.test(accCreatForm.termMonth.value))
                    {
                        alert("Term length in months could only contain numbers.");
                        accCreatForm.termMonth.focus();
                        return false;
                    }

                }

                return true;
            }

            function showNominee() {
                if (document.getElementById("nomineebtn").value == "Add Nominee") {
                    $('#addnominee').show();
                    document.getElementById("nomineebtn").value = "Delete Nominee";
                } else if (document.getElementById("nomineebtn").value == "Delete Nominee") {
                    $('#addnominee').hide();
                    document.getElementById("nominee").value = "";
                    document.getElementById("nomineeName").value = "";
                    document.getElementById("nomineeName").style.display = 'none';
                    document.getElementById("nomineebtn").value = "Add Nominee";
                }
            }

            function sendInfo() {

                document.forms[0].handle_id.value = document.accCreatForm.productCode.value;
                document.forms[0].action = "DynamicInttCategory.jsp";
                document.forms[0].submit();

            }

            function ShowParent()
            {

                document.forms[0].action = "${pageContext.request.contextPath}/Deposit/DepositAccountCreation.jsp";
                document.forms[0].submit();
            }
            <%--Changed by Bitan Regarding Multiple CIF--%>
            <%-- $(document).ready(function () {
                 $('select#holdType').change(function () {
                     var shouldEnable = $(this).val();
                     switch(shouldEnable)
                     {
                         case '1':
                             $('#forJoint').hide();
                             break;
                         case '2':
                             $('#forJoint').show();
                             break;
                         default:
                             $('#forJoint').hide();
                     }
                 });
             });--%>


            function popup_Maturity(width, height, instAmt, termMonth) {
               // var first = $('#inttCatDetails').val();
                var firstChar = first.substring(0, 4);

                //var prod = $('#productCodeDetails').val();
                var prodCode = prod.substr(0, 4);

                if (window.innerWidth) {
                    LeftPosition = (window.innerWidth - width) / 2;
                    TopPosition = ((window.innerHeight - height) / 2) - 20;
                } else {
                    LeftPosition = (parseInt(window.screen.width) - width) / 2;
                    TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                }
                attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                        height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                        TopPosition + '';
                var screenName = "DepositAccountCreation.jsp";
                var lovKey = "CalcMaturity"
                popWin = open('/PacsApplication/CommonSearchInformationDepositLOV.jsp?instAmt=' + instAmt + '&termMonth=' + termMonth + '&prodCodeDetails=' + prodCode + '&inttCatDetails=' + firstChar + '&screenName=' + screenName + '&lovKey=' + lovKey, 'CalcMaturity', attr);
                popWin.focus();

            }

            function popup_FDMaturity(width, height, termValue, termYears, termMonth, termDays, productCodeDetails, inttCatDetails) {
                //var firstChar = inttCatDetails.substring(0, 4);
               // var first = $('#inttCatDetails').val();
                var firstChar = first.substring(0, 4);
                if ($('#termValue').val() == "") {
                    alert("Please enter term Value to calculate maturity Amount!");
                } else if ($('#termYears').val() == "") {
                    alert("Please enter all termYears to calculate maturity Amount!");
                } else if ($('#termMonth').val() == "") {
                    alert("Please enter all termMonth to calculate maturity Amount!");
                } else if ($('#termDays').val() == "") {
                    alert("Please enter all termDays to calculate maturity Amount!");
                } else {
                    if (window.innerWidth) {
                        LeftPosition = (window.innerWidth - width) / 2;
                        TopPosition = ((window.innerHeight - height) / 2) - 20;
                    } else {
                        LeftPosition = (parseInt(window.screen.width) - width) / 2;
                        TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                    }
                    //var firstChar = inttCatDetails.substr(0, 4);
                    attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                            height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                            TopPosition + '';
                    var screenName = "DepositAccountCreation.jsp";
                    var lovKey = "CalcFDMaturity"
                    popWin = open('/PacsApplication/CommonSearchInformationDepositLOV.jsp?termValue=' + termValue + '&termYears=' + termYears + '&termMonth=' + termMonth + '&termDays=' + termDays + '&productCodeDetails=' + productCodeDetails + '&inttCatDetails=' + firstChar + '&screenName=' + screenName + '&lovKey=' + lovKey, 'CalcFDMaturity', attr);
                    popWin.focus();
                }


            }

            function popup_CIF(width, height, cifNumber, productCode) {
                if (window.innerWidth) {
                    LeftPosition = (window.innerWidth - width) / 2;
                    TopPosition = ((window.innerHeight - height) / 2) - 20;
                } else {
                    LeftPosition = (parseInt(window.screen.width) - width) / 2;
                    TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                }
                attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                        height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                        TopPosition + '';
                var screenName = "DepositAccountCreation.jsp";
                var lovKey = "CifDetails"
                popWin = open('/PacsApplication/CommonSearchInfoLOVNew.jsp?cifNumber=' + cifNumber + '&productCode=' + productCode + '&screenName=' + screenName + '&lovKey=' + lovKey, 'CifDetails', attr);
                popWin.focus();

            }

            function popup_CIF2(width, height, cifNumber, productCode, counter) {
                if (window.innerWidth) {
                    LeftPosition = (window.innerWidth - width) / 2;
                    TopPosition = ((window.innerHeight - height) / 2) - 20;
                } else {
                    LeftPosition = (parseInt(window.screen.width) - width) / 2;
                    TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                }
                attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                        height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                        TopPosition + '';
                var screenName = "DepositAccountCreation.jsp";
                var lovKey = "CifDetails2"
                popWin = open('/PacsApplication/CommonSearchInfoLOVNew.jsp?cifNumber=' + cifNumber + '&productCode=' + productCode + '&screenName=' + screenName + '&lovKey=' + lovKey + '&Counter=' + counter, 'CifDetails', attr);
                popWin.focus();

            }

            function popup_Nominee(width, height, cifNumber) {
                if (window.innerWidth) {
                    LeftPosition = (window.innerWidth - width) / 2;
                    TopPosition = ((window.innerHeight - height) / 2) - 20;
                } else {
                    LeftPosition = (parseInt(window.screen.width) - width) / 2;
                    TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                }
                attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                        height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                        TopPosition + '';
                var screenName = "DepositAccountCreation.jsp";
                var lovKey = "nominee"
                popWin = open('/PacsApplication/CommonSearchInformationDepositLOV.jsp?cifNumber=' + cifNumber + '&screenName=' + screenName + '&lovKey=' + lovKey, 'CifDetails', attr);
                popWin.focus();

            }

            function popup_productCode(width, height, productCodeDetails) {
                if (window.innerWidth) {
                    LeftPosition = (window.innerWidth - width) / 2;
                    TopPosition = ((window.innerHeight - height) / 2) - 20;
                } else {
                    LeftPosition = (parseInt(window.screen.width) - width) / 2;
                    TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                }
                attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                        height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                        TopPosition + '';
                var screenName = "DepositAccountCreation.jsp";
                var lovKey = "productCodeSearch"
                popWin = open('/PacsApplication/CommonSearchInformationDepositLOV.jsp?productCodeDetails=' + productCodeDetails + '&screenName=' + screenName + '&lovKey=' + lovKey, 'productCodeSearch', attr);
                popWin.focus();

            }

            $(document).on('change', '#inttrepmethod', function () {
                var shouldEnable = ($(this).val() !== 'T' && $(this).val() !== 'TR');
                document.forms[0].intttransacc.value = "";
                $('#intttransacc').prop('disabled', shouldEnable);
                $('#transferbutton').prop('disabled', shouldEnable);
            });

            function popup_savingsAcc(width, height, cifNumber) {
                if ($('#cifNumber').val() == "") {
                    alert("Please select CIF Number first !!");
                } else if ($('#inttrepmethod').val() == "") {
                    alert("Please select Interest Repayment Method  first !!");
                } else {
                    if (window.innerWidth) {
                        LeftPosition = (window.innerWidth - width) / 2;
                        TopPosition = ((window.innerHeight - height) / 2) - 20;
                    } else {
                        LeftPosition = (parseInt(window.screen.width) - width) / 2;
                        TopPosition = ((parseInt(window.screen.height) - height) / 2) - 20;
                    }
                    attr = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' +
                            height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
                            TopPosition + '';
                    var screenName = "DepositAccountCreation.jsp";
                    var lovKey = "SavingsAccSearch"
                    popWin = open('/PacsApplication/CommonSearchInformationDepositLOV.jsp?cifNumber=' + cifNumber + '&screenName=' + screenName + '&lovKey=' + lovKey, 'SavingsAccSearch', attr);
                    popWin.focus();
                }
            }
            <%--Added By Bitan For Multiple CIF Change--%>
            $(document).ready(function () {
                var counter = 2;

                $('select#holdType').change(function () {
                    var shouldEnable = $(this).val();
                    switch (shouldEnable)
                    {
                        case '1':
                            $('#TextBoxDiv1').hide();
                            $('#AddCif').hide();
                            break;
                        case '2':
                            $('#TextBoxDiv1').show();
                            $('#AddCif').show();
                            break;
                        default:
                            $('#TextBoxDiv1').hide();
                            $('#AddCif').hide();
                    }
                });

                $("#addButton").click(function () {
                    if (counter > 10) {
                        alert("Maximum of 10 Joint holders allowed per Account");
                        return false;
                    }
            <%--var newTextBoxDiv = $(document.createElement('tr'))
                 .attr("id", 'TextBoxDiv' + counter);
            newTextBoxDiv.after().html('<td><label>Secondary CIF Number #'+ counter + ' : </label></td>' +
                  '<td><input type="text" name="jt_cifNumber' + counter +
                  '" id="jt_cifNumber' + counter + '" value="" ><input type="button" name="cifSearch' + counter +
                  '" id="cifSearch' + counter + '" value="Search" onclick="javascript:popup_CIF2(650, 180, document.accCreatForm.jt_cifNumber' + counter+
                  '.value,document.accCreatForm.productCode.value,'+counter+');"/></td><td><input type="text" name="jt_name'+counter+'" readonly style="display:none" id="jt_name'+counter+'"/></td>');

        newTextBoxDiv.appendTo("#TextBoxesGroup");--%>
                    var newCif = $(document.createElement('tr')).attr("id", 'TextBoxDiv' + counter);
                    newCif.after().html('<td><label>Secondary CIF Number #' + counter + ' : </label></td>' +
                            '<td><input type="text" name="jt_cifNumber' + counter +
                            '" id="jt_cifNumber' + counter + '" value="" >\n\
               <input type="button" name="cifSearch' + counter +
                            '" id="cifSearch' + counter + '" value="Search" onclick="javascript:popup_CIF2(650, 180, document.accCreatForm.jt_cifNumber' + counter +
                            '.value,document.accCreatForm.productCode.value,' + counter + ');"/></td><td><input type="text" name="jt_name' + counter + '" readonly style="display:none" id="jt_name' + counter + '"/></td>');

                    newCif.insertBefore("#AddCif");
                    counter++;
                });

                $("#removeButton").click(function () {
                    if (counter == 1) {
                        alert("No more CIF to remove");
                        return false;
                    }
                    counter--;
                    $("#TextBoxDiv" + counter).remove();
                });
            });

            // to restrict back button
            history.pushState(null, null, location.href);
            window.addEventListener('popstate', function (event) {
                history.pushState(null, null, location.href);
            });

        </script>


        <%
            String error_msg = "";
            Object error = request.getAttribute("message");
            if (error != null) {
                error_msg = error.toString();
            }
        %>

        <jsp:include page="MenuHead_Deposit.jsp" flush="true" />
        <br>

        <%!
            String blankNull(String s) {
                return (s == null) ? "" : s;
            }
        %>

        <fieldset style="border-color: black; background-image: url('/PacsApplication/img/download.jpg'); border-width: 3px">
            <legend style="padding: 8px; border-radius: 20px; background-color: #006600; color: white">Deposit Account Creation</legend>

            <form name="accCreatForm" method="post" onsubmit="return checkDiv(this)" action="DepositAccountCreationServlet">

                <%if (!error_msg.equalsIgnoreCase("")) {%>
                <center><div class="info" id="errorMessage"><center><%= error_msg%></center></div></center>
                            <% }%>
                <br>

                <div id="create" align="left">

                    <table id="depositAccTableID">
                        <tr><td><hr></td></tr>
                        <tr><td><h3>Account Information:</h3></td></tr>
                        <tr>
                            <td><lable>Product Code<font color="red" >*</font>:</lable></td>
                        <td><input type="text" id="productCodeDetails" name="productCodeDetails" readonly>
                            <input type="button" name="productCodeSearch" id="productCodeSearch" value="Search" onclick="javascript:popup_productCode(420, 280, document.accCreatForm.productCodeDetails.value);"/></td>

                        </tr>
                        <tr>
                            <td><lable>Interest Category<font color="red" >*</font>:</lable></td>
                        <td><input type="text" id="inttCatDetails" name="inttCatDetails" readonly="true"></td>
                        </tr>

                        <tr>
                            <td><lable>Segment Code<font color="red" >*</font>:</lable></td>
                        <td>
                            <select id="segmentCode" name="segmentCode">
                                <option value="" disabled selected style="display:none;">--Select--</option>
                                <option value="0706">0706:INDIVIDUAL</option>
                                <option value="0306">0306:STAFF</option>
                                <option value="5003">5003:SENIOR CITIZEN</option>
                                <option value="5010">5010:SHG</option>
                                <option value="5000">5000:BANKS</option>
                                <option value="5009">5009:INSTITUTIONS</option>
                                <option value="5050">5050:OTHERS</option>
                                <option value="5007">5007:SOCIETY</option>
                                <option value="5011">5011:GOV/SEMI GOV</option>
                                <option value="5012">5012:PACS</option>
                                <option value="5013">5013:UCB</option>
                                <option value="5014">5014:SCB</option>
                                <option value="5015">5015:CCB</option>
                            </select>
                        </td>
                        </tr>
                        <tr>
                            <td>Account Holder Type:</td>
                            <td><select id="holdType" name="holdType" >
                                    <option value="" disabled selected style="display:none;">--Select--</option>
                                    <option value="1">Single</option>
                                    <option value="2">Joint</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td><lable>Primary CIF Number<font color="red" >*</font>:</lable></td>
                        <td><input type="text" id="cifNumber" name="cifNumber" style="text-align:right;" onkeypress='return event.charCode >= 48 && event.charCode <= 57'>
                            <input type="button" name="cifNumberSearch" id="cifNumberSearch" value="Search" onclick="javascript:popup_CIF(650, 180, document.accCreatForm.cifNumber.value, document.accCreatForm.productCode.value);"/></td>
                        <td><input type="text" readonly style="display:none" id="name1" name="name1"/></td>
                        </tr>

                        <%-- <tr id="forJoint" style="display:none">
                             <td><lable>Secondary CIF Number :</lable></td>
                         <td><input type="text" id="cifNumber2" name="cifNumber2">
                             <input type="button" name="cifNumberSearch2" id="cifNumberSearch2" value="Search" onclick="javascript:popup_CIF2(650, 180, document.accCreatForm.cifNumber2.value,document.accCreatForm.productCode.value);"/></td>
                         <td><input type="text" readonly style="display:none" id="name2" name="name2"/></td>
                         </tr>--%>
                        <%--Added By  Bitan for Multiple CIF Change--%>
                        <%--<tr id='TextBoxesGroup' style="display:none">--%>
                        <%-- <tr id="TextBoxDiv1">
                          <td><label>Textbox #1 : </label><input type='textbox' id='textbox1' ></td>
                        </tr>--%>

                        <tr id='TextBoxDiv1' style="display:none">
                            <td><label>Secondary CIF Number #1: </label></td>
                            <td><input type="text" name="jt_cifNumber1" id="jt_cifNumber1" value="" >
                                <input type="button" name="cifSearch1" id="cifSearch1" value="Search" onclick="javascript:popup_CIF2(650, 180, document.accCreatForm.jt_cifNumber1.value, document.accCreatForm.productCode.value, 1);"/></td>
                            <td><input type="text" name="jt_name1" readonly style="display:none" id="jt_name1"/></td>
                        </tr>
                        <tr id="AddCif" style="display:none">
                            <td><input type='button' value='Add CIF' id='addButton'></td>
                            <td><input type='button' value='Remove CIF' id='removeButton'></td>
                        </tr>


                        <tr>
                            <td>OD Limit:</td>
                            <td><input type="text" id="ODlimit" name="ODlimit"></td>
                        </tr>

                        <tr>
                            <td><input type="button" name="nomineebtn" id="nomineebtn" value="Add Nominee" onclick="javascript:showNominee();" /></td>
                        </tr>
                        <tr id="addnominee" style="display:none">
                            <td><lable>Nominee CIF Number:</lable></td>
                        <td><input type="text" id="nominee" name="nominee">
                            <input type="button" name="nomineeSearch" id="nomineeSearch" value="Search" onclick="javascript:popup_Nominee(650, 180, document.accCreatForm.nominee.value);"/></td>
                        <td><input type="text" readonly style="display:none" id="nomineeName" name="nomineeName"/></td>
                        </tr>

                        <tr><td><hr></td></tr>
                        <tr><td><h3>Additional Information:</h3></td></tr>

                        <tr>
                            <td><lable>Activity Code<font color="red" >*</font>:</lable></td>
                        <td>
                            <select id="activityCode" name="activityCode">
                                <option value="" disabled selected style="display:none;">--Select--</option>
                                <option value="1">Direct Agriculture</option>

                                <option value="2">Indirect Agriculture</option>
                                <option value="3">Agricultural Service Units</option>
                                <option value="4">Farm Irrigation</option>
                                <option value="5">Fruits & Vegetables</option>
                                <option value="6">Non-Agriculture</option>
                            </select>
                        </td>
                        </tr>
                        <tr>
                            <td><lable>Customer Type<font color="red" >*</font>:</lable></td>
                        <td>
                            <select id="customerType" name="customerType">
                                <option value="" disabled selected style="display:none;">--Select--</option>
                                <option value="I">Individual</option>
                                <option value="C">Corporate</option>
                            </select>
                        </td>
                        </tr>
                        <tr>
                            <td>Interest Repay Method:</td>
                            <td><select id="inttrepmethod" name="inttrepmethod">
                                    <option value="" disabled selected style="display:none;">--Select--</option>
                                    <option value="T">Transfer</option>
                                    <option value="TR">Transfer and Renew</option>
                                    <option value="R">Auto-renew</option>
                                    <option value="F">Freeze</option>
                                </select></td>
                        </tr>
                        <tr>
                            <td>Interest Transfer Account:</td>
                            <td><input type="text" id="intttransacc" name="intttransacc" disabled><input type="button" name="transferbutton" id="transferbutton" value="Search" onclick="javascript:popup_savingsAcc(420, 280, document.accCreatForm.cifNumber.value);"/></td>
                        </tr>

                        <tr>
                            <td><input type="hidden" id="intRate" name="intRate" value="" onkeypress='return event.charCode >= 46 && event.charCode <= 57'></td>
                        </tr>
                        <tr>
                            <td><input type="hidden" id="penIntRate" name="penIntRate" value="" onkeypress='return event.charCode >= 46 && event.charCode <= 57'></td>
                        </tr>

                    </table>
                    <br><br><br>
                    <center>
                        <input type="button" value="Submit" onclick="javascript:submitform(accCreatForm)">
                        <input type="button" value="Reset" name="reset" onclick="ShowParent();" />
                    </center>
                    <tr><td><br></td></tr>
                    <tr><td><br></td></tr>
                    <label style=" font-family: Berlin Sans FB; font-weight:normal; ">All fields are mandatory</label>
                </div>
                <input type="hidden" name="handle_id" value="" />
                <input type="hidden" name="productCode" value="" />
                <input type="hidden" name="inttCategory" value="" />

            </form>
            <script>
                $('div#create').on('keydown', '#ODlimit,#termValue,#termYears,#termMonth,#termDays,#instAmt', function (event) {

                    if (event.shiftKey == true) {
                        event.preventDefault();
                    }

                    if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105) || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 46 || event.keyCode == 190) {

                    } else {
                        event.preventDefault();
                    }

                    if ($(this).val().indexOf('.') !== -1 && event.keyCode == 190)
                    {
                        event.preventDefault();
                    }

                });
            </script>
        </fieldset>
    </body>
</html>
<% 	} catch (Exception e) {
       
    }
%>
