<%@ Page Language="vb" Async="true" AutoEventWireup="true" MasterPageFile="~/FiniqAppMasterPage.Master" CodeBehind="FinIQ_UCPDealEntry.aspx.vb" Inherits="FinIQWebApp.FinIQ_UCPDealEntry" EnableEventValidation="false" EnableViewState="true" ViewStateEncryptionMode="Always" ValidateRequest="false"%>


<%@ Register Src="~/UCP/DealDetailsControls/FinIQ_UCPCTL_Control.ascx" TagPrefix="uc1" TagName="FinIQ_UCPCTL_Control" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCPSchedule.ascx" TagPrefix="uc2" TagName="UCPSchedule" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_SubscriptionTab_Control.ascx" TagPrefix="uc3" TagName="UCPSubScription" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_TraceEdit_Control.ascx" TagPrefix="uc4" TagName="UCPTraceEdit" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_IndexMaster_Control.ascx" TagPrefix="uc5" TagName="UCPIDXMST" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_Payoff_Control.ascx" TagPrefix="uc6" TagName="UCPPayoff" %>
<%--<%@ Register Src="~/UCP/DealDetailsControls/Mutation_Control.ascx" TagPrefix="uc7" TagName="UCPMutation" %>--%>
<%@ Register Src="~/UCP/DealDetailsControls/FinIQ_Package_Schedule.ascx" TagPrefix="uc8" TagName="UCPPackageSchedule" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_Payments_Control.ascx" TagPrefix="uc9" TagName="UCPPayments" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_Documents_Control.ascx" TagPrefix="uc10" TagName="UCPDocuments" %>
<%--<%@ Register Src="~/UCP/DealDetailsControls/UCP_Unwind_Control.ascx" TagPrefix="uc11" TagName="UCPUnwind" %>--%>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_ProductAmendment_Control.ascx" TagPrefix="uc12" TagName="ProductAmend" %>
<%@ Register Src="~/UCP/DealDetailsControls/FinIQ_UCPViewSchedule.ascx" TagPrefix="uc13" TagName="UCPViewSchedule" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_Suitability_Control.ascx" TagPrefix="uc14" TagName="UCPSuitability" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_Event.ascx" TagPrefix="uc15" TagName="FinIQ_Event" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_GL.ascx" TagPrefix="uc16" TagName="FinIQ_UCPGL" %>
<%--<%@ Register Src="~/UCP/DealDetailsControls/UCP_CorporateActions_Control.ascx" TagPrefix="uc17" TagName="UCPCorpActions" %>--%>
<%--<%@ register src="~/UCP/DealDetailsControls/UCP_FeesTab.ascx" tagprefix="ucFees" tagname="UCP_FeesTab" %>--%>
<%@ Register Src="~/UCP/DealDetailsControls/UCPPayoffSimulationTab.ascx" TagPrefix="ucWhatIf" TagName="UCP_WhatIf" %>
<%@ Register Src="~/UCP/DealDetailsControls/Mutation.ascx" TagPrefix="uc17" TagName="UCPMutation" %>
<%@ Register Src="~/UCP/DealDetailsControls/ViewPayoff_Control.ascx" TagPrefix="uc18" TagName="ViewPayoff" %>
 
<%@ Register Src="~/Workflow/Trade_Workflow_Blotter_CTL.ascx" TagPrefix="ucWorkflow" TagName="WorkFlowControl" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<%@ Register Src="~/UCP/DealDetailsControls/VolSpotBlotter.ascx" TagPrefix="uc19" TagName="VolSpot" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_EventFixingBlotter_Control.ascx" TagPrefix="uc20" TagName="EventFixingBlotter" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_Trace_Control.ascx" TagPrefix="uc21" TagName="UCPTrace" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_Holdings_Control.ascx" TagPrefix="uc22" TagName="ucHoldings" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_CorporateActions_Control.ascx" TagPrefix="uc23" TagName="UCPCorpActions" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_CorporateActionsWithChoice_Control.ascx" TagPrefix="uc24" TagName="UCCorpACWCH" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_FeesTab.ascx" TagPrefix="uc25" TagName="UCP_FeesTab" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_Equity_Volatility_ThreePoint.ascx" TagPrefix="uc26" TagName="UCPEquityVol" %>

<%--<%@ Register Src="~/UCP/DealDetailsControls/UCP_Equity_Dividend_Control.ascx" TagPrefix="uc27" TagName="EquityDividend" %>--%>

<%--<%@ Register Src="~/UCP/DealDetailsControls/UCP_MTM_Price.ascx" TagPrefix="uc28" TagName="MTMPrice" %>--%>

<%--<%@ Register Src="~/UCP/DealDetailsControls/Product_ScheduleControl.ascx" TagPrefix="uc29" TagName="ProdcutSchedule" %>--%>
<%--<%@ Register Src="~/UCP/DealDetailsControls/MutatingSchedule.ascx" TagPrefix="uc30" TagName="MutatingSchedule" %>--%>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_ProductSchedule.ascx" TagPrefix="uc31" TagName="UCP_ProdcutSchedule" %>

<%@ Register Src="~/UCP/DealDetailsControls/NewEVTFIX_Control.ascx" TagPrefix="uc32" TagName="NewEVTFIX" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_Entitlements.ascx" TagPrefix="uc33" TagName="UCPEntitlements" %>

<%@ Register Src="~/UCP/DealDetailsControls/UCPPayoffSimulationTab_PayoutScenarios.ascx" TagPrefix="uc34" TagName="PayoutScenarios" %>
<%@ Register Src="~/UCP/DealDetailsControls/UCP_ResetDateSchedule.ascx" TagPrefix="uc35" TagName="UCPResetDateSchedule" %>
<%--Added by VijayH || 11-May-2022 || For MPG Master Tab--%>
<%@ Register Src="~/UCP/DealDetailsControls/FinIQ_MPG_Master.ascx" TagPrefix="uc36" TagName="FinIQMPGMaster" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <link href="../FinIQJS/DateTimePicker.css" rel="stylesheet" type="text/css" />
    <script src="../FinIQJS/DateTimePicker.js" type="text/javascript"></script>
    <script src="../UCP/UCPJS/DealEntry.js" type="text/javascript"></script>
   <%-- Added by Arati K || 11-Mar-2022 for workflow filters --%>
	<script src="../FinIQJS/WorkflowGlobal.js?v=111"></script>
    <script src="../FinIQJS/SortFilter_Grid.js"></script>
    <link href="../FinIQJS/FreezeGrid.css" rel="stylesheet" type="text/css" />
    <script src="../FinIQJS/FreezeGrid.js"></script>
    <style type="text/css">
	
	  /*Added by Neeral */
	.UCP_LeftSide_Filter{
vertical-align: top !important;
}
	  /*Added by Neeral */
	  
        .pnlLinkLabelsHorizontal{
                 overflow: unset !important; 
     overflow-y: unset !important;  
     width: unset !important; 
     height: unset !important;  
     max-height: unset !important; 
     padding: unset !important; 
     border: unset !important; 
     border-collapse: unset !important; 
        }
	  

        /*Added by MohiniM || 21-Jan-21 for msgbox -start*/
         .ui-dialog-content p {
    padding: 10px !important;
}  
        /*Added by MohiniM || 21-Jan-21 for msgbox -end*/

        object {background-color: transparent !important;}
        cl .txtAreaWidth {
            width: 100% !important;
        }
.CloseDetails, .CloseDetails:hover {
    text-align: center !important;
    font: normal 9px verdana !important;
    height: 15px !important;
    border-collapse: collapse !important;
    padding-bottom: 0px;
    padding-top: 0px;
    border-radius:5px;

}


    .CloseDetails[disabled="disabled"] {
        text-align: center !important;
        font: normal 11px verdana !important;
        height: 15px !important;
        border-collapse: collapse !important;
        padding-bottom: 5px;
        padding-top: 5px;
           border-radius:5px;

    }

    .CloseDetails:hover {
        border: solid 1px #CCCCCC !important;
        color: #000000 !important;
        background-color: #f6f6f6 !important;
        cursor: pointer !important;
    }

.CloseDetails {
    cursor: default !important;
    border: solid 1px #DDDDDD !important;
    color: #333333 !important;
    background-color: #ededed !important;
    filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ededed',EndColorStr='#dfdfdf') !important; /**/
}

    .CloseDetails[disabled="disabled"] {
        border: solid 1px #f2f2f2 !important;
        background-color: #F2F2F3 !important;
        COLOR: #CCCCCC !important;
    }


    .CloseDetails:visited {
        background-color: #dddddd;
       border: solid 1px #DDDDDD !important;
        color: #333333;
        font-size: 11px;
    }


.pnlLinkLabels a:link, .pnlLinkLabels a:visited, .pnlLinkLabels span {
    height: 15px !important;
    line-height: 15px !important;
    padding: 5px 15px 5px 0px; 
}

//added By neeral
        .bullet{
                margin-top: 1px;
        }
        
        .pnlLinkLabelsHorizontal a:link, .pnlLinkLabelsHorizontal a:visited, .pnlLinkLabelsHorizontal span {
           width:max-content !important;
           padding:0px 15px 0px 0px;
        }
        .tableLinkButtons td a, .tableLinkButtons td span  {
          

        }
        .templatelist {
         white-space: normal !important; 
         width: 130px !important;
         padding:10px !important;
        }
         .displayNone {
            display: none;
        }

         /*25-May-2021 AkshayD, Shekhar Sir, PrashantM to keep the height of button aligned with TD*/
         .gbMasterTable  .gbTable .btn {
    height: 23px !important;
    line-height: 12px;
    box-sizing: border-box;
}
         .leftNav {
            /*width: 30px;*/
            padding: 5px;
            padding-right: 28px !important;
            border-right: solid 1px #ddd;
            border-collapse: collapse;
            /*background-image: url("Img/rightNav.png");*/
            background-image: url("../App_Resources/Img/rightNav.png");
            background-repeat: no-repeat;
            vertical-align: middle;
        }
        /*changed by Prachi Patil*/
        .rightNav {
            /*width: 30px;*/
            padding: 10px;
            padding-left: 28px !important;
            border-left: solid 1px #ddd;
            border-collapse: collapse;
            background-image: url("../App_Resources/Img/leftNav.png");
            /*background-image: url("Img/leftNav.png");*/
            background-repeat: no-repeat;
            vertical-align: middle;
        }
    </style>
    <script>
        //Added by TejaswiniB on 6-Mar-2020 for SubScription-Tab cheked event
        function chkBxLst_Changed(txt, evt) {
            
            for (var iCnt = 0; iCnt < txt.children[0].rows.length-1; iCnt++) {
                if (txt.children[0].children[iCnt].children[0].children[0].checked == true) {
                    document.getElementById("ctl00_MainContent_oUCPSubScription_btnSample").click();
                }
            }
        }
        //start by swatiP
              function openNav(param) {
                  //
                  if (param != 'tabs') {
                      if ((document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields").style.display == "block") || (document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields").style.display == "")) {
                          if (document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields") != null)
                              document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields").setAttribute("style", "display:none");
                          if (document.getElementById("ctl00_MainContent_hdnStaticFields") != null)
                              document.getElementById("ctl00_MainContent_hdnStaticFields").value = "none";
                      }
                      else if (document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields").style.display == "none") {
                          if (document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields") != null)
                              document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields").setAttribute("style", "display:block");
                          if (document.getElementById("ctl00_MainContent_hdnStaticFields") != null)
                              document.getElementById("ctl00_MainContent_hdnStaticFields").value = "block";
                      }
                  }
                  else {
                      if (document.getElementById("ctl00_MainContent_hdnStaticFields").value == "block") {
                          if (document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields") != null)
                              document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields").setAttribute("style", "display:block");
                          if (document.getElementById("ctl00_MainContent_hdnStaticFields") != null)
                              document.getElementById("ctl00_MainContent_hdnStaticFields").value = "block";
                      }
                      else if (document.getElementById("ctl00_MainContent_hdnStaticFields").value == "none") {
                          if (document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields") != null)
                              document.getElementById("ctl00_MainContent_oUCPCtrl_pnlStaticSelectionFields").setAttribute("style", "display:none");
                          if (document.getElementById("ctl00_MainContent_hdnStaticFields") != null)
                              document.getElementById("ctl00_MainContent_hdnStaticFields").value = "none";
                      }
                  }
                  }
        //END by swatiP
		//added by devesh on 5/12/2019 for function definition chkexecution changes
        //Added by RajeshC after discussion with ShekharL for BBVAORINT-219
		 function checkallbox(evt) {
                     $(evt).closest('table.Grid').find('.GridItem input[type="checkbox"]').each(function (i, chk) {
                         if ($(evt).is(":checked")) {
                             $(this).prop("checked", true).attr("checked", "checked");
                         } else {
                             $(this).removeAttr("checked");
                         }
                     });
             }
            // //var checkboxlist = evt.parentNode.parentNode.parentNode;
            // //console.log("CheckboxList", checkboxlist);
            // debugger;
            // var checkboxlist = $(evt).closest('tbody').find('input[type="checkbox"]')
            ////var checkboxes = checkboxlist.getElementsByTagName("INPUT");
            // var checkboxes = checkboxlist;
            // if (checkboxes[1].checked) {
            //    for (var i = 0; i < checkboxes.length; i++) {
            //        checkboxes[i].checked = true;
            //    }
            //}
            //else {
            //    for (var i = 0; i < checkboxes.length; i++) {
            //        checkboxes[i].checked = false;
            //    }

            // }
            // console.log("Checboxes", checkboxes);
       // }
	    //Added by RajeshC after discussion with ShekharL for BBVAORINT-219
        function checkchanged(evt) {
            chkAll = $(evt).closest('table.Grid').find('.GridItem input[type="checkbox"]').length;
            chkCount = $(evt).closest('table.Grid').find('.GridItem input[type="checkbox"]:checked').length;

            if (chkAll === chkCount) {
                $(evt).closest('table.Grid').find('.GridHeader input[type="checkbox"]').prop("checked", true).attr("checked", "checked");
            }
            else {
                $(evt).closest('table.Grid').find('.GridHeader input[type="checkbox"]').prop("checked", false).removeAttr("checked");;
            }
            ////var checkboxlist = evt.parentNode.parentNode.parentNode;
            ////var checkboxes = checkboxlist.getElementsByTagName("INPUT");
            //var checkboxlist = $(evt).closest('tbody').find('input[type="checkbox"]');
            //var checkboxes = checkboxlist;
            //var count = 0;
            //for (var i = 1; i < checkboxes.length; i++) {
            //    if (checkboxes[i].checked == true)
            //        count++;
            //}
            //if (count == checkboxes.length - 1) {
            //    checkboxes[0].checked = true;
            //}
            //else {
            //    checkboxes[0].checked = false;
            //}
        }
        //Added by Devesh J as told by Shekhar sir on 12-Jan-2021 </start>
        function displayMessage(evt) { 
           // alert(1);
            $(document).find('[id$="lnkCloseUCPPopUP"]')[0].click();
        }
        if (window.addEventListener) {
            // For standards-compliant web browsers
            window.addEventListener("message", displayMessage, false);
        }
        else {
            window.attachEvent("onmessage", displayMessage);
        }
        //</end>
        //Added by VijayH for MPG Master
        //Start
        function ToggleNAVClass(control) {
            $("#" + control.id).removeClass("leftNav");
            $("#" + control.id).toggleClass("rightNav");

            if ($("#" + control.id).attr('class') == "rightNav") {
                $("#ctl00_MainContent_oFinIQMPGMaster_txtSliderPosition").val(1);
                $('.tblMainPE').stop().animate({
                    left: (-1 * 550) + 'px'
                }, 0);/* Modified by Saili D/Akanksha P on 28 July 2020 || For increasing the speed of filter tab */
            }
            else {
                $("#" + control.id).toggleClass("leftNav");
                $("#ctl00_MainContent_oFinIQMPGMaster_txtSliderPosition").val(0);
                $("#" + control.id).removeClass("rightNav");
                $('.tblMainPE').stop().animate({
                    left: (0) + 'px'
                }, 0); /* Modified by Saili D/Akanksha P on 28 July 2020 || For increasing the speed of filter tab */
            }
        }

        function ShowHideMasterFilter() {
            if ($('#ctl00_MainContent_oFinIQMPGMaster_btnHideFilter1').attr("class") == 'btnShow') {
                $('#FilterPad').slideDown(500);
                $('#ctl00_MainContent_oFinIQMPGMaster_btnHideFilter1').attr("class", "btnHide");
                $('#ctl00_MainContent_hdn_showmasterfilter').val("Show");
                $("#ctl00_MainContent_txtSliderPosition").val(1)
            }
            else if ($('#ctl00_MainContent_oFinIQMPGMaster_btnHideFilter1').attr("class") == 'btnHide') {
                $('#FilterPad').slideUp(500);
                $('#ctl00_MainContent_oFinIQMPGMaster_btnHideFilter1').attr("class", "btnShow");
                $('#ctl00_MainContent_hdn_showmasterfilter').val("Hide");
                $("#ctl00_MainContent_txtSliderPosition").val(0)
            }
        }

        function HideMasterFilters() {
            $("#ctl00_MainContent_PENav").toggleClass("rightNav");
            $("#ctl00_MainContent_PENav").removeClass("leftNav");
            $("#ctl00_MainContent_txtSliderPosition").val(1);
            $('.tblMainPE').stop().animate({
                left: (-1 * 550) + 'px'
            }, 0);
        }
        //End

    </script>
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>
    <link href="../App_Themes/UCPCTL.css" rel="stylesheet" type="text/css" />
    <ajax:modalpopupextender id="mp1" runat="server" popupcontrolid="Panl1" targetcontrolid="Button1"
        cancelcontrolid="Button2" backgroundcssclass="Background">
    </ajax:modalpopupextender>
    <asp:Panel ID="Panl1" runat="server" CssClass="Popup" Style="vertical-align: top; text-align: center; display: none;">
        <asp:Button ID="Button2" runat="server" Text="" CssClass="CloseButton" />
        <br />
       <%-- <iframe id="irm1" src="#"></iframe>--%>		<%--Commented by PranavT to avoid double postback; PLEASE DO NOT UNCOMMENT WITHOUT ASKING --%>
    </asp:Panel>
    <asp:ScriptManagerProxy ID="ScriptManagerProxy2" runat="server">
    </asp:ScriptManagerProxy>
    <asp:UpdatePanel ID="updpnl_new" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" EnableViewState="true">



        <ContentTemplate>
            <div id="divWarning" runat="server"  >
                <asp:BulletedList ID="BulletedList1" CssClass="lstWarning" runat="server"></asp:BulletedList>

            </div>
            <table style="padding: 0px; border: none 0px; border-collapse: collapse;">
                <tr>
                    <td style="vertical-align: top; text-align: left;" colspan="2" class="formHeader">


                        <table style=" min-width: 1220px; max-width: 1880px;" class="UCPDealEntryTBLHeader">  <%--removed width by SwatiP || Shekar sir on 1-9-2021 JIRA ID BOCISSINT-671 Deal Lock Changes--%>
                            <tr>
                                <td align="left" valign="top" style="width: 305px;">
                                    <table style="padding: 0px; border: none 0px; border-collapse: collapse;">
                                        <tr>
                                            <td colspan="2">
                                                <asp:Label ID="lblFinIQ" CssClass="FinIQ" runat="server" Text="FinIQ"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <asp:Label ID="lblComapnyName" CssClass="ComapnyName" runat="Server" Text="The Financial Engineering Company"></asp:Label>
                                            </td>

                                            <td></td>
                                            <td></td>
                                        </tr>
                                        <tr>
                                            
                                        </tr>
                                    </table>

                                </td>
                                <td align="left" valign="top" style="width: 550px;">
                                    <table>
                                        <tr >
                                            <td>
                                                <asp:Label ID="lblStatus" runat="server" Visible="false"></asp:Label>
                                                <asp:Label ID="lblErrorMessage" runat="server" Visible="false"></asp:Label><br />
                                                <asp:Label ID="lblProductDisplayName" runat="server" Font-Size="15px"></asp:Label>
                                                 
                                            </td>
                                            
                                        </tr>
                                        <tr><td></td></tr>
<%--                                        <tr>
                                            <td>
                                                
                                               
                                            </td>

                                        </tr>--%>
                                    </table>
                                </td>
                                <td style="text-align: right;">   <%--added width:42vw; width by SwatiP || Shekar sir on 1-9-2021 JIRA ID BOCISSINT-671 Deal Lock Changes--%>
                                    <%--  <asp:ListBox ID="lstWarning" CssClass="txt lstWarning" runat="server" Width="250px" Height="80px"></asp:ListBox>--%>
                                    <%--<asp:UpdatePanel ID="updatePanelWarningText" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" EnableViewState="true">
                                         <ContentTemplate>
                                              <ul id="ContainerWarning" class="lstWarning" runat="server" enableviewstate="true">  </ul>
                                           
                                         </ContentTemplate>
                                         
                                         </asp:UpdatePanel>--%>


                                    
                                </td>
                            </tr>

                        </table>
                    </td>

                </tr>

                <tr>
                    <td>
                        <table>
                            <tr>
                                <td style="vertical-align: top; text-align: left;">
                                                <table style="padding: 0px; border: none 0px; border-collapse: collapse;">
                                                    <tr>
                                                        <td style="vertical-align: top; text-align: left; width: 10PX">
                                                            <asp:LinkButton runat="server" Text="Show Tabs" ID="lnkShowTabs1" Style="color: blue; text-decoration: none; color: #0284e0; white-space: nowrap !important;"></asp:LinkButton>
                                                        </td>
                                                        <td style="vertical-align: top; text-align: left; width: 10PX">
                                                            <asp:LinkButton runat="server" Text="Show Templates" ID="lnkShowTemplates1" Style="margin-left: 20px; color: blue; text-decoration: none; color: #0284e0; white-space: nowrap !important;"></asp:LinkButton>
                                                        </td>
                                                        <td style="vertical-align: top; text-align: left; width: 10px"> <%--changed Close Pop Up to Close by OnkarE on 12-May-2022--%>
                                                            <asp:LinkButton ID="lnkCloseUCPPopUP" runat="server" Text="Close" Style="margin-left: 0px; color: red; text-decoration: none; white-space: nowrap !important;" Visible="false" />
                                                        </td>
                                                        <td style="vertical-align: top; text-align: left; width: 10PX">
                                                            <asp:LinkButton ID="lnkInputFreshRecord" runat="server" Text="Input Fresh Record" Style="margin-left: 20px; color: blue; text-decoration: none; color: #0284e0; white-space: nowrap !important;" />
                                                        </td>
                                                        <td style="vertical-align: top;" id="tdUCPTabsHorizontal" runat="server" visible="false">
                                                            <asp:Panel ID="pnlLinkLabelsContainerHorizontal" runat="server" style="    margin-top: -5px;"  CssClass="filter1">
                                                                <table>             
                                                                    <tr>
                                                                        <td colspan="3" style="vertical-align: top; text-align: left;">
                                                                            <asp:UpdatePanel ID="UpdatePanel_LinkLabelsHorizontal" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" EnableViewState="true">
                                                                                <ContentTemplate>
                                                                                    <asp:Panel ID="pnlLinkLabelsHorizontal" CssClass="pnlLinkLabels pnlLinkLabelsHorizontal" runat="server"></asp:Panel>
                                                                                </ContentTemplate>

                                                                            </asp:UpdatePanel>
                                                                        </td>
                                                                    </tr>
                                                                </table>

                                                            </asp:Panel>
                                                        </td>
                                                        <td></td>
                                                    </tr>
                                                </table>
                                            </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                   <%-- <td style="vertical-align: top; text-align: left;"></td>--%>
                    <td style="vertical-align: top; text-align: left;">
                        <asp:UpdateProgress AssociatedUpdatePanelID="updpnl_new" ID="upUCPCTL" runat="server">
                            <ProgressTemplate>
                                <div class="UpdateProgress" style="top: 0px; height: 1000px; background-color: #FFFFFF; opacity: 0; filter: alpha(opacity=0); vertical-align: middle; left: 0px; z-index: 99999; position: absolute; text-align: center;">
                                </div>

                            </ProgressTemplate>
                        </asp:UpdateProgress>
                        <table>
                            <tr><%-- Changed by Rohit T. 12-May-2022 --%>
                                <td style="position:relative;">
                                    <span style="font-size: 15px; cursor: pointer; position: absolute; min-width: 5px; z-index: 9998; color: white; left: 10px; top: 50%; transform: translate(0%, -50%);" onclick="openNav('onload')">&#9776;</span>
                                    <asp:Button ID="btnDealEntry" UseSubmitBehavior="false" runat="server" Text="Deal Entry" CssClass="CollpseCSS" OnClick="btnDealEntry_Click" style="padding-left:40px"/>
                                </td>
                            </tr>


                            <tr>
                                <td>
                                    <asp:Panel runat="server" ID="pnlAjaxDealEntry">
                                        <div>
                                            <table>
                                                <tr>
                                                    <td style="vertical-align: top;" id="tdUCPTabs" runat="server" visible="false">
                                                        <asp:Panel ID="pnlLinkLabelsContainer" runat="server" CssClass="filter1">
                                                            <table>



                                                                <tr>
                                                                    <td style="vertical-align: top; text-align: left;">
                                                                        
                                                                        <asp:TextBox ID="txtSerachTabPage" runat="server" onfocus="this.select();" onmouseup="return false;" AutoPostBack="true" EnableViewState="true" Width="150px" onkeydown="return EnterEvent(event)"></asp:TextBox></td>
                                                                    <td style="vertical-align: top; text-align: left;">
                                                                        <asp:ImageButton ID="pbSearch" runat="server" ImageUrl="~/App_Resources/magnifier.png" Width="25px" OnClick="pbSearch_Click" /></td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="3" style="vertical-align: top; text-align: left;">
                                                                        <asp:UpdatePanel ID="UpdatePanel_LinkLabels" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" EnableViewState="true">
                                                                            <ContentTemplate>
                                                                                <asp:Panel ID="pnlLinkLabels" CssClass="pnlLinkLabels" runat="server"></asp:Panel>
                                                                            </ContentTemplate>

                                                                        </asp:UpdatePanel>
                                                                    </td>

                                                                </tr>
                                                            </table>

                                                        </asp:Panel>
                                                    </td>

                                                    <td style="vertical-align: top;" id="tdUCPTemplates" runat="server" visible="false">
                                                        <asp:Panel ID="Panel12" runat="server" CssClass="filter1">



                                                            <table>

                                                                <tr>
                                                                    <td style="vertical-align: top; text-align: left; margin-left: 25px;">
                                                                        <asp:TextBox ID="txtSearchTemplatePage" runat="server" onfocus="this.select();" onmouseup="return false;" AutoPostBack="true" EnableViewState="true" Width="150px" onkeydown="return EnterEvent(event)"></asp:TextBox></td>
                                                                    <td style="vertical-align: top; text-align: left;">
                                                                        <asp:ImageButton ID="pbSearchTemplate" runat="server" ImageUrl="~/App_Resources/magnifier.png" Width="25px" OnClick="pbSearch_Click" /></td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="3" style="vertical-align: top; text-align: left;">
                                                                        <asp:UpdatePanel ID="UpdatePanel_LinkTemplates" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" EnableViewState="true">
                                                                            <ContentTemplate>
                                                                                <asp:Panel ID="pnlLinkTemplates" CssClass="pnlLinkLabels" style="min-width:160px;" runat="server"></asp:Panel> <%--Width style changed by OnkarE on 30-Apr-2022 as per discussion with ChandrashekharL JIRA:BBVAORINT-237--%>
                                                                            </ContentTemplate>

                                                                        </asp:UpdatePanel>
                                                                    </td>

                                                                </tr>
                                                            </table>



                                                        </asp:Panel>
                                                    </td>
                                                    <td style="vertical-align: top; text-align: left;">
                                                        <asp:UpdatePanel ID="UpdatePanel_UCPCTL" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" EnableViewState="true">

                                                            <ContentTemplate>
                                                                <asp:Panel ID="pnlCTL" runat="server" EnableViewState="true" ScrollBars="Auto">
                                                                    <uc1:finiq_ucpctl_control runat="server" id="oUCPCtrl" visible="true" enableviewstate="true" />
                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlSchedule" runat="server" Visible="false">
                                                                    <uc2:ucpschedule runat="server" id="oUCPShedule" visible="true" />
                                                                </asp:Panel>


                                                                <asp:Panel ID="pnlSubScription" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc3:ucpsubscription runat="server" id="oUCPSubScription" visible="true" />

                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlTraceEdit" runat="server" Visible="false">
                                                                    <uc4:ucptraceedit runat="server" id="oUCPTraceEdit" visible="true" />

                                                                </asp:Panel>


                                                                <asp:Panel ID="pnlIndex" runat="server" Visible="false" CssClass="UCPTabsMinHeightIndex">
                                                                    <uc5:ucpidxmst id="IDXMST1" runat="server" />

                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlPayoff" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc6:ucppayoff id="UCPPayoff" runat="server" />
                                                                </asp:Panel>


                                                                  <asp:Panel ID="pnlPackageSchedule" runat="server" Visible="false" >
                                                                    <uc8:UCPPackageSchedule ID="oPackageSchedule" runat="server" />

                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlPayments" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc9:ucppayments id="UCPPayments" runat="server" />
                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlDocuments" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc10:ucpdocuments id="oUCPDocuments" runat="server" />
                                                                </asp:Panel>

                                                                <%--  <asp:Panel ID="pnlUnwind" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc11:UCPUnwind ID="oUCPUnwind" runat="server" />
                                                                </asp:Panel>--%>

                                                                <asp:Panel ID="pnlProductAMD" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc12:productamend id="UCPProductAMD" runat="server" />
                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlViewSchedule" runat="server" Visible="false">
                                                                    <uc13:ucpviewschedule id="oUCPViewSchedule" runat="server" />
                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlSuitability" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc14:ucpsuitability runat="server" id="oUCPSuitability" />
                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlFinIQ_Event" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc15:finiq_event id="oUCP_FinIQ_Event" runat="server" />
                                                                </asp:Panel>

<%--                                                                <asp:Panel ID="pnlFeesTab" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <ucfees:ucp_feestab id="oUCPFeesTab" runat="server" />
                                                                </asp:Panel>--%>

                                                                <asp:Panel ID="pnlWhatIF" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <ucwhatif:ucp_whatif id="oUCPWhatIF" runat="server" />
                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlFinIQ_UCPGL" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc16:finiq_ucpgl id="oFinIQ_UCPGL" runat="server" />
                                                                </asp:Panel>

<%--                                                                <asp:Panel ID="pnlCorporateActions" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc17:UCPCorpActions ID="oUCPCorpAction" runat="server" />
                                                                </asp:Panel>--%>

                                                                <asp:Panel ID="pnlMutationSchedule" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc17:ucpmutation id="oUCPMutationSchedule" runat="server" />

                                                                </asp:Panel>
                                                                <asp:Panel ID="pnlViewPayoff" runat="server" Visible="false" Style="overflow: hidden;" CssClass="UCPTabsMinHeight">
                                                                    <uc18:viewpayoff id="oUCPViewPayoff" runat="server" />
                                                                </asp:Panel>




                                                                <asp:Panel ID="pnlVolSpot" runat="server" Visible="false">
                                                                    <uc19:volspot runat="server" id="oUCPVolSpot" />
                                                                </asp:Panel>
                                                                <!---Devesh-->

                                                                <asp:Panel ID="PnlEventFixing" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc20:eventfixingblotter id="oUCPEventFixingBlotter" runat="server" />
                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlTrace" runat="server" Visible="false">
                                                                    <uc21:ucptrace runat="server" id="oUCPTrace" visible="true" />

                                                                </asp:Panel>
																   <asp:Panel ID="pnlHoldings" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc22:ucHoldings id="oUCPHoldings" runat="server" />
                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlCorporateActions" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc23:ucpcorpactions id="oUCPCorpAction" runat="server" />
                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlCorpActWCH" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc24:uccorpacwch id="oCorpActWCH" runat="server" />
                                                                </asp:Panel>

                                                                <asp:Panel ID="pnlFeesTab" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc25:UCP_FeesTab id="oUCPFeesTab" runat="server" />
                                                                </asp:Panel>
																
																<asp:Panel ID="PnlEquityVol" runat="server" Visible="false">
                                                                    <uc26:ucpequityvol runat="server" id="oUCPEquityVol" visible="true" />

                                                                </asp:Panel>

                                                               <!---Devesh-->
                                                                <%--<asp:Panel ID="PnlEquityDividend" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc27:EquityDividend ID="oUCPEquityDividend" runat="server" />
                                                                </asp:Panel>--%>

                                                               <%-- <asp:Panel ID="PnlMTM_Price_History" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc28:MTMPrice ID="oUCPMTMPriceHistory" runat="server" />
                                                                </asp:Panel>--%>

                                                                <!--Added By Neeral -->
                                                               <%--  <asp:Panel ID="PnlProductSchedule" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc29:ProdcutSchedule ID="oProductSchedule" runat="server" />
                                                                </asp:Panel>--%>
                                                                <%--Added by Mokshada and Samruddhi--%>
                                                                <%-- <asp:Panel ID="PnlMutatingSchedule" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc30:MutatingSchedule ID="oMutatingSchedule" runat="server" />
                                                                </asp:Panel>--%>

                                                                <asp:Panel ID="PnlUCP_ProdcutSchedule" runat="server" Visible="false">
                                                                    <%--CssClass="UCPTabsMinHeight"--%>
                                                                    <uc31:UCP_ProdcutSchedule ID="oUCP_ProdcutSchedule" runat="server" />
                                                                </asp:Panel>
																<asp:Panel ID="PnlNewEVTFIX" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc32:NewEVTFIX ID="oNewEVTFIX" runat="server" />
                                                                </asp:Panel>

																<asp:Panel ID="pnlEntitlements" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc33:UCPEntitlements ID="oUCPEntitlements" runat="server" />
                                                                </asp:Panel>
																 <asp:Panel ID="PnlPayoutScenarios" runat="server" Visible="false" CssClass="UCPTabsMinHeight">
                                                                    <uc34:PayoutScenarios ID="oPayoutScenarios" runat="server" />
                                                                </asp:Panel>
																
																    <asp:Panel ID="pnlResetDate" runat="server" Visible="false" style="overflow:hidden;">
                                                                    <uc35:UCPResetDateSchedule ID="oUCPResetDateSchedule" runat="server"/>
                                                                </asp:Panel>
								<%--Added by VijayH || 11-May-2022 || For MPG Master Tab--%>
                                                                <asp:Panel ID="PnlFinIQMPGMaster" runat="server" Visible="false">
                                                                    <%--CssClass="UCPTabsMinHeight"--%>
                                                                    <uc36:FinIQMPGMaster ID="oFinIQMPGMaster" runat="server" />
                                                                </asp:Panel>
                                                            </ContentTemplate>

                                                        </asp:UpdatePanel>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </asp:Panel>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding-top: 20px;">
                                    <asp:Button ID="btnWorkflow" UseSubmitBehavior="false" runat="server" Text="Workflow" CssClass="CollpseCSS" OnClick="btnWorkflow_Click" /></td>
                            </tr>

                            <tr>
                                <td>
                                    <asp:Panel runat="server" ID="pnlAjaxWorkflow" Visible="false">
                                        <div>

                                            <asp:Panel ID="pnlWorkFlow" runat="server" EnableViewState="true" ScrollBars="Auto">

                                                <ucworkflow:workflowcontrol runat="server" id="workflowControl" visible="true" enableviewstate="true" mode="1" />

                                            </asp:Panel>
                                        </div>
                                    </asp:Panel>

                                </td>
                            </tr>


                        </table>
                    </td>


                </tr>
            </table>


        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:Button ID="Button1" runat="server" Text="button" CssClass="Hid_Button" />
    <asp:Button ID="btnEnter" runat="server" class="displayNone" />
    <script type="text/javascript">

	function CloseRMWIFrame() {
        var lblid = frameElement.parentNode.id;
      
        lblid = lblid.split("_");
        lblid = lblid[3];
        lblid = lblid.replace("ctl0", '');
        lblid = lblid.replace("ctl", '');
        lblid = 'div' + lblid;
        //var str = lblid.indexof("_lblLaunchProductInfo");
        //var index = lblid.charAt(str - 1);
       
        //parent.View_OrderEntry(lblid.charAt(lblid.indexOf("_lblLaunchProductInfo") - 1));
        parent.document.getElementById(lblid).style.display = "none";
       // parent.document.getElementById(lblid).style.visibility = "hidden"
      
        //window.top.$("#ctl00_MainContent_dlProductPriceDetails_ctl0" + cntrl + "_lblLaunchProductInfo");
    }
	
	
        window.onload = function () {
            window.focus();
        }

        window.onbeforeunload = function () {
            var label = document.getElementById("ctl00_MainContent_lblTokenID");
            var stokenID = (label.innerText || label.textContent);
            if (stokenID != 0) {
                if (window.opener != null && window.opener != undefined) {    //Nullorundefined check added by Devesh on 27-Jul-2021          
                window.opener.CloseWindow(stokenID);
                }
            }

        }

        
        function CloseWindow() {
            window.close();
            window.top.CloseParentDialog();//NeeralB on 8-June-2020
        }
       

        $('input[id$="lblDD"]').click(
    function click() {
        $('input[id$="colDDImage"]').click();
    });


        function ViewDoc(vPath, DocName) {
           // 
            //$("#dialog").dialog('close');
            var fileName = window.location.protocol + "//" + window.location.host + "/" + vPath + "/" + DocName;// $(this).attr("href");
            //if (vPath.indexOf("/") == -1) {
            //     window.open(window.location.protocol + "//" + window.location.host + "/" + vPath + "/" + DocName, "_blank", "");
            // } else {
            //     window.open(window.location.protocol + "//" + window.location.host + "/" + vPath +  DocName, "_blank", "");
            // }

            if (vPath.indexOf("/") == -1) {
                fileName = window.location.protocol + "//" + window.location.host + "/" + vPath + "/" + DocName;
            }
            else {
                fileName = window.location.protocol + "//" + window.location.host + "/" + vPath + DocName;
            }

          
            var object;
            if ($("#dialog").hasClass('ui-dialog-content')) {
                // do whatever
                $("#dialog").empty().dialog('destroy');
            }
            
            $("#dialog").dialog({
                modal: false,
                autoOpen: true,
                title: "View Document",
                width: (window.innerWidth|| document.documentElement.clientWidth|| document.body.clientWidth)/2,
                height: (window.innerHeight|| document.documentElement.clientHeight|| document.body.clientHeight),
                resizable: true,
                scrollable: false,
                position:{
                my: "left",
                at: "top",
                of: window
            },
                buttons: {
                    Close: function () {
                        $(this).dialog('close');
                    }
                },
                open: function () {
                   
                    $("#dialog").html("");
                    object = "";
                    object = "<object data=\"{FileName}?#zoom=100&scrollbar=1&toolbar=1&navpanes=1\" type=\"application/pdf\" width=\"100%\" height=\"100%\">";
                    object += "If you are unable to view file, you can download from <a href = \"{FileName}\" target=\"_blank\">here</a>";
                  //  object += " or download <a target = \"_blank\" href = \"http://get.adobe.com/reader/\">Adobe PDF Reader</a> to view the file.";
                    object += "</object>";
                    object = object.replace(/{FileName}/g, "" + fileName);
                    
                    $("#dialog").html(object);
                } 
            });
            // });
            // });

        }
        $(document).keyup(function (e) {
            if (e.keyCode == 27) { // escape key maps to keycode `27`
                // <DO YOUR WORK HERE>
                $("#ctl00_MainContent_Button2").click();
            }
        });

        Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(
             function () {
                 if (document.getElementById) {
                     wt = $(document).width();
                     ht = $(document).height()

                     $(".UpdateProgress").width(wt);
                     $(".UpdateProgress").height(ht);
                     $(".Progress").width(wt);

                 }
                 //$('input[type="text"]').each(function () {
                 //    try {
                 //        w = $(this).width();
                 //        $(this).width(Number(w+5));
                 //    }
                 //    catch (error) { }
                 //});
             }

    )
        function EnterEvent(e) {
            if (e.keyCode == 13 || e.keyCode == 9) {
                document.getElementById('<%=btnEnter.ClientID%>').click();
            }
        }
    </script>


    <%-- For payment Tab Added by Arshin--%>
    <asp:Button ID="PaymenttabClickButton" Style="display: none" runat="server" />
    <asp:HiddenField ID="hdnPaymentSelectedTab" runat="server" Value="0" />
    <asp:HiddenField ID="HiddevActiveTab" runat="server" Value="0" />
    <asp:HiddenField ID="hdnUCPSessionID" runat="server" Value="0" />
    <input type="hidden" id="hdnStaticFields" value="block" runat="server" enableviewstate="true" />
    <asp:Label ID="lblTokenID" Text="0" runat="server" Style="display: none;" />

    <%-- For payment Tab Added by Arshin--%>
    <script type="text/javascript">

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(
             function () {
                 tabs();
             });



        function TabClick(Ccy) {
            var res = Ccy.split(",");
            document.getElementById('<%=hdnPaymentSelectedTab.ClientID%>').value = res[0];
        }


        $(document).ready(function () {
            //Shekhar 25-Jun-2019
            $("object").each(function () {
                $(this).html(' <param name="controller" value="true" ><param name="allowscriptaccess" value="always"/> <param name="view" value="FitW" /> <param name="wmode" value="opaque"/>  <param name="allowfullscreen" value="true">');
                $(this).width("100%");
            });
            //Shekhar 25-Jun-2019

            tabs();
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
                tabs();
                var windowWidth = $(window).width(); //retrieve current window width
                if (windowWidth < 1220) {
                    $(".UCPDealEntryTBLHeader").width(windowWidth - 80);
                } else {
                    $(".UCPDealEntryTBLHeader").width(windowWidth - 20);
                }

            });

        });


        function tabs() {
            $(".PaymentTabs").tabs({
                active: $('#<%=HiddevActiveTab.ClientID%>').val(),
                activate: function (event, ui) {

                }
            });
            $(".PaymentTabs").on("click", function (e) {
                var activeTabIndex = $('#tabs').tabs('option', 'active');
                $('#<%=HiddevActiveTab.ClientID%>').val(activeTabIndex);
                tabs();
                $("#ctl00_MainContent_UCPPayments_btnLoad").click;
            });
        }


        function ApplyFliter(SearchString) {
            document.getElementById("ctl00_MainContent_workflowControl_HdnSearchString").value = SearchString;
            document.getElementById("ctl00_MainContent_workflowControl_btnProductSearch").click();

        }

        window.onresize = function () {
            var windowWidth = $(window).width(); //retrieve current window width
            if (windowWidth < 1220) {
                $(".UCPDealEntryTBLHeader").width(windowWidth - 80);
            } else {
                $(".UCPDealEntryTBLHeader").width(windowWidth - 20);
            }

        }


   
        //Shekhar 25-Jun-2019
        $(document).ready(function () {
         
            $('[id$="dtlstDoc"] td').each(function () {
                
                embedFile(this);

            });

            

    });
	
	
	
	
//Added By Neeral on 25 April 19 for File Datatype Control to open FileUploadControl
        function openExplorer() {


            //var fso = new ActiveXObject("Scripting.FileSystemObject");
            //var a = fso.CreateTextFile("c:\\Bulk\\openExplorer.bat", true);
            //a.WriteLine("@echo off");


            //a.WriteLine("start explorer " + document.getElementById('ctl00_MainContent_oUCPCtrl_hdnOpenExplorerFilePath').value);


            //a.Close();

            //WshShell = new ActiveXObject("Wscript.Shell"); //Create WScript Object
            //WshShell.run("C://Bulk/openExplorer.bat"); // Please change the path and file name with your relevant available path in client system. This code can be used to execute .exe file as well

            window.open(document.getElementById('ctl00_MainContent_oUCPCtrl_hdnOpenExplorerFilePath').value);
			        }

	
            function embedFile(dtlistItem) {
               
                // $.get("FileGetter", function(pdfText){
                var pdfText = $(dtlistItem).find('[id$=hdnPDF]').val();
                var base64EncodedPDF = b64EncodeUnicode(pdfText);
                var obj = $('<object id="repObjID" type="application/pdf" width="100%" height="600" border="2"></object>'); 
                obj.attr('data', pdfText);
                var embed = $('<embed type="application/pdf"></embed>'); 
                embed.attr('src', pdfText);
                $('#repObjID').append(embed); 
                $(dtlistItem).html(obj);
            }

            function b64EncodeUnicode(str) {
                return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
                    return String.fromCharCode('0x' + p1);
                }));
            }



            function openPDF(thum) {
                
                fileName = $(thum).parent().find("object").attr("data");
                title = $(thum).parent().find("h1").html();
                var object;
                if ($("#dialog").hasClass('ui-dialog-content')) { 
                    $("#dialog").empty().dialog('destroy');
                }
                ht = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight);
                wt = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) / 2;

                $("#dialog").dialog({
                    modal: false,
                    autoOpen: true,
                    title: title,
                    width: wt,
                    height: ht,
                    resizable: true,
                    scrollable: false,
                    position: {
                        my: "left",
                        at: "top",
                        of: window
                    },
                    buttons: {
                        Close: function () {
                            $(this).dialog('close');
                        }
                    },
                    open: function () {
                        $("#dialog").html("");
                        object = ""; 
                        object = '<object data="' + fileName + '#view=FitH" type="application/pdf" width="' + Number(wt) + '" height="100"></object>';
                        $("#dialog").html(object);
                        //$("#dialog").find("object").width(wt);
                        //$("#dialog").find("object").height(ht);
                    }
                }); 
            }

        //Shekhar 25-Jun-2019

        //Added By MohiniM on 27-Jan-2020 Start
            function isNumberKey(evt) {

                var charCode = (evt.which) ? evt.which : evt.keyCode;
                if (charCode == 46)
                    return true;
                else if (charCode > 31 && (charCode < 48 || charCode > 57))
                    return false;
                return true;
            }
        //Added By MohiniM on 27-Jan-2020 End
        function chkAllClick(element) {
            if ($(element).is(":checked")) {
                $(element).parent().parent().parent().parent().parent().find("[id*=DDList] input").attr("checked", "checked");
            } else {
                $(element).parent().parent().parent().parent().parent().find("[id*=DDList] input").removeAttr("checked");
            }
            $(element).parent().parent().parent().parent().parent().find("[id*=DDList] input").change();
        }
        function DDListCheckChange(element) {
            
            if ($(element).parent().parent().parent().parent().parent().find("[id*=DDList] input:checked").length == $(element).parent().parent().parent().parent().parent().find("[id*=DDList] input").length) {
                $(element).parent().parent().parent().parent().parent().find("[id*=chkCheckAll]").attr("checked", "checked");
            } else {
                $(element).parent().parent().parent().parent().parent().find("[id*=chkCheckAll]").removeAttr("checked");
            }
            // $(element).parent().parent().parent().parent().parent().find("[id*=btnUpdate]").click();
        }
        function colDDImage_Click(element) {
            $(element).children("[id*=colDDImage]").triggerHandler('click');
        }


        //Added by RajeshC || InputFreshRecord
        function openPage(uPath) {
            try {
                uPath = window.origin + "/FinIQWebApp" + uPath + "&Master_Popup=POPUP";
                window.open(uPath, "_blank");
            } catch (er) { console.log(er.message); }
        }
    </script>

 
    <div id="dialog"></div>
</asp:Content>
