//#region Websocket Section
var ws;
function Subscribe(WebSocketIP, ParentRFQID) {
    try {
        var rfqid = MathRandom();
        if (WebSocketIP == '' || WebSocketIP == undefined) {
            WebSocketIP = "localhost";
        }
        var myPageName = path_Name.substring(path_Name.lastIndexOf('/') + 1);
        if (1 == 1) {
            if (rfqid == "") { } else {
                $(document).ready(function () {
                    try {
                        if (myPageName == "ELN_RFQL1.aspx" || myPageName == "DRAFCNRFQ1.aspx" || myPageName == "AccDecRFQ1.aspx" || myPageName == "PhoenixRFQ.aspx" || myPageName == "BENRFQ1.aspx" || myPageName == "EQORFQ1.aspx") {
                            var wsprotocol;
                            if (location.protocol == "http:")
                                wsprotocol = "ws:"
                            else if (location.protocol == "https:")
                                wsprotocol = "wss:"
                            else
                                wsprotocol = "ws:"
                            try {
                                if (ws == null || ws == 'undefined') {
                                    ws = new WebSocket("" + wsprotocol + "//" + WebSocketIP + "/FinIQService/EQCWSCallback.svc");
                                } else {
                                    switch (ws.readyState) {
                                        case WebSocket.CONNECTING:
                                            ws = null;
                                            ws = new WebSocket("" + wsprotocol + "//" + WebSocketIP + "/FinIQService/EQCWSCallback.svc");
                                            break;
                                        case WebSocket.OPEN:
                                            ws.send('MASTERSUBSCRIBE|' + ParentRFQID);
                                            break;
                                        case WebSocket.CLOSED:
                                            ws = null;
                                            ws = new WebSocket("" + wsprotocol + "//" + WebSocketIP + "/FinIQService/EQCWSCallback.svc");
                                            break;
                                        case WebSocket.CLOSING:
                                            ws = null;
                                            ws = new WebSocket("" + wsprotocol + "//" + WebSocketIP + "/FinIQService/EQCWSCallback.svc");
                                            break;
                                    }
                                }
                            } catch (error) { }
                            ws.onopen = function (e) {
                                try {
                                    if (ws.readyState == WebSocket.OPEN) {
                                        ws.send('MASTERSUBSCRIBE|' + ParentRFQID);
                                    } else {
                                    }
                                } catch (er) {
                                    console.log(er.message);
                                }
                            };
                            ws.onmessage = function (evt) {
                                var RFQID = 0;
                                try {
                                    var msg = evt.data;
                                    var strRes = JSON.parse(msg);
                                    RFQID = strRes["MessageContent"];
                                    if (ws.readyState == WebSocket.OPEN && strRes["MesssageType"].toUpperCase() == "SUBSCRIBE") {
                                    } else if (ws.readyState == WebSocket.OPEN && strRes["MesssageType"].toUpperCase() == "UNSUBSCRIBE") { }
                                    else {
                                        try {
                                            var json = JSON.parse(strRes["MessageContent"]);
                                            var RFQID = json.EP_ER_QuoteRequestId;
                                            var response;
                                            var PP_Code = json.PP_Code.toUpperCase();
                                            if ($.trim(json.Response).startsWith('Rejected') || $.trim(json.Response).startsWith('Unsupported')) {
                                                response = json.Response;
                                            }
                                            else {
                                                switch (myPageName) {

                                                    case "ELN_RFQL1.aspx":
                                                        response = json.Response + "," + json.MinNotional + "," + json.MaxNotional + "," + json.IBYield + "," + json.NotionalLimitCcy + "^" + json.ClientYield;
                                                        break;
                                                    case "DRAFCNRFQ1.aspx":
                                                    case "PhoenixRFQ.aspx":
                                                    case "BENRFQ1.aspx":
                                                        response = json.Response + "," + json.MinNotional + "," + json.MaxNotional + "," + json.NotionalLimitCcy + "," + json.MatDate + "," + json.SettlDate;
                                                        break;
                                                    case "AccDecRFQ1.aspx":
                                                        response = json.Response + "," + json.MinNotional + "," + json.MaxNotional + "," + json.NotionalLimitCcy + ";" + json.NumberOfDaysAccrual + ";" + json.IndicativeNotional;
                                                        break;
                                                    case "EQORFQ1.aspx":
                                                        response = json.Response + ";" + json.MinNotional + "," + json.MaxNotional + "," + json.NotionalLimitCcy + "^" + json.MatDate + "^" + json.ExpDate;
                                                        break;
                                                }
                                            }
                                            getRfqResponse(response, RFQID, 'ctl00_MainContent_lbl' + PP_Code + 'Price', 'ctl00_MainContent_lblTimer' + PP_Code, PP_Code, 'ctl00_MainContent_btn' + PP_Code + 'Price');
                                        } catch (Exception) { }
                                    }
                                } catch (er) {
                                    console.log(er.message);
                                }
                            };
                            ws.onerror = function (evt) { };
                            ws.onclose = function (evt) {
                                try {
                                } catch (er) {
                                    console.log(er.message);
                                }
                            };
                        }
                    } catch (er) {
                        console.log(er.message);
                    }
                });
            }
        }
    } catch (e) {
        console.log("Subscribe : " + e.message);
    }
}

function UnSubscribe(WebSocketIP, ParentRFQID) {
    try {
        if (WebSocketIP == '' || WebSocketIP == undefined) {
            WebSocketIP = "localhost";
        }
        var myPageName = path_Name.substring(path_Name.lastIndexOf('/') + 1);
        if (1 == 1) {
            if (ParentRFQID == "") { } else {
                $(document).ready(function () {
                    try {
                        if (myPageName == "ELN_RFQL1.aspx" || myPageName == "DRAFCNRFQ1.aspx" || myPageName == "AccDecRFQ1.aspx" || myPageName == "PhoenixRFQ.aspx" || myPageName == "BENRFQ1.aspx" || myPageName == "EQORFQ1.aspx") {
                            var wsprotocol;
                            if (location.protocol == "http:")
                                wsprotocol = "ws:"
                            else if (location.protocol == "https:")
                                wsprotocol = "wss:"
                            else
                                wsprotocol = "ws:"
                            try {
                                if (ws == null || ws == 'undefined') {
                                    //Do Nothing if there is no object subscribed.
                                } else {
                                    switch (ws.readyState) {
                                        case WebSocket.CONNECTING:
                                            ws = null;
                                            ws = new WebSocket("" + wsprotocol + "//" + WebSocketIP + "/FinIQService/EQCWSCallback.svc");
                                            break;
                                        case WebSocket.OPEN:
                                            ws.send('MASTERUNSUBSCRIBE|' + ParentRFQID);
                                            break;
                                        case WebSocket.CLOSED:
                                            ws = null;
                                            ws = new WebSocket("" + wsprotocol + "//" + WebSocketIP + "/FinIQService/EQCWSCallback.svc");
                                            break;
                                        case WebSocket.CLOSING:
                                            ws = null;
                                            ws = new WebSocket("" + wsprotocol + "//" + WebSocketIP + "/FinIQService/EQCWSCallback.svc");
                                            break;
                                    }
                                }
                            } catch (error) { }
                            ws.onopen = function (e) {
                                try {
                                    if (ws.readyState == WebSocket.OPEN) {
                                        ws.send('MASTERUNSUBSCRIBE|' + ParentRFQID);
                                    } else {
                                    }
                                } catch (er) {
                                    console.log(er.message);
                                }
                            };
                        }
                    } catch (er) {
                        console.log(er.message);
                    }
                });
            }
        }
    } catch (e) {
        console.log("UnSubscribe : " + e.message);
    }
}

function getRfqResponse(msg, rfqID, lblPrice, lblTimer, btnDeal, btnPrice1) {
    try {
        if (msg) {
            console.log(msg);
            var responseRFQID;
            var Config_EQC_ShowErrorType;
            if ($.trim(msg) == 'Error') {
                nonPriceRes = $.trim(msg);
            }
            else if ($.trim(msg).startsWith('Timeout')) {
                nonPriceRes = msg.split(',')[0];
                responseRFQID = rfqID;
                if ($('#ctl00_MainContent_' + btnDeal + 'RFQID').val() != undefined && (responseRFQID != $('#ctl00_MainContent_' + btnDeal + 'RFQID').val()) || ($('#ctl00_MainContent_hdn' + btnDeal + 'RFQID').val() != undefined && responseRFQID != $('#ctl00_MainContent_hdn' + btnDeal + 'RFQID').val())) {
                    Config_EQC_ShowErrorType = parent.document.getElementById("ctl00_MainContent_hdnConfigEQC_WriteConsoleLog").value;
                    if (Config_EQC_ShowErrorType.toUpperCase() == 'NO') {
                        alert('TIMEOUT: Mismatch of RFQ ID found. Expected response for ' + $('#ctl00_MainContent_' + btnDeal.substr(21).replace('Deal', '') + 'RFQID').val() + ' but got response for ' + msg.split(',')[1] + '::' + msg);
                    }
                    else if (Config_EQC_ShowErrorType.toUpperCase() == 'YES') {
                        console.log('TIMEOUT: Mismatch of RFQ ID found. Expected response for ' + $('#ctl00_MainContent_' + btnDeal + 'RFQID').val() + ' but got response for ' + msg.split(',')[1] + '::' + msg);
                    }
                    else {

                    }
                    return false;
                }
            }
            else if ($.trim(msg).startsWith('Rejected') || $.trim(msg).startsWith('Unsupported')) {
                nonPriceRes = msg.split(',')[0];
                responseRFQID = rfqID;
                if ($('#ctl00_MainContent_' + btnDeal + 'RFQID').val() != undefined && (responseRFQID != $('#ctl00_MainContent_' + btnDeal + 'RFQID').val()) || ($('#ctl00_MainContent_hdn' + btnDeal + 'RFQID').val() != undefined && responseRFQID != $('#ctl00_MainContent_hdn' + btnDeal + 'RFQID').val())) {
                    Config_EQC_ShowErrorType = parent.document.getElementById("ctl00_MainContent_hdnConfigEQC_WriteConsoleLog").value;
                    if (Config_EQC_ShowErrorType.toUpperCase() == 'NO') {
                        alert('REJECT: Mismatch of RFQ ID found. Expected response for ' + $('#ctl00_MainContent_' + btnDeal + 'RFQID').val() + ' but got response for ' + msg.split(',')[1] + '::' + msg);
                    }
                    else if (Config_EQC_ShowErrorType.toUpperCase() == 'YES') {
                        console.log('REJECT: Mismatch of RFQ ID found. Expected response for ' + $('#ctl00_MainContent_' + btnDeal + 'RFQID').val() + ' but got response for ' + msg.split(',')[1] + '::' + msg);
                    }
                    else {

                    }
                    return false;
                }
            }
            else {
                responseRFQID = rfqID;
                if ($('#ctl00_MainContent_' + btnDeal + 'RFQID').val() != undefined && (responseRFQID != $('#ctl00_MainContent_' + btnDeal + 'RFQID').val()) || ($('#ctl00_MainContent_hdn' + btnDeal + 'RFQID').val() != undefined && responseRFQID != $('#ctl00_MainContent_hdn' + btnDeal + 'RFQID').val())) {
                    Config_EQC_ShowErrorType = parent.document.getElementById("ctl00_MainContent_hdnConfigEQC_WriteConsoleLog").value;
                    if (Config_EQC_ShowErrorType.toUpperCase() == 'NO') {
                        alert('PRICE: Mismatch of RFQ ID found. Expected response for ' + $('#ctl00_MainContent_' + btnDeal + 'RFQID').val() + ' but got response for ' + msg.split(',')[1] + '::' + msg);
                    }
                    else if (Config_EQC_ShowErrorType.toUpperCase() == 'YES') {
                        console.log('PRICE: Mismatch of RFQ ID found. Expected response for ' + $('#ctl00_MainContent_' + btnDeal + 'RFQID').val() + ' but got response for ' + msg.split(',')[1] + '::' + msg);
                    }
                    else {

                    }
                    return false;
                }
            }

            setPriceAllEnableDisable();
            if ($.trim(msg) == 'Error') {

            }
            else if ($.trim(msg) == 'Rejected' || $.trim(msg) == 'Unsupported') {
                if (parent.document.getElementById("ctl00_MainContent_hdnConfigEQC_WriteConsoleLog").value == 'YES') {
                    console.log(rfqID + ' | ' + msg + ' | ' + lblPrice);
                }
                $("#" + lblPrice).text(msg);
                setPriceAllEnableDisable();
                if (document.getElementById(btnPrice1) !== null)
                    document.getElementById(btnPrice1).disabled = false;
                $('#' + lblPrice).removeClass("lblPrice").removeClass("lblTimeout").removeClass("lblRejected").addClass("lblRejected");
                $("#" + btnPrice1).removeClass("btnDisabled").addClass("btn");
                if (btnDeal.indexOf(btnDeal) == 0) {
                    HiddenPrice = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenPrice");
                    HiddenPrice.value = msg + ';Enable;Disable;Disable;Price';
                    HiddenRFQID = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenRFQID");
                    HiddenRFQID.value = rfqID;
                    $("#" + btnDeal + "wait").hide();
                    document.getElementById(btnDeal + 'wait').style.visibility = 'hidden';
                    //Added By AniruddhaJ for loader keeps displaying on rejected price issue START
                    if (document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenAccDays") != null && document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenAccDays") != undefined) {
                    HiddenAccDays = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenAccDays");
                    HiddenAccDays.value = '';
                    } else {
                        HiddenAccDays = "";
                    }
                    HidINNotionalPrice = document.getElementById("ctl00_MainContent_" + btnDeal + "HidINNotionalPrice");
                    if (HidINNotionalPrice != undefined)
                        HidINNotionalPrice.value = '';
                    processingJPM = false;
                }
                setTimeout(setPriceAllEnableDisable, 1000);
                if (FlagForConformClick == 0) {
                    document.getElementById('ctl00_MainContent_btnSetResponse').click();
                }
            }
            else if ($.trim(msg) == 'Timeout') {
                if (parent.document.getElementById("ctl00_MainContent_hdnConfigEQC_WriteConsoleLog").value == 'YES') {
                    console.log(rfqID + ' | ' + msg + ' | ' + lblPrice);
                }
                $("#" + lblPrice).text('Timeout');
                if (document.getElementById(btnPrice1) !== null)
                    document.getElementById(btnPrice1).disabled = false;
                $('#' + lblPrice).removeClass("lblPrice").removeClass("lblTimeout").removeClass("lblRejected").addClass("lblTimeout");
                $("#" + btnPrice1).removeClass("btnDisabled").addClass("btn");
                if (btnDeal.indexOf(btnDeal) == 0) {
                    HiddenPrice = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenPrice");
                    HiddenPrice.value = 'Timeout;Enable;Disable;Disable;Price';
                    HiddenRFQID = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenRFQID");
                    HiddenRFQID.value = rfqID;
                    $("#" + btnDeal + "wait").hide();
                    document.getElementById(btnDeal + 'wait').style.visibility = 'hidden';
                    HiddenAccDays = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenAccDays");
                    HiddenAccDays.value = '';
                    HidINNotionalPrice = document.getElementById("ctl00_MainContent_" + btnDeal + "HidINNotionalPrice");
                    if (HidINNotionalPrice != undefined)
                        HidINNotionalPrice.value = '';
                    processingJPM = false;
                }
                if (FlagForConformClick == 0) {
                    document.getElementById('ctl00_MainContent_btnSetResponse').click();
                }
                setTimeout(setPriceAllEnableDisable, 500);
            }

            else {
                AllHiddenPrice = 'Disable';
                if (parent.document.getElementById("ctl00_MainContent_hdnConfigEQC_WriteConsoleLog").value == 'YES') {
                    console.log(rfqID + ' | ' + msg + ' | ' + lblPrice);
                }
                var myPageName = path_Name.substring(path_Name.lastIndexOf('/') + 1);

                $("#" + lblPrice).text(parseFloat(msg).toFixed(2));
                if (document.getElementById(btnPrice1) !== null)
                    document.getElementById(btnPrice1).disabled = true;
                $('#' + lblPrice).removeClass("lblPrice").removeClass("lblTimeout").removeClass("lblRejected").addClass("lblPrice");
                $("#" + btnPrice1).removeClass("btn").addClass("btnDisabled");
                $("#" + lblPrice).text(parseFloat(msg).toFixed(2));
                $("#" + btnPrice1).val('Order');
                if (btnDeal.indexOf(btnDeal) == 0) {
                    switch (myPageName) {
                        case "ELN_RFQL1.aspx":
                        case "DRAFCNRFQ1.aspx":
                        case "PhoenixRFQ.aspx":
                        case "BENRFQ1.aspx":
                            HiddenPrice = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenPrice");
                            HiddenPrice.value = msg + ';Enable;Enable;Disable;Order';
                            HiddenRFQID = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenRFQID");
                            HiddenRFQID.value = rfqID;
                            HiddenAccDays = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenAccDays");
                            HiddenAccDays.value = msg.split("^")[0] + '^' + msg.split("^")[1];
                            $("#" + btnDeal + "wait").hide();
                            document.getElementById(btnDeal + 'wait').style.visibility = 'hidden';
                            break;
                        case "AccDecRFQ1.aspx":
                            //Arshad M | 18-Nov-2021 | INT1FIN47-233 : 1FinIQ : EQ Connect - Accu/ Decu Upfront presentation error
                            if (parent.document.getElementById("ctl00_MainContent_ddlSolveForAccumDecum").value.toUpperCase() == 'UPFRONT (%)') {
                                $("#" + lblPrice).text(parseFloat(msg.split(",")[0]/100).toFixed(4));
                            }
                            HiddenPrice = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenPrice");
                            HiddenPrice.value = msg.split(";")[0] + ';Enable;Enable;Disable;Order';
                            HiddenRFQID = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenRFQID");
                            HiddenRFQID.value = rfqID;
                            HiddenAccDays = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenAccDays");
                            HiddenAccDays.value = parseFloat(msg.split(";")[0]).toFixed(2) + ';' + msg.split(";")[1];
                            $("#" + btnDeal + "wait").hide();
                            document.getElementById(btnDeal + 'wait').style.visibility = 'hidden';
                            HidINNotionalPrice = document.getElementById("ctl00_MainContent_" + btnDeal + "HidINNotionalPrice");
                            if (HidINNotionalPrice != undefined)
                                HidINNotionalPrice.value = msg.split(";")[2];
                            break;
                        case "EQORFQ1.aspx":
                            HiddenPrice = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenPrice");
                            HiddenPrice.value = (parseFloat(msg.split(";")[0])).toFixed(4) + ';Enable;Enable;Disable;Order';
                            HiddenRFQID = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenRFQID");
                            HiddenRFQID.value = rfqID;
                            $("#" + btnDeal + "wait").hide();
                            document.getElementById(btnDeal + 'wait').style.visibility = 'hidden';
                            HiddenLimit = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenLimit");
                            HiddenLimit.value = msg.split(";")[1].split("^")[0];
                            HiddenMatDate = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenMatDate");
                            HiddenMatDate.value = msg.split("^")[1];
                            HiddenExpDate = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenExpDate");
                            HiddenExpDate.value = msg.split("^")[2];
                            break;
                    }
                    switch (btnDeal) {
                        case "JPM":
                            processingJPM = true;
                            break;
                        case "HSBC":
                            processingHSBC = true;
                            break;
                        case "CS":
                            processingCS = true;
                            break;
                        case "UBS":
                            processingUBS = true;
                            break;
                        case "MS":
                            processingMS = true;
                            break;
                        case "TDS":
                            processingTDS = true;
                            break;
                        case "NOMURA":
                            processingNOMURA = true;
                            break;
                        case "BNPP":
                            processingBNPP = true;
                            break;
                        case "SCB":
                            processingSCB = true;
                            break;
                        case "OCBC":
                            processingOCBC = true;
                            break;
                        case "CITI":
                            processingCITI = true;
                            break;
                        case "BOCI":
                            processingBOCI = true;
                            break;
                        case "LEONTEQ":
                            processingLEONTEQ = true;
                            break;
                        case "BARCLAYS":
                            processingBARCLAYS = true;
                            break;
                        case "RBC":
                            processingRBC = true;
                            break;
                        case "SOCGEN":
                            processingSOCGEN = true;
                            break;
                        case "NATIXIS":
                            processingNATIXIS = true;
                            break;
                        case "RAIFFEISEN":
                            processingRAIFFEISEN = true;
                            break;
                        case "VONTOBEL":
                            processingVONTOBEL = true;
                            break;
                        case "BBVA":
                            processingBBVA = true;
                            break;
                        case "GS":
                            processingGS = true;
                            break;
                        case "DBIB":
                            processingDBIB = true;
                            break;
                        case "BAML":
                            processingBAML = true;
                            break;
                        case "DBS":
                            processingDBS = true;
                            break;
                        case "EFG":
                            processingEFG = true;
                            break;
                    }
                }
                if (FlagForConformClick == 0) {
                    document.getElementById('ctl00_MainContent_btnSetResponse').click();
                }
                InitializeTimer(lblTimer, orderValiditySec, btnDeal, btnPrice1);
                setTimeout(setPriceAllEnableDisable, 500);

                if (parent.document.getElementById("ctl00_MainContent_hdnCustomRuleCheck").value == 'YES' || parent.document.getElementById("ctl00_MainContent_hdnCustomRuleCheck").value == 'Y') {
                    checkSuitability(btnDeal, myPageName, rfqID, msg);
                }
       
            }
        }
    } catch (e) {
        console.log("getRfqResponse : " + e.message);
    }
}

function checkSuitability(btnDeal, myPageName, rfqID, msg) {
    try {
            var IssuerPrice;
            switch (btnDeal) {
                case "JPM":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblJPMPrice").textContent;
                    break;
                case "HSBC":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblHSBCPrice").textContent;
                    break;
                case "CS":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblCSPrice").textContent;
                    break;
                case "SCB":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblSCBPrice").textContent;
                    break;
                case "OCBC":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblOCBCPrice").textContent;
                    break;
                case "CITI":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblCITIPrice").textContent;
                    break;
                case "BNPP":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblBNPPPrice").textContent;
                    break;
                case "UBS":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblUBSPrice").textContent;
                    break;
                case "MS":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblMSPrice").textContent;
                    break;
                case "TDS":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblTDSPrice").textContent;
                    break;
                case "RBC":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblRBCPrice").textContent;
                    break;
                case "SOCGEN":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblSOCGENPrice").textContent;
                    break;
                case "NATIXIS":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblNATIXISPrice").textContent;
                    break;
                case "RAIFFEISEN":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblRAIFFEISENPrice").textContent;
                    break;
                case "VONTOBEL":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblVONTOBELPrice").textContent;
                    break;
                case "BBVA":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblBBVAPrice").textContent;
                    break;
                case "NOMURA":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblNOMURAPrice").textContent;
                    break;
                case "BOCI":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblBOCIPrice").textContent;
                    break;
                case "LEONTEQ":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblLEONTEQPrice").textContent;
                    break;
                case "BARCLAYS":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblBARCLAYSPrice").textContent;
                    break;
                case "GS":
                    IssuerPrice = document.getElementById("ctl00_MainContent_lblGSPrice").textContent;
                    break;
            }
        var share1, share2, share3, share4, strike, IBPrice, coupon, couponFreq, KI, KIType, KO, KOType, Upfront, TenorInMonths, DayCount, NoteCcy, Product, ClientPrice, Client_Yield, KO_Applicable, Non_Call_Periods;
            switch (myPageName) {
                case "ELN_RFQL1.aspx":
                    share1 = document.getElementById("ctl00_MainContent_ddlShare").value.split('/')[0].replace('(', '').replace(')', '')
                    if (document.getElementById("ctl00_MainContent_ddlShareELN2") != null) {
                        share2 = document.getElementById("ctl00_MainContent_ddlShareELN2").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share2 = "";
                    }
                    if (document.getElementById("ctl00_MainContent_ddlShareELN3") != null) {
                        share3 = document.getElementById("ctl00_MainContent_ddlShareELN3").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share3 = "";
                    }
                    if (document.getElementById("ctl00_MainContent_ddlShareELN4") != null) {
                        share4 = document.getElementById("ctl00_MainContent_ddlShareELN4").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share4 = "";
                    }
                    Upfront = document.getElementById("ctl00_MainContent_txtUpfrontELN").value;
                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveFor").value.toUpperCase() == 'IB PRICE (%)') {
                        strike = document.getElementById("ctl00_MainContent_txtStrike").value;
                        IBPrice = IssuerPrice;
                        ClientPrice = (parseFloat(IssuerPrice) + parseFloat(Upfront)).toFixed(2);
                        Client_Yield = msg.split("^")[1];
                    }
                    else {
                        IBPrice = document.getElementById("ctl00_MainContent_txtELNPrice").value;
                        strike = IssuerPrice;
                        ClientPrice = (parseFloat(IBPrice) + parseFloat(Upfront)).toFixed(2);
                        Client_Yield = msg.split("^")[1];
                    }
                    coupon = "0";
                    couponFreq = "";
                    KI = "0";
                    KIType = "";
                    if (document.getElementById("ctl00_MainContent_chkELNType").checked) {
                        KO = document.getElementById("ctl00_MainContent_txtBarrier").value;
                        KOType = document.getElementById("ctl00_MainContent_ddlBarrier").value;
                        KO_Applicable = "Y";
                    }
                    else {
                        KO = "0";
                        KOType = "";
                        KO_Applicable = "N";
                    }
                    
                    if (parent.document.getElementById("ctl00_MainContent_ddlTenorTypeELN").value.toUpperCase() == 'MONTH') {
                        TenorInMonths = document.getElementById("ctl00_MainContent_txtTenor").value;
                    }
                    else {
                        TenorInMonths = parseInt(document.getElementById("ctl00_MainContent_txtTenor").value) * 12;
                    }
                    dt1 = new Date(document.getElementById("ctl00_MainContent_txtSettlementDate_txtDate").value);
                    dt2 = new Date(document.getElementById("ctl00_MainContent_txtMaturityDate_txtDate").value);
                    DayCount = Math.floor((Date.UTC(dt2.getFullYear(), dt2.getMonth(), dt2.getDate()) - Date.UTC(dt1.getFullYear(), dt1.getMonth(), dt1.getDate())) / (1000 * 60 * 60 * 24));
                    NoteCcy = document.getElementById("ctl00_MainContent_ddlQuantoCcy").value;
                    break;
                case "DRAFCNRFQ1.aspx":
                    share1 = document.getElementById("ctl00_MainContent_ddlShareDRA").value.split('/')[0].replace('(', '').replace(')', '')
                    if (document.getElementById("ctl00_MainContent_ddlShareDRA2") != null) {
                        share2 = document.getElementById("ctl00_MainContent_ddlShareDRA2").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share2 = "";
                    }
                    if (document.getElementById("ctl00_MainContent_ddlShareDRA3") != null) {
                        share3 = document.getElementById("ctl00_MainContent_ddlShareDRA3").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share3 = "";
                    }
                    if (document.getElementById("ctl00_MainContent_ddlShareDRA4") != null) {
                        share4 = document.getElementById("ctl00_MainContent_ddlShareDRA4").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share4 = "";
                    }
                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveForDRA").value.toUpperCase() == 'IB PRICE (%)') {
                        strike = document.getElementById("ctl00_MainContent_txtStrikeDRAFCN").value;
                        IBPrice = IssuerPrice;
                        coupon = document.getElementById("ctl00_MainContent_txtCoupon").value;
                    } else if (parent.document.getElementById("ctl00_MainContent_ddlSolveForDRA").value.toUpperCase() == 'STRIKE (%)' || parent.document.getElementById("ctl00_MainContent_ddlSolveForDRA").value.toUpperCase() == 'STRIKE/ACC (%)') {
                        IBPrice = document.getElementById("ctl00_MainContent_txtDRAPrice").value;
                        strike = IssuerPrice;
                        coupon = document.getElementById("ctl00_MainContent_txtCoupon").value;
                    }
                    else if (parent.document.getElementById("ctl00_MainContent_ddlSolveForDRA").value.toUpperCase() == 'COUPON (%)') {
                        IBPrice = document.getElementById("ctl00_MainContent_txtDRAPrice").value;
                        strike = document.getElementById("ctl00_MainContent_txtStrikeDRAFCN").value;
                        coupon = IssuerPrice;
                    }
                    couponFreq = document.getElementById("ctl00_MainContent_ddlKIFrequency").value;

                    if (document.getElementById("ctl00_MainContent_chkKI").checked) {
                        KI = document.getElementById("ctl00_MainContent_txtKILevel").value;
                        KIType = document.getElementById("ctl00_MainContent_ddlKIType").value;
                    }
                    else {
                        KI = "0";
                        KIType = "";
                    }
                    if (document.getElementById("ctl00_MainContent_chkKO").checked) {
                        KO = document.getElementById("ctl00_MainContent_txtKOLevel").value;
                        KOType = document.getElementById("ctl00_MainContent_ddlKOType").value;
                    }
                    else {
                        KO = "0";
                        KOType = "";
                    }
                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveForDRA").value.toUpperCase() == "IB PRICE (%)") {
                        if (document.getElementById("ctl00_MainContent_txtUpfrontDRA") == null) {
                            Upfront = (100 - parseFloat(IssuerPrice)).toFixed(2);
                        }
                        else {
                            if (document.getElementById("ctl00_MainContent_txtUpfrontDRA").disabled == true) {
                                Upfront = (100 - parseFloat(IssuerPrice)).toFixed(2);
                            }
                            else {
                                Upfront = document.getElementById("ctl00_MainContent_txtUpfrontDRA").value;
                            }
                        }

                        //19-Oct-2021 | Arshad M/Sudarshan P | Even Price is valid Upfront is 0  | UBPINT-1646 FCN, DRA, Phoenix: Suitability flag incorrectly updated due to Upfront issue
                        if (Upfront === "0") {
                            Upfront = (100 - parseFloat(IssuerPrice)).toFixed(2);
                        }
                    }
                    else {
                        Upfront = document.getElementById("ctl00_MainContent_txtUpfrontDRA").value;
                    }                  

                    if (parent.document.getElementById("ctl00_MainContent_ddlTenorTypeDRA").value.toUpperCase() == 'MONTH') {
                        TenorInMonths = document.getElementById("ctl00_MainContent_txtTenorDRA").value;
                    }
                    else {
                        TenorInMonths = parseInt(document.getElementById("ctl00_MainContent_txtTenorDRA").value) * 12;
                    }
                    Product = document.getElementById("ctl00_MainContent_ddlDRAType").value;
                    Non_Call_Periods = document.getElementById("ctl00_MainContent_txtNonCall").value;
                    break;
                case "PhoenixRFQ.aspx":
                    share1 = document.getElementById("ctl00_MainContent_ddlSharePHX").value.split('/')[0].replace('(', '').replace(')', '')
                    if (document.getElementById("ctl00_MainContent_ddlSharePHX2") != null) {
                        share2 = document.getElementById("ctl00_MainContent_ddlSharePHX2").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share2 = "";
                    }
                    if (document.getElementById("ctl00_MainContent_ddlSharePHX3") != null) {
                        share3 = document.getElementById("ctl00_MainContent_ddlSharePHX3").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share3 = "";
                    }
                    if (document.getElementById("ctl00_MainContent_ddlSharePHX4") != null) {
                        share4 = document.getElementById("ctl00_MainContent_ddlSharePHX4").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share4 = "";
                    }
                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveForPHX").value.toUpperCase() == 'IB PRICE (%)') {
                        strike = document.getElementById("ctl00_MainContent_txtStrikePHX").value;
                        IBPrice = IssuerPrice;
                        coupon = document.getElementById("ctl00_MainContent_txtCoupon").value;
                    } else if (parent.document.getElementById("ctl00_MainContent_ddlSolveForPHX").value.toUpperCase() == 'STRIKE (%)') {
                        IBPrice = document.getElementById("ctl00_MainContent_txtPHXPrice").value;
                        strike = IssuerPrice;
                        coupon = document.getElementById("ctl00_MainContent_txtCoupon").value;
                    }
                    else if (parent.document.getElementById("ctl00_MainContent_ddlSolveForPHX").value.toUpperCase() == 'COUPON (%)') {
                        IBPrice = document.getElementById("ctl00_MainContent_txtPHXPrice").value;
                        strike = document.getElementById("ctl00_MainContent_txtStrikePHX").value;
                        coupon = IssuerPrice;
                    }
                    else if (parent.document.getElementById("ctl00_MainContent_ddlSolveForPHX").value.toUpperCase() == 'KNOCK IN BARRIER (%)') {
                        IBPrice = document.getElementById("ctl00_MainContent_txtPHXPrice").value;
                        strike = document.getElementById("ctl00_MainContent_txtStrikePHX").value;
                        coupon = document.getElementById("ctl00_MainContent_txtCoupon").value;
                    }
                    else if (parent.document.getElementById("ctl00_MainContent_ddlSolveForPHX").value.toUpperCase() == 'AUTOCALL BARRIER (%)') {
                        IBPrice = document.getElementById("ctl00_MainContent_txtPHXPrice").value;
                        strike = document.getElementById("ctl00_MainContent_txtStrikePHX").value;
                        coupon = document.getElementById("ctl00_MainContent_txtCoupon").value;
                    }
                    couponFreq = document.getElementById("ctl00_MainContent_ddlKIFrequency").value;
                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveForPHX").value.toUpperCase() != 'KNOCK IN BARRIER (%)') {
                        if (document.getElementById("ctl00_MainContent_chkKI").checked) {
                            KI = document.getElementById("ctl00_MainContent_txtKILevel").value;
                            KIType = document.getElementById("ctl00_MainContent_ddlKIType").value;
                        }
                        else {
                            KI = "0";
                            KIType = "";
                        }
                    }
                    else {
                        KI = IssuerPrice;
                        KIType = document.getElementById("ctl00_MainContent_ddlKIType").value;
                    }
                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveForPHX").value.toUpperCase() != 'AUTOCALL BARRIER (%)') {
                        if (document.getElementById("ctl00_MainContent_chkKO").checked) {
                            KO = document.getElementById("ctl00_MainContent_txtKOLevel").value;
                        }
                        else {
                            KO = "0";
                        }
                    }
                    else {
                        KO = IssuerPrice
                    }
                    if (document.getElementById("ctl00_MainContent_chkKO").checked) {
                        KOType = "Period End";
                    }
                    else {
                        KOType = "None";
                    }

                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveForPHX").value.toUpperCase() == "IB PRICE (%)") {
                        if (document.getElementById("ctl00_MainContent_txtUpfrontPHX") == null) {
                            Upfront = (100 - parseFloat(IssuerPrice)).toFixed(2);
                        }
                        else {
                            if (document.getElementById("ctl00_MainContent_txtUpfrontPHX").disabled == true) {
                                Upfront = (100 - parseFloat(IssuerPrice)).toFixed(2);
                            }
                            else {
                                Upfront = document.getElementById("ctl00_MainContent_txtUpfrontPHX").value;
                            }
                        }

                        //19-Oct-2021 | Arshad M/Sudarshan P | Even Price is valid Upfront is 0 | UBPINT-1646 FCN, DRA, Phoenix: Suitability flag incorrectly updated due to Upfront issue
                        if (Upfront === "0") {
                            Upfront = (100 - parseFloat(IssuerPrice)).toFixed(2);
                        }
                    }
                    else {
                        Upfront = document.getElementById("ctl00_MainContent_txtUpfrontPHX").value;
                    }
                    if (parent.document.getElementById("ctl00_MainContent_ddlTenorTypePHX").value.toUpperCase() == 'MONTH') {
                        TenorInMonths = document.getElementById("ctl00_MainContent_txtTenorPHX").value;
                    }
                    else {
                        TenorInMonths = parseInt(document.getElementById("ctl00_MainContent_txtTenorPHX").value) * 12;
                    }
                    Non_Call_Periods = document.getElementById("ctl00_MainContent_txtNonCall").value;
                    break;
                case "BENRFQ1.aspx":
                    share1 = document.getElementById("ctl00_MainContent_ddlShareBEN").value.split('/')[0].replace('(', '').replace(')', '')
                    if (document.getElementById("ctl00_MainContent_ddlShareBEN2") != null) {
                        share2 = document.getElementById("ctl00_MainContent_ddlShareBEN2").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share2 = "";
                    }
                    if (document.getElementById("ctl00_MainContent_ddlShareBEN3") != null) {
                        share3 = document.getElementById("ctl00_MainContent_ddlShareBEN3").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share3 = "";
                    }
                    if (document.getElementById("ctl00_MainContent_ddlShareBEN4") != null) {
                        share4 = document.getElementById("ctl00_MainContent_ddlShareBEN4").value.split('/')[0].replace('(', '').replace(')', '')
                    }
                    else {
                        share4 = "";
                    }
                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveForBEN").value.toUpperCase() == 'IB PRICE (%)') {
                        strike = document.getElementById("ctl00_MainContent_txtStrikeBEN").value;
                        IBPrice = IssuerPrice;
                        coupon = document.getElementById("ctl00_MainContent_txtCoupon").value
                    }
                    else if (parent.document.getElementById("ctl00_MainContent_ddlSolveForBEN").value.toUpperCase() == 'STRIKE (%)') {
                        strike = IssuerPrice;
                        IBPrice = document.getElementById("ctl00_MainContent_txtBENPrice").value;
                        coupon = document.getElementById("ctl00_MainContent_txtCoupon").value
                    } else if (parent.document.getElementById("ctl00_MainContent_ddlSolveForBEN").value.toUpperCase() == 'COUPON (%)') {
                        strike = document.getElementById("ctl00_MainContent_txtStrikeBEN").value;
                        IBPrice = document.getElementById("ctl00_MainContent_txtBENPrice").value
                        coupon = IssuerPrice;
                    }
                    couponFreq = "";
                    if (document.getElementById("ctl00_MainContent_chkKI").checked) {
                        KI = document.getElementById("ctl00_MainContent_txtKILevel").value;
                        KIType = document.getElementById("ctl00_MainContent_ddlKIType").value;
                    }
                    else {
                        KI = "0";
                        KIType = "";
                    }
                    KO = "0";
                    KOType = "";

                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveForBEN").value.toUpperCase() == "IB PRICE (%)") {
                        if (document.getElementById("ctl00_MainContent_txtUpfrontBEN") == null) {
                            Upfront = (100 - parseFloat(IssuerPrice)).toFixed(2);
                        }
                        else {
                            if (document.getElementById("ctl00_MainContent_txtUpfrontBEN").disabled == true) {
                                Upfront = (100 - parseFloat(IssuerPrice)).toFixed(2);
                            }
                            else {
                                Upfront = document.getElementById("ctl00_MainContent_txtUpfrontBEN").value;
                            }
                        }
                        //19-Oct-2021 | Arshad M/Sudarshan P | Even Price is valid Upfront is 0  | UBPINT-1646 FCN, DRA, Phoenix: Suitability flag incorrectly updated due to Upfront issue
                        if (Upfront === "0") {
                            Upfront = (100 - parseFloat(IssuerPrice)).toFixed(2);
                        }
                    }
                    else {
                        Upfront = document.getElementById("ctl00_MainContent_txtUpfrontBEN").value;
                    }
                    if (parent.document.getElementById("ctl00_MainContent_ddlTenorTypeBEN").value.toUpperCase() == 'MONTH') {
                        TenorInMonths = document.getElementById("ctl00_MainContent_txtTenorBEN").value;
                    }
                    else {
                        TenorInMonths = parseInt(document.getElementById("ctl00_MainContent_txtTenorBEN").value) * 12;
                    }
                    DayCount = "0"
                    NoteCcy = document.getElementById("ctl00_MainContent_ddlNoteCcy").value;
                    break;
                case "AccDecRFQ1.aspx":
                    share1 = document.getElementById("ctl00_MainContent_ddlShareAccumDecum").value.split('/')[0].replace('(', '').replace(')', '')
                    share2 = ""; share3 = ""; share4 = "";
                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveForAccumDecum").value.toUpperCase() == 'STRIKE (%)') {
                        strike = IssuerPrice;
                        Upfront = document.getElementById("ctl00_MainContent_txtUpfront").value;
                    }
                    else if (parent.document.getElementById("ctl00_MainContent_ddlSolveForAccumDecum").value.toUpperCase() == 'UPFRONT (%)') {
                        strike = document.getElementById("ctl00_MainContent_txtStrikeaccum").value;
                        Upfront = (IssuerPrice / 100).toFixed(2);
                    }
                    coupon = "0"
                    couponFreq = "";
                    KI = "0";
                    KIType = "";
                    IBPrice = "0";
                    KO = document.getElementById("ctl00_MainContent_txtKO").value;
                    KOType = document.getElementById("ctl00_MainContent_Label1").innerText; 
                    if (parent.document.getElementById("ctl00_MainContent_ddlTenorTypeAccum").value.toUpperCase() == 'MONTH') {
                        TenorInMonths = document.getElementById("ctl00_MainContent_txtTenorAccumDecum").value;
                    }
                    else {
                        TenorInMonths = parseInt(document.getElementById("ctl00_MainContent_txtTenorAccumDecum").value) * 12;
                    }                
                    if (document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenAccDays").value != "") {
                        DayCount = document.getElementById("ctl00_MainContent_" + btnDeal + "HiddenAccDays").value.split(";")[1];
                    }
                    else {
                        DayCount = "0";
                    }               
                    NoteCcy = document.getElementById("ctl00_MainContent_lblAQDQBaseCcy").innerText;
                    Product = document.getElementById("ctl00_MainContent_ddlAccumType").value;
                    break;
                case "EQORFQ1.aspx":
                    share1 = document.getElementById("ctl00_MainContent_ddlShareEQO").value.split('/')[0].replace('(', '').replace(')', '')
                    share2 = ""; share3 = ""; share4 = "";
                    if (parent.document.getElementById("ctl00_MainContent_ddlSolveforEQO").value.toUpperCase() == 'PREMIUM') {
                        IBPrice = IssuerPrice;
                    }
                    strike = document.getElementById("ctl00_MainContent_txtStrikeEQO").value; IssuerPrice;
                    Upfront = document.getElementById("ctl00_MainContent_txtUpfrontEQO").value; IssuerPrice; 
                    coupon = "0"
                    couponFreq = "";
                    KI = "0";
                    KIType = "";                
                    KO = "0";
                    KOType = "";

                    if (parent.document.getElementById("ctl00_MainContent_ddlTenorEQO").value.toUpperCase() == 'MONTH') {
                        TenorInMonths = document.getElementById("ctl00_MainContent_txtTenorEQO").value;
                    }
                    else {
                        TenorInMonths = parseInt(document.getElementById("ctl00_MainContent_txtTenorEQO").value) * 12;
                    }
                    DayCount = document.getElementById("ctl00_MainContent_lblDaysVal").innerText;
                    NoteCcy = document.getElementById("ctl00_MainContent_ddlSettlCcyEQO").value;
                    Product = "EQO";
                    break;
            }

            var filter = {
                "share1": share1,
                "share2": share2,
                "share3": share3,
                "share4": share4,
                "strike": strike,
                "coupon": coupon,
                "couponFreq": couponFreq,
                "KI": KI,
                "KIType": KIType,
                "KO": KO,
                "KOType": KOType,
                "IBPrice": IBPrice,
                "Upfront": Upfront,
                "TenorInMonths": TenorInMonths,
                "DayCount": DayCount,
                "NoteCcy": NoteCcy,
                "rfqID": rfqID,
                "Product": Product,
                "ClientPrice": ClientPrice,
                "Client_Yield": Client_Yield,
                "KO_Applicable": KO_Applicable,
                "Non_Call_Periods": Non_Call_Periods
            };

            strfyData = JSON.stringify(filter);
            $.support.cors = true;
            $.ajax({
                type: 'POST',
                url: '/FinIQWebApp/ELN_DealEntry1/' + myPageName + '/Update_ValidatedFlagReas',
                cache: false,
                data: "{obj:" + strfyData + "}",
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                success: function (data) {
                    console.log(data.d);
                },
                error: function (e) {
                    console.log(e);
                }
            });

    } catch (e) {

    }

}

function StopTimerTest() {
    try {
        clearTimeout(tmrJPM);
        $("#JPMwait").hide();
        if (document.getElementById('JPMwait') != null) { document.getElementById('JPMwait').style.visibility = 'hidden'; }
        clearTimeout(tmrHSBC);
        $("#HSBCwait").hide();
        if (document.getElementById('HSBCwait') != null) { document.getElementById('HSBCwait').style.visibility = 'hidden'; }
        clearTimeout(tmrCS);
        $("#CSwait").hide();
        if (document.getElementById('CSwait') != null) { document.getElementById('CSwait').style.visibility = 'hidden'; }
        clearTimeout(tmrUBS);
        $("#UBSwait").hide();
        if (document.getElementById('UBSwait') != null) { document.getElementById('UBSwait').style.visibility = 'hidden'; }
        clearTimeout(tmrMS);
        $("#MSwait").hide();
        if (document.getElementById('MSwait') != null) { document.getElementById('MSwait').style.visibility = 'hidden'; }
        clearTimeout(tmrTDS);
        $("#TDSwait").hide();
        if (document.getElementById('TDSwait') != null) { document.getElementById('TDSwait').style.visibility = 'hidden'; }
        clearTimeout(tmrNOMURA);
        $("#NOMURAwait").hide();
        if (document.getElementById('NOMURAwait') != null) { document.getElementById('NOMURAwait').style.visibility = 'hidden'; }
        clearTimeout(tmrBNPP);
        $("#BNPPwait").hide();
        if (document.getElementById('BNPPwait') != null) { document.getElementById('BNPPwait').style.visibility = 'hidden'; }
        clearTimeout(tmrSCB);
        $("#SCBwait").hide();
        if (document.getElementById('SCBwait') != null) { document.getElementById('SCBwait').style.visibility = 'hidden'; }
        clearTimeout(tmrOCBC);
        $("#OCBCwait").hide();
        if (document.getElementById('OCBCwait') != null) { document.getElementById('OCBCwait').style.visibility = 'hidden'; }
        clearTimeout(tmrCITI);
        $("#CITIwait").hide();
        if (document.getElementById('CITIwait') != null) { document.getElementById('CITIwait').style.visibility = 'hidden'; }
        clearTimeout(tmrBOCI);
        $("#BOCIwait").hide();
        if (document.getElementById('BOCIwait') != null) { document.getElementById('BOCIwait').style.visibility = 'hidden'; }
        clearTimeout(tmrLEONTEQ);
        $("#LEONTEQwait").hide();
        if (document.getElementById('LEONTEQwait') != null) { document.getElementById('LEONTEQwait').style.visibility = 'hidden'; }
        clearTimeout(tmrBARCLAYS);
        $("#BARCLAYSwait").hide();
        if (document.getElementById('BARCLAYSwait') != null) { document.getElementById('BARCLAYSwait').style.visibility = 'hidden'; }
        clearTimeout(tmrRBC);
        $("#RBCwait").hide();
        if (document.getElementById('RBCwait') != null) { document.getElementById('RBCwait').style.visibility = 'hidden'; }
        clearTimeout(tmrSOCGEN);
        $("#SOCGENwait").hide();
        if (document.getElementById('SOCGENwait') != null) { document.getElementById('SOCGENwait').style.visibility = 'hidden'; }
        clearTimeout(tmrNATIXIS);
        $("#NATIXISwait").hide();
        if (document.getElementById('NATIXISwait') != null) { document.getElementById('NATIXISwait').style.visibility = 'hidden'; }
        clearTimeout(tmrRAIFFEISEN);
        $("#RAIFFEISENwait").hide();
        if (document.getElementById('RAIFFEISENwait') != null) { document.getElementById('RAIFFEISENwait').style.visibility = 'hidden'; }
        clearTimeout(tmrVONTOBEL);
        $("#VONTOBELwait").hide();
        if (document.getElementById('VONTOBELwait') != null) { document.getElementById('VONTOBELwait').style.visibility = 'hidden'; }
        clearTimeout(tmrBBVA);
        $("#BBVAwait").hide();
        if (document.getElementById('BBVAwait') != null) { document.getElementById('BBVAwait').style.visibility = 'hidden'; }
        clearTimeout(tmrGS);
        $("#GSwait").hide();
        if (document.getElementById('GSwait') != null) { document.getElementById('GSwait').style.visibility = 'hidden'; }
    }
    catch (e) {
        console.log("StopTimerTest : " + e.message);
    }
}

function showLPBoxes() {
    try {
        if (document.getElementById("ctl00_MainContent_chkHSBC")) { document.getElementById("ctl00_MainContent_chkHSBC").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkUBS")) { document.getElementById("ctl00_MainContent_chkUBS").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkMS")) { document.getElementById("ctl00_MainContent_chkMS").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkTDS")) { document.getElementById("ctl00_MainContent_chkTDS").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkJPM")) { document.getElementById("ctl00_MainContent_chkJPM").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkBNPP")) { document.getElementById("ctl00_MainContent_chkBNPP").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkCS")) { document.getElementById("ctl00_MainContent_chkCS").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkNOMURA")) { document.getElementById("ctl00_MainContent_chkNOMURA").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkSCB")) { document.getElementById("ctl00_MainContent_chkSCB").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkOCBC")) { document.getElementById("ctl00_MainContent_chkOCBC").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkCITI")) { document.getElementById("ctl00_MainContent_chkCITI").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkBOCI")) { document.getElementById("ctl00_MainContent_chkBOCI").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkLEONTEQ")) { document.getElementById("ctl00_MainContent_chkLEONTEQ").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkBARCLAYS")) { document.getElementById("ctl00_MainContent_chkBARCLAYS").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkRBC")) { document.getElementById("ctl00_MainContent_chkRBC").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkSOCGEN")) { document.getElementById("ctl00_MainContent_chkSOCGEN").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkNATIXIS")) { document.getElementById("ctl00_MainContent_chkNATIXIS").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkRAIFFEISEN")) { document.getElementById("ctl00_MainContent_chkRAIFFEISEN").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkVONTOBEL")) { document.getElementById("ctl00_MainContent_chkVONTOBEL").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkBBVA")) { document.getElementById("ctl00_MainContent_chkBBVA").style.visibility = 'visible'; }
        if (document.getElementById("ctl00_MainContent_chkGS")) { document.getElementById("ctl00_MainContent_chkGS").style.visibility = 'visible'; }
    }
    catch (e) {
        console.log("showLPBoxes : " + e.message);
    }
}

function hideLPBoxes() {
    try {
        if (document.getElementById("ctl00_MainContent_chkHSBC")) {
            if (!document.getElementById("ctl00_MainContent_chkHSBC").checked) { document.getElementById("ctl00_MainContent_chkHSBC").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkUBS")) {
            if (!document.getElementById("ctl00_MainContent_chkUBS").checked) { document.getElementById("ctl00_MainContent_chkUBS").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkMS")) {
            if (!document.getElementById("ctl00_MainContent_chkMS").checked) { document.getElementById("ctl00_MainContent_chkMS").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkTDS")) {
            if (!document.getElementById("ctl00_MainContent_chkTDS").checked) { document.getElementById("ctl00_MainContent_chkTDS").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkJPM")) {
            if (!document.getElementById("ctl00_MainContent_chkJPM").checked) { document.getElementById("ctl00_MainContent_chkJPM").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkBNPP")) {
            if (!document.getElementById("ctl00_MainContent_chkBNPP").checked) { document.getElementById("ctl00_MainContent_chkBNPP").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkCS")) {
            if (!document.getElementById("ctl00_MainContent_chkCS").checked) { document.getElementById("ctl00_MainContent_chkCS").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkNOMURA")) {
            if (!document.getElementById("ctl00_MainContent_chkNOMURA").checked) { document.getElementById("ctl00_MainContent_chkNOMURA").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkSCB")) {
            if (!document.getElementById("ctl00_MainContent_chkSCB").checked) { document.getElementById("ctl00_MainContent_chkSCB").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkOCBC")) {
            if (!document.getElementById("ctl00_MainContent_chkOCBC").checked) { document.getElementById("ctl00_MainContent_chkOCBC").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkCITI")) {
            if (!document.getElementById("ctl00_MainContent_chkCITI").checked) { document.getElementById("ctl00_MainContent_chkCITI").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkBOCI")) {
            if (!document.getElementById("ctl00_MainContent_chkBOCI").checked) { document.getElementById("ctl00_MainContent_chkBOCI").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkLEONTEQ")) {
            if (!document.getElementById("ctl00_MainContent_chkLEONTEQ").checked) { document.getElementById("ctl00_MainContent_chkLEONTEQ").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkBARCLAYS")) {
            if (!document.getElementById("ctl00_MainContent_chkBARCLAYS").checked) { document.getElementById("ctl00_MainContent_chkBARCLAYS").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkRBC")) {
            if (!document.getElementById("ctl00_MainContent_chkRBC").checked) { document.getElementById("ctl00_MainContent_chkRBC").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkSOCGEN")) {
            if (!document.getElementById("ctl00_MainContent_chkSOCGEN").checked) { document.getElementById("ctl00_MainContent_chkSOCGEN").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkNATIXIS")) {
            if (!document.getElementById("ctl00_MainContent_chkNATIXIS").checked) { document.getElementById("ctl00_MainContent_chkNATIXIS").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkRAIFFEISEN")) {
            if (!document.getElementById("ctl00_MainContent_chkRAIFFEISEN").checked) { document.getElementById("ctl00_MainContent_chkRAIFFEISEN").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkVONTOBEL")) {
            if (!document.getElementById("ctl00_MainContent_chkVONTOBEL").checked) { document.getElementById("ctl00_MainContent_chkVONTOBEL").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkBBVA")) {
            if (!document.getElementById("ctl00_MainContent_chkBBVA").checked) { document.getElementById("ctl00_MainContent_chkBBVA").style.visibility = 'hidden'; }
        }
        if (document.getElementById("ctl00_MainContent_chkGS")) {
            if (!document.getElementById("ctl00_MainContent_chkGS").checked) { document.getElementById("ctl00_MainContent_chkGS").style.visibility = 'hidden'; }
        }

    }
    catch (e) {
        console.log("hideLPBoxes : " + e.message);
    }
}

function StopPolling() {
    try {
        clearInterval(intervalCopyJPM);
        clearInterval(intervalCopyHSBC);
        clearInterval(intervalCopyUBS);
        clearInterval(intervalCopyMS);
        clearInterval(intervalCopyTDS);
        clearInterval(intervalCopyCS);
        clearInterval(intervalCopyNOMURA);
        clearInterval(intervalCopyBNPP);
        clearInterval(intervalCopySCB);
        clearInterval(intervalCopyOCBC);
        clearInterval(intervalCopyCITI);
        clearInterval(intervalCopyBOCI);
        clearInterval(intervalCopyLEONTEQ);
        clearInterval(intervalCopyBARCLAYS);
        clearInterval(intervalCopyRBC);
        clearInterval(intervalCopySOCGEN);
        clearInterval(intervalCopyNATIXIS);
        clearInterval(intervalCopyRAIFFEISEN);
        clearInterval(intervalCopyVONTOBEL);
        clearInterval(intervalCopyBBVA);
        clearInterval(intervalCopyGS);

        processingJPM = false;
        processingHSBC = false;
        processingUBS = false;
        processingMS = false;
        processingTDS = false;
        processingCS = false;
        processingNOMURA = false;
        processingBNPP = false;
        processingSCB = false;
        processingOCBC = false;
        processingCITI = false;
        processingBOCI = false;
        processingLEONTEQ = false;
        processingBARCLAYS = false;
        processingRBC = false;
        processingSOCGEN = false;
        processingNATIXIS = false;
        processingRAIFFEISEN = false;
        processingVONTOBEL = false;
        processingBBVA = false;
        processingGS = false;
        processingDBIB = false;
        processingBAML = false;
        processingDBS = false;
        processingEFG = false;
    }
    catch (e) {
        console.log("StopPolling : " + e.message);
    }
}

function StopAllTimers() {
    try {
        clearTimeout(tmrJPM);
        document.getElementById("ctl00_MainContent_lblTimerHSBC").innerHTML = "";
        clearTimeout(tmrHSBC);
        document.getElementById("ctl00_MainContent_lblTimerJPM").innerHTML = "";
        clearTimeout(tmrCS);
        document.getElementById("ctl00_MainContent_lblTimerUBS").innerHTML = "";
        clearTimeout(tmrUBS);
        document.getElementById("ctl00_MainContent_lblTimerMS").innerHTML = "";
        clearTimeout(tmrMS);
        document.getElementById("ctl00_MainContent_lblTimerTDS").innerHTML = "";
        clearTimeout(tmrTDS);
        document.getElementById("ctl00_MainContent_lblTimerCS").innerHTML = "";
        clearTimeout(tmrNOMURA);
        document.getElementById("ctl00_MainContent_lblTimerNOMURA").innerHTML = "";
        clearTimeout(tmrBNPP);
        document.getElementById("ctl00_MainContent_lblTimerBNPP").innerHTML = "";
        clearTimeout(tmrSCB);
        document.getElementById("ctl00_MainContent_lblTimerSCB").innerHTML = "";
        clearTimeout(tmrOCBC);
        document.getElementById("ctl00_MainContent_lblTimerOCBC").innerHTML = "";
        clearTimeout(tmrCITI);
        document.getElementById("ctl00_MainContent_lblTimerCITI").innerHTML = "";
        clearTimeout(tmrBOCI);
        document.getElementById("ctl00_MainContent_lblTimerBOCI").innerHTML = "";
        clearTimeout(tmrLEONTEQ);
        document.getElementById("ctl00_MainContent_lblTimerLEONTEQ").innerHTML = "";
        clearTimeout(tmrBARCLAYS);
        document.getElementById("ctl00_MainContent_lblTimerBARCLAYS").innerHTML = "";
        document.getElementById("ctl00_MainContent_lblTimerRBC").innerHTML = "";
        clearTimeout(tmrRBC);
        document.getElementById("ctl00_MainContent_lblTimerSOCGEN").innerHTML = "";
        clearTimeout(tmrSOCGEN);
        document.getElementById("ctl00_MainContent_lblTimerNATIXIS").innerHTML = "";
        clearTimeout(tmrNATIXIS);
        document.getElementById("ctl00_MainContent_lblTimerRAIFFEISEN").innerHTML = "";
        clearTimeout(tmrRAIFFEISEN);
        document.getElementById("ctl00_MainContent_lblTimerVONTOBEL").innerHTML = "";
        clearTimeout(tmrVONTOBEL);
        document.getElementById("ctl00_MainContent_lblTimerBBVA").innerHTML = "";
        clearTimeout(tmrBBVA);

        document.getElementById("ctl00_MainContent_lblTimerGS").innerHTML = "";
        clearTimeout(tmrGS);
        JPMHiddenPrice = document.getElementById("ctl00_MainContent_JPMHiddenPrice");
        JPMHiddenPrice.value = ';Disable;Disable;Disable;Price';
        JPMHiddenRFQID = document.getElementById("ctl00_MainContent_JPMHiddenRFQID");
        JPMHiddenRFQID.value = '';
        HSBCHiddenPrice = document.getElementById("ctl00_MainContent_HSBCHiddenPrice");
        HSBCHiddenPrice.value = ';Disable;Disable;Disable;Price';
        HSBCHiddenRFQID = document.getElementById("ctl00_MainContent_HSBCHiddenRFQID");
        HSBCHiddenRFQID.value = '';
        CSHiddenPrice = document.getElementById("ctl00_MainContent_CSHiddenPrice");
        CSHiddenPrice.value = ';Disable;Disable;Disable;Price';
        CSHiddenRFQID = document.getElementById("ctl00_MainContent_CSHiddenRFQID");
        CSHiddenRFQID.value = '';
        UBSHiddenPrice = document.getElementById("ctl00_MainContent_UBSHiddenPrice");
        UBSHiddenPrice.value = ';Disable;Disable;Disable;Price';
        UBSHiddenRFQID = document.getElementById("ctl00_MainContent_UBSHiddenRFQID");
        UBSHiddenRFQID.value = '';
        MSHiddenPrice = document.getElementById("ctl00_MainContent_MSHiddenPrice");
        MSHiddenPrice.value = ';Disable;Disable;Disable;Price';
        MSHiddenRFQID = document.getElementById("ctl00_MainContent_MSHiddenRFQID");
        MSHiddenRFQID.value = '';
        TDSHiddenPrice = document.getElementById("ctl00_MainContent_TDSHiddenPrice");
        TDSHiddenPrice.value = ';Disable;Disable;Disable;Price';
        TDSHiddenRFQID = document.getElementById("ctl00_MainContent_TDSHiddenRFQID");
        TDSHiddenRFQID.value = '';
        NOMURAHiddenPrice = document.getElementById("ctl00_MainContent_NOMURAHiddenPrice");
        NOMURAHiddenPrice.value = ';Disable;Disable;Disable;Price';
        NOMURAHiddenRFQID = document.getElementById("ctl00_MainContent_NOMURAHiddenRFQID");
        NOMURAHiddenRFQID.value = '';
        BNPPHiddenPrice = document.getElementById("ctl00_MainContent_BNPPHiddenPrice");
        BNPPHiddenPrice.value = ';Disable;Disable;Disable;Price';
        BNPPHiddenRFQID = document.getElementById("ctl00_MainContent_BNPPHiddenRFQID");
        BNPPHiddenRFQID.value = '';
        SCBHiddenPrice = document.getElementById("ctl00_MainContent_SCBHiddenPrice");
        SCBHiddenPrice.value = ';Disable;Disable;Disable;Price';
        SCBHiddenRFQID = document.getElementById("ctl00_MainContent_SCBHiddenRFQID");
        SCBHiddenRFQID.value = '';
        OCBCHiddenPrice = document.getElementById("ctl00_MainContent_OCBCHiddenPrice");
        OCBCHiddenPrice.value = ';Disable;Disable;Disable;Price';
        OCBCHiddenRFQID = document.getElementById("ctl00_MainContent_OCBCHiddenRFQID");
        OCBCHiddenRFQID.value = '';
        CITIHiddenPrice = document.getElementById("ctl00_MainContent_CITIHiddenPrice");
        CITIHiddenPrice.value = ';Disable;Disable;Disable;Price';
        CITIHiddenRFQID = document.getElementById("ctl00_MainContent_CITIHiddenRFQID");
        CITIHiddenRFQID.value = '';
        BOCIHiddenPrice = document.getElementById("ctl00_MainContent_BOCIHiddenPrice");
        BOCIHiddenPrice.value = ';Disable;Disable;Disable;Price';
        BOCIHiddenRFQID = document.getElementById("ctl00_MainContent_BOCIHiddenRFQID");
        BOCIHiddenRFQID.value = '';
        LEONTEQHiddenPrice = document.getElementById("ctl00_MainContent_LEONTEQHiddenPrice");
        LEONTEQHiddenPrice.value = ';Disable;Disable;Disable;Price';
        LEONTEQHiddenRFQID = document.getElementById("ctl00_MainContent_LEONTEQHiddenRFQID");
        LEONTEQHiddenRFQID.value = '';
        BARCLAYSHiddenPrice = document.getElementById("ctl00_MainContent_BARCLAYSHiddenPrice");
        BARCLAYSHiddenPrice.value = ';Disable;Disable;Disable;Price';
        BARCLAYSHiddenRFQID = document.getElementById("ctl00_MainContent_BARCLAYSHiddenRFQID");
        BARCLAYSHiddenRFQID.value = '';
        RBCHiddenPrice = document.getElementById("ctl00_MainContent_RBCHiddenPrice");
        RBCHiddenPrice.value = ';Disable;Disable;Disable;Price';
        RBCHiddenRFQID = document.getElementById("ctl00_MainContent_RBCHiddenRFQID");
        RBCHiddenRFQID.value = '';
        SOCGENHiddenPrice = document.getElementById("ctl00_MainContent_SOCGENHiddenPrice");
        SOCGENHiddenPrice.value = ';Disable;Disable;Disable;Price';
        SOCGENHiddenRFQID = document.getElementById("ctl00_MainContent_SOCGENHiddenRFQID");
        SOCGENHiddenRFQID.value = '';
        NATIXISHiddenPrice = document.getElementById("ctl00_MainContent_NATIXISHiddenPrice");
        NATIXISHiddenPrice.value = ';Disable;Disable;Disable;Price';
        NATIXISHiddenRFQID = document.getElementById("ctl00_MainContent_NATIXISHiddenRFQID");
        NATIXISHiddenRFQID.value = '';
        RAIFFEISENHiddenPrice = document.getElementById("ctl00_MainContent_RAIFFEISENHiddenPrice");
        RAIFFEISENHiddenPrice.value = ';Disable;Disable;Disable;Price';
        RAIFFEISENHiddenRFQID = document.getElementById("ctl00_MainContent_RAIFFEISENHiddenRFQID");
        RAIFFEISENHiddenRFQID.value = '';
        VONTOBELHiddenPrice = document.getElementById("ctl00_MainContent_VONTOBELHiddenPrice");
        VONTOBELHiddenPrice.value = ';Disable;Disable;Disable;Price';
        VONTOBELHiddenRFQID = document.getElementById("ctl00_MainContent_VONTOBELHiddenRFQID");
        VONTOBELHiddenRFQID.value = '';
        BBVAHiddenPrice = document.getElementById("ctl00_MainContent_BBVAHiddenPrice");
        BBVAHiddenPrice.value = ';Disable;Disable;Disable;Price';
        BBVAHiddenRFQID = document.getElementById("ctl00_MainContent_BBVAHiddenRFQID");
        BBVAHiddenRFQID.value = '';
        GSHiddenPrice = document.getElementById("ctl00_MainContent_GSHiddenPrice");
        GSHiddenPrice.value = ';Disable;Disable;Disable;Price';
        GSHiddenRFQID = document.getElementById("ctl00_MainContent_GSHiddenRFQID");
        GSHiddenRFQID.value = '';
    }
    catch (e) {
        console.log("StopAllTimers : " + e.message);
    }
}

function StopPPTimerValue(btnDeal) {
    try {
        if (btnDeal.indexOf("JPM") == 0 || btnDeal.indexOf("JPM") == 21) {
            clearTimeout(tmrJPM);
            $("#JPMwait").hide();
            if (document.getElementById('JPMwait') != null) {
                document.getElementById('JPMwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("HSBC") == 0 || btnDeal.indexOf("HSBC") == 21) {
            clearTimeout(tmrHSBC);
            $("#HSBCwait").hide();
            if (document.getElementById('HSBCwait') != null) {
                document.getElementById('HSBCwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("CS") == 0 || btnDeal.indexOf("CS") == 21) {
            clearTimeout(tmrCS);
            $("#CSwait").hide();
            if (document.getElementById('CSwait') != null) {
                document.getElementById('CSwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("UBS") == 0 || btnDeal.indexOf("UBS") == 21) {
            clearTimeout(tmrUBS);
            $("#UBSwait").hide();
            if (document.getElementById('UBSwait') != null) {
                document.getElementById('UBSwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("MS") == 0 || btnDeal.indexOf("MS") == 21) {
            clearTimeout(tmrMS);
            $("#MSwait").hide();
            if (document.getElementById('MSwait') != null) {
                document.getElementById('MSwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("TDS") == 0 || btnDeal.indexOf("TDS") == 21) {
            clearTimeout(tmrTDS);
            $("#TDSwait").hide();
            if (document.getElementById('TDSwait') != null) {
                document.getElementById('TDSwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("NOMURA") == 0 || btnDeal.indexOf("NOMURA") == 21) {
            clearTimeout(tmrNOMURA);
            $("#NOMURAwait").hide();
            if (document.getElementById('NOMURAwait') != null) {
                document.getElementById('NOMURAwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("BNPP") == 0 || btnDeal.indexOf("BNPP") == 21) {
            clearTimeout(tmrBNPP);
            $("#BNPPwait").hide();
            if (document.getElementById('BNPPwait') != null) {
                document.getElementById('BNPPwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("SCB") == 0 || btnDeal.indexOf("SCB") == 21) {
            clearTimeout(tmrSCB);
            $("#SCBwait").hide();
            if (document.getElementById('SCBwait') != null) {
                document.getElementById('SCBwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("OCBC") == 0 || btnDeal.indexOf("OCBC") == 21) {
            clearTimeout(tmrOCBC);
            $("#OCBCwait").hide();
            if (document.getElementById('OCBCwait') != null) {
                document.getElementById('OCBCwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("CITI") == 0 || btnDeal.indexOf("CITI") == 21) {
            clearTimeout(tmrCITI);
            $("#CITIwait").hide();
            if (document.getElementById('CITIwait') != null) {
                document.getElementById('CITIwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("BOCI") == 0 || btnDeal.indexOf("BOCI") == 21) {
            clearTimeout(tmrBOCI);
            $("#BOCIwait").hide();
            if (document.getElementById('BOCIwait') != null) {
                document.getElementById('BOCIwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("LEONTEQ") == 0 || btnDeal.indexOf("LEONTEQ") == 21) {
            clearTimeout(tmrLEONTEQ);
            $("#LEONTEQwait").hide();
            if (document.getElementById('LEONTEQwait') != null) {
                document.getElementById('LEONTEQwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("BARCLAYS") == 0 || btnDeal.indexOf("BARCLAYS") == 21) {
            clearTimeout(tmrBARCLAYS);
            $("#BARCLAYSwait").hide();
            if (document.getElementById('BARCLAYSwait') != null) {
                document.getElementById('BARCLAYSwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("RBC") == 0 || btnDeal.indexOf("RBC") == 21) {
            clearTimeout(tmrRBC);
            $("#RBCwait").hide();
            if (document.getElementById('RBCwait') != null) {
                document.getElementById('RBCwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("SOCGEN") == 0 || btnDeal.indexOf("SOCGEN") == 21) {

            clearTimeout(tmrSOCGEN);
            $("#SOCGENwait").hide();
            if (document.getElementById('SOCGENwait') != null) {
                document.getElementById('SOCGENwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("NATIXIS") == 0 || btnDeal.indexOf("NATIXIS") == 21) {
            clearTimeout(tmrNATIXIS);
            $("#NATIXISwait").hide();
            if (document.getElementById('NATIXISwait') != null) {
                document.getElementById('NATIXISwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("RAIFFEISEN") == 0 || btnDeal.indexOf("RAIFFEISEN") == 21) {
            clearTimeout(tmrRAIFFEISEN);
            $("#RAIFFEISENwait").hide();
            if (document.getElementById('RAIFFEISENwait') != null) {
                document.getElementById('RAIFFEISENwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("VONTOBEL") == 0 || btnDeal.indexOf("VONTOBEL") == 21) {
            clearTimeout(tmrVONTOBEL);
            $("#VONTOBELwait").hide();
            if (document.getElementById('VONTOBELwait') != null) {
                document.getElementById('VONTOBELwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("BBVA") == 0 || btnDeal.indexOf("BBVA") == 21) {
            clearTimeout(tmrBBVA);
            $("#BBVAwait").hide();
            if (document.getElementById('BBVAwait') != null) {
                document.getElementById('BBVAwait').style.visibility = 'hidden';
            }
        }
        else if (btnDeal.indexOf("GS") == 0 || btnDeal.indexOf("GS") == 21) {
            clearTimeout(tmrGS);
            $("#GSwait").hide();
            if (document.getElementById('GSwait') != null) {
                document.getElementById('GSwait').style.visibility = 'hidden';
            }
        }
    }
    catch (e) {
        console.log("StopPPTimerValue : " + e.message);
    }
}

function StopPPTimer(lblPrice, btnDeal, btnPrice1) {
    try {
        setPriceAllEnableDisable();
        $("#" + lblPrice).text("");
        document.getElementById(btnPrice1).disabled = false;
        document.getElementById(btnDeal).disabled = true;
        $("#" + btnPrice1).removeClass("btnDisabled").addClass("btn");
        $("#" + btnDeal).removeClass("btn").addClass("btnDisabled");
        if (btnDeal.indexOf("JPM") == 0) {
            clearTimeout(tmrJPM);
            JPMHiddenPrice = document.getElementById("ctl00_MainContent_JPMHiddenPrice");
            JPMHiddenPrice.value = ';Enable;Disable;Disable;Price';
            JPMHiddenRFQID = document.getElementById("ctl00_MainContent_JPMHiddenRFQID");
            JPMHiddenRFQID.value = '';
            $("#JPMwait").hide();
        }
        else if (btnDeal.indexOf("HSBC") == 0) {
            clearTimeout(tmrHSBC);
            HSBCHiddenPrice = document.getElementById("ctl00_MainContent_HSBCHiddenPrice");
            HSBCHiddenPrice.value = ';Enable;Disable;Disable;Price';
            HSBCHiddenRFQID = document.getElementById("ctl00_MainContent_HSBCHiddenRFQID");
            HSBCHiddenRFQID.value = '';
            $("#HSBCwait").hide();
        }
        else if (btnDeal.indexOf("CS") == 0) {
            clearTimeout(tmrCS);
            CSHiddenPrice = document.getElementById("ctl00_MainContent_CSHiddenPrice");
            CSHiddenPrice.value = ';Enable;Disable;Disable;Price';
            CSHiddenRFQID = document.getElementById("ctl00_MainContent_CSHiddenRFQID");
            CSHiddenRFQID.value = '';
            $("#CSwait").hide();
        }
        else if (btnDeal.indexOf("UBS") == 0) {
            clearTimeout(tmrUBS);
            UBSHiddenPrice = document.getElementById("ctl00_MainContent_UBSHiddenPrice");
            UBSHiddenPrice.value = ';Enable;Disable;Disable;Price';
            UBSHiddenRFQID = document.getElementById("ctl00_MainContent_UBSHiddenRFQID");
            UBSHiddenRFQID.value = '';
            $("#UBSwait").hide();
        }
        else if (btnDeal.indexOf("MS") == 0) {
            clearTimeout(tmrMS);
            MSHiddenPrice = document.getElementById("ctl00_MainContent_MSHiddenPrice");
            MSHiddenPrice.value = ';Enable;Disable;Disable;Price';
            MSHiddenRFQID = document.getElementById("ctl00_MainContent_MSHiddenRFQID");
            MSHiddenRFQID.value = '';
            $("#MSwait").hide();
        }
        else if (btnDeal.indexOf("TDS") == 0) {
            clearTimeout(tmrTDS);
            TDSHiddenPrice = document.getElementById("ctl00_MainContent_TDSHiddenPrice");
            TDSHiddenPrice.value = ';Enable;Disable;Disable;Price';
            TDSHiddenRFQID = document.getElementById("ctl00_MainContent_TDSHiddenRFQID");
            TDSHiddenRFQID.value = '';
            $("#TDSwait").hide();
        }
        else if (btnDeal.indexOf("NOMURA") == 0) {
            clearTimeout(tmrNOMURA);
            NOMURAHiddenPrice = document.getElementById("ctl00_MainContent_NOMURAHiddenPrice");
            NOMURAHiddenPrice.value = ';Enable;Disable;Disable;Price';
            NOMURAHiddenRFQID = document.getElementById("ctl00_MainContent_NOMURAHiddenRFQID");
            NOMURAHiddenRFQID.value = '';
            $("#NOMURAwait").hide();
        }
        else if (btnDeal.indexOf("BNPP") == 0) {
            clearTimeout(tmrBNPP);
            BNPPHiddenPrice = document.getElementById("ctl00_MainContent_BNPPHiddenPrice");
            BNPPHiddenPrice.value = ';Enable;Disable;Disable;Price';
            BNPPHiddenRFQID = document.getElementById("ctl00_MainContent_BNPPHiddenRFQID");
            BNPPHiddenRFQID.value = '';
            $("#BNPPwait").hide();
        }
        else if (btnDeal.indexOf("SCB") == 0) {
            clearTimeout(tmrSCB);
            SCBHiddenPrice = document.getElementById("ctl00_MainContent_SCBHiddenPrice");
            SCBHiddenPrice.value = ';Enable;Disable;Disable;Price';
            SCBHiddenRFQID = document.getElementById("ctl00_MainContent_SCBHiddenRFQID");
            SCBHiddenRFQID.value = '';
            $("#SCBwait").hide();
        }
        else if (btnDeal.indexOf("OCBC") == 0) {
            clearTimeout(tmrOCBC);
            OCBCHiddenPrice = document.getElementById("ctl00_MainContent_OCBCHiddenPrice");
            OCBCHiddenPrice.value = ';Enable;Disable;Disable;Price';
            OCBCHiddenRFQID = document.getElementById("ctl00_MainContent_OCBCHiddenRFQID");
            OCBCHiddenRFQID.value = '';
            $("#OCBCwait").hide();
        }
        else if (btnDeal.indexOf("CITI") == 0) {
            clearTimeout(tmrCITI);
            CITIHiddenPrice = document.getElementById("ctl00_MainContent_CITIHiddenPrice");
            CITIHiddenPrice.value = ';Enable;Disable;Disable;Price';
            CITIHiddenRFQID = document.getElementById("ctl00_MainContent_CITIHiddenRFQID");
            CITIHiddenRFQID.value = '';
            $("#CITIwait").hide();
        }
        else if (btnDeal.indexOf("BOCI") == 0) {
            clearTimeout(tmrBOCI);
            BOCIHiddenPrice = document.getElementById("ctl00_MainContent_BOCIHiddenPrice");
            BOCIHiddenPrice.value = ';Enable;Disable;Disable;Price';
            BOCIHiddenRFQID = document.getElementById("ctl00_MainContent_BOCIHiddenRFQID");
            BOCIHiddenRFQID.value = '';
            $("#BOCIwait").hide();
        }
        else if (btnDeal.indexOf("LEONTEQ") == 0) {
            clearTimeout(tmrLEONTEQ);
            LEONTEQHiddenPrice = document.getElementById("ctl00_MainContent_LEONTEQHiddenPrice");
            LEONTEQHiddenPrice.value = ';Enable;Disable;Disable;Price';
            LEONTEQHiddenRFQID = document.getElementById("ctl00_MainContent_LEONTEQHiddenRFQID");
            LEONTEQHiddenRFQID.value = '';
            $("#LEONTEQwait").hide();
        }
        else if (btnDeal.indexOf("BARCLAYS") == 0) {
            clearTimeout(tmrBARCLAYS);
            BARCLAYSHiddenPrice = document.getElementById("ctl00_MainContent_BARCLAYSHiddenPrice");
            BARCLAYSHiddenPrice.value = ';Enable;Disable;Disable;Price';
            BARCLAYSHiddenRFQID = document.getElementById("ctl00_MainContent_BARCLAYSHiddenRFQID");
            BARCLAYSHiddenRFQID.value = '';
            $("#BARCLAYSwait").hide();
        }
        else if (btnDeal.indexOf("RBC") == 0) {
            clearTimeout(tmrRBC);
            RBCHiddenPrice = document.getElementById("ctl00_MainContent_RBCHiddenPrice");
            RBCHiddenPrice.value = ';Enable;Disable;Disable;Price';
            RBCHiddenRFQID = document.getElementById("ctl00_MainContent_RBCHiddenRFQID");
            RBCHiddenRFQID.value = '';
            $("#RBCwait").hide();
        }
        else if (btnDeal.indexOf("SOCGEN") == 0) {
            clearTimeout(tmrSOCGEN);
            SOCGENHiddenPrice = document.getElementById("ctl00_MainContent_SOCGENHiddenPrice");
            SOCGENHiddenPrice.value = ';Enable;Disable;Disable;Price';
            SOCGENHiddenRFQID = document.getElementById("ctl00_MainContent_SOCGENHiddenRFQID");
            SOCGENHiddenRFQID.value = '';
            $("#SOCGENwait").hide();
        }
        else if (btnDeal.indexOf("NATIXIS") == 0) {
            clearTimeout(tmrNATIXIS);
            NATIXISHiddenPrice = document.getElementById("ctl00_MainContent_NATIXISHiddenPrice");
            NATIXISHiddenPrice.value = ';Enable;Disable;Disable;Price';
            NATIXISHiddenRFQID = document.getElementById("ctl00_MainContent_NATIXISHiddenRFQID");
            NATIXISHiddenRFQID.value = '';
            $("#NATIXISwait").hide();
        }
        else if (btnDeal.indexOf("RAIFFEISEN") == 0) {
            clearTimeout(tmrRAIFFEISEN);
            RAIFFEISENHiddenPrice = document.getElementById("ctl00_MainContent_RAIFFEISENHiddenPrice");
            RAIFFEISENHiddenPrice.value = ';Enable;Disable;Disable;Price';
            RAIFFEISENHiddenRFQID = document.getElementById("ctl00_MainContent_RAIFFEISENHiddenRFQID");
            RAIFFEISENHiddenRFQID.value = '';
            $("#RAIFFEISENwait").hide();
        }
        else if (btnDeal.indexOf("VONTOBEL") == 0) {
            clearTimeout(tmrVONTOBEL);
            VONTOBELHiddenPrice = document.getElementById("ctl00_MainContent_VONTOBELHiddenPrice");
            VONTOBELHiddenPrice.value = ';Enable;Disable;Disable;Price';
            VONTOBELHiddenRFQID = document.getElementById("ctl00_MainContent_VONTOBELHiddenRFQID");
            VONTOBELHiddenRFQID.value = '';
            $("#VONTOBELwait").hide();
        }
        else if (btnDeal.indexOf("BBVA") == 0) {
            clearTimeout(tmrBBVA);
            BBVAHiddenPrice = document.getElementById("ctl00_MainContent_BBVAHiddenPrice");
            BBVAHiddenPrice.value = ';Enable;Disable;Disable;Price';
            BBVAHiddenRFQID = document.getElementById("ctl00_MainContent_BBVAHiddenRFQID");
            BBVAHiddenRFQID.value = '';
            $("#BBVAwait").hide();
        }
        else if (btnDeal.indexOf("GS") == 0) {
            clearTimeout(tmrGS);
            GSHiddenPrice = document.getElementById("ctl00_MainContent_GSHiddenPrice");
            GSHiddenPrice.value = ';Enable;Disable;Disable;Price';
            GSHiddenRFQID = document.getElementById("ctl00_MainContent_GSHiddenRFQID");
            GSHiddenRFQID.value = '';
            $("#GSwait").hide();
        }
    }
    catch (e) {
        console.log("StopPPTimer : " + e.message);
    }
}

function InitializeTimer(lblid, ValidityTime, btnDeal, btnPrice) {
    try {
        setTimeout(setPriceAllEnableDisable, 500);
        if (ValidityTime == "") ValidityTime = orderValiditySec;
        document.getElementById(lblid).innerHTML = Pad(ValidityTime);
        if (ValidityTime < 20) { document.getElementById(lblid).style.color = "red"; }
        ValidityTime = ValidityTime - 1;
        if (ValidityTime <= 0) {
            if (btnDeal.indexOf("JPM") == 0) {
                JPMHiddenPrice = document.getElementById("ctl00_MainContent_JPMHiddenPrice");
                JPMHiddenPrice.value = JPMHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrJPM);
                processingJPM = false;
            }
            else if (btnDeal.indexOf("HSBC") == 0) {
                HSBCHiddenPrice = document.getElementById("ctl00_MainContent_HSBCHiddenPrice");
                HSBCHiddenPrice.value = HSBCHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrHSBC);
                processingHSBC = false;
            }
            else if (btnDeal.indexOf("CS") == 0) {
                CSHiddenPrice = document.getElementById("ctl00_MainContent_CSHiddenPrice");
                CSHiddenPrice.value = CSHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrCS);
                processingCS = false;
            }
            else if (btnDeal.indexOf("UBS") == 0) {
                UBSHiddenPrice = document.getElementById("ctl00_MainContent_UBSHiddenPrice");
                UBSHiddenPrice.value = UBSHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrUBS);
                processingUBS = false;
            }
            else if (btnDeal.indexOf("MS") == 0) {
                MSHiddenPrice = document.getElementById("ctl00_MainContent_MSHiddenPrice");
                MSHiddenPrice.value = MSHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrMS);
                processingMS = false;
            }
            else if (btnDeal.indexOf("TDS") == 0) {
                TDSHiddenPrice = document.getElementById("ctl00_MainContent_TDSHiddenPrice");
                TDSHiddenPrice.value = TDSHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrTDS);
                processingTDS = false;
            }
            else if (btnDeal.indexOf("NOMURA") == 0) {
                NOMURAHiddenPrice = document.getElementById("ctl00_MainContent_NOMURAHiddenPrice");
                NOMURAHiddenPrice.value = NOMURAHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrNOMURA);
                processingNOMURA = false;
            }
            else if (btnDeal.indexOf("BNPP") == 0) {
                BNPPHiddenPrice = document.getElementById("ctl00_MainContent_BNPPHiddenPrice");
                BNPPHiddenPrice.value = BNPPHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrBNPP);
                processingBNPP = false;
            }
            else if (btnDeal.indexOf("SCB") == 0) {
                SCBHiddenPrice = document.getElementById("ctl00_MainContent_SCBHiddenPrice");
                SCBHiddenPrice.value = SCBHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrSCB);
                processingSCB = false;
            }
            else if (btnDeal.indexOf("OCBC") == 0) {
                OCBCHiddenPrice = document.getElementById("ctl00_MainContent_OCBCHiddenPrice");
                OCBCHiddenPrice.value = OCBCHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrOCBC);
                processingOCBC = false;
            }
            else if (btnDeal.indexOf("CITI") == 0) {
                CITIHiddenPrice = document.getElementById("ctl00_MainContent_CITIHiddenPrice");
                CITIHiddenPrice.value = CITIHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrCITI);
                processingCITI = false;
            }
            else if (btnDeal.indexOf("BOCI") == 0) {
                BOCIHiddenPrice = document.getElementById("ctl00_MainContent_BOCIHiddenPrice");
                BOCIHiddenPrice.value = BOCIHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrBOCI);
                processingBOCI = false;
            }
            else if (btnDeal.indexOf("LEONTEQ") == 0) {
                LEONTEQHiddenPrice = document.getElementById("ctl00_MainContent_LEONTEQHiddenPrice");
                LEONTEQHiddenPrice.value = LEONTEQHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrLEONTEQ);
                processingLEONTEQ = false;
            }
            else if (btnDeal.indexOf("BARCLAYS") == 0) {
                BARCLAYSHiddenPrice = document.getElementById("ctl00_MainContent_BARCLAYSHiddenPrice");
                BARCLAYSHiddenPrice.value = BARCLAYSHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrBARCLAYS);
                processingBARCLAYS = false;
            }
            else if (btnDeal.indexOf("RBC") == 0) {
                RBCHiddenPrice = document.getElementById("ctl00_MainContent_RBCHiddenPrice");
                RBCHiddenPrice.value = RBCHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrRBC);
                processingRBC = false;
            }
            else if (btnDeal.indexOf("SOCGEN") == 0) {
                SOCGENHiddenPrice = document.getElementById("ctl00_MainContent_SOCGENHiddenPrice");
                SOCGENHiddenPrice.value = SOCGENHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrSOCGEN);
                processingSOCGEN = false;
            }
            else if (btnDeal.indexOf("NATIXIS") == 0) {
                NATIXISHiddenPrice = document.getElementById("ctl00_MainContent_NATIXISHiddenPrice");
                NATIXISHiddenPrice.value = NATIXISHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrNATIXIS);
                processingNATIXIS = false;
            }
            else if (btnDeal.indexOf("RAIFFEISEN") == 0) {
                RAIFFEISENHiddenPrice = document.getElementById("ctl00_MainContent_RAIFFEISENHiddenPrice");
                RAIFFEISENHiddenPrice.value = RAIFFEISENHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrRAIFFEISEN);
                processingRAIFFEISEN = false;
            }
            else if (btnDeal.indexOf("VONTOBEL") == 0) {
                VONTOBELHiddenPrice = document.getElementById("ctl00_MainContent_VONTOBELHiddenPrice");
                VONTOBELHiddenPrice.value = VONTOBELHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrVONTOBEL);
                processingVONTOBEL = false;
            }
            else if (btnDeal.indexOf("BBVA") == 0) {
                BBVAHiddenPrice = document.getElementById("ctl00_MainContent_BBVAHiddenPrice");
                BBVAHiddenPrice.value = BBVAHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrBBVA);
                processingBBVA = false;
            }
            else if (btnDeal.indexOf("GS") == 0) {
                GSHiddenPrice = document.getElementById("ctl00_MainContent_GSHiddenPrice");
                GSHiddenPrice.value = GSHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrGS);
                processingGS = false;
            }
            else if (btnDeal.indexOf("DBIB") == 0) {
                DBIBHiddenPrice = document.getElementById("ctl00_MainContent_DBIBHiddenPrice");
                DBIBHiddenPrice.value = DBIBHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrDBIB);
                processingDBIB = false;
            }
            else if (btnDeal.indexOf("BAML") == 0) {
                BAMLHiddenPrice = document.getElementById("ctl00_MainContent_BAMLHiddenPrice");
                BAMLHiddenPrice.value = BAMLHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrBAML);
                processingBAML = false;
            }
            else if (btnDeal.indexOf("DBS") == 0) {
                DBSHiddenPrice = document.getElementById("ctl00_MainContent_DBSHiddenPrice");
                DBSHiddenPrice.value = DBSHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrDBS);
                processingDBS = false;
            }
            else if (btnDeal.indexOf("EFG") == 0) {
                EFGHiddenPrice = document.getElementById("ctl00_MainContent_EFGHiddenPrice");
                EFGHiddenPrice.value = EFGHiddenPrice.value.split(";")[0] + ';Enable;Disable;Disable;Price';
                clearTimeout(tmrEFG);
                processingEFG = false;
            }
            document.getElementById(lblid).innerHTML = "";
            if ($("#ctl00_MainContent_DealConfirmPopup").is(':visible'))
            {
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "BNPP") {
                    if (processingBNPP === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "CS") {
                    if (processingCS === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "HSBC") {
                    if (processingHSBC === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "JPM") {
                    if (processingJPM === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text().toUpperCase() == "UBS") {
                    if (processingUBS === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text().toUpperCase() == "MS") {
                    if (processingMS === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text().toUpperCase() == "TDS") {
                    if (processingTDS === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text().toUpperCase() == "NOMURA") {
                    if (processingNOMURA === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text().toUpperCase() == "SCB") {
                    if (processingSCB === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "OCBC") {
                    if (processingOCBC === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "CITI") {
                    if (processingCITI === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "BOCI") {
                    if (processingBOCI === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "LEONTEQ") {
                    if (processingLEONTEQ === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "BARCLAYS") {
                    if (processingBARCLAYS === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "RBC") {
                    if (processingRBC === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "SOCGEN") {
                    if (processingSOCGEN === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "NATIXIS") {
                    if (processingNATIXIS === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "RAIFFEISEN") {
                    if (processingRAIFFEISEN === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "VONTOBEL") {
                    if (processingVONTOBEL === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "BBVA") {
                    if (processingBBVA === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "GS") {
                    if (processingGS === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "DBIB") {
                    if (processingDBIB === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "BAML") {
                    if (processingBAML === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "DBS") {
                    if (processingDBS === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
                if ($("#ctl00_MainContent_lblIssuerPopUpValue").text() == "EFG") {
                    if (processingEFG === false)
                        document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                }
            }

            if ($("#ctl00_MainContent_DealSpreadBlockPopup").is(':visible'))
            {
                document.getElementById("ctl00_MainContent_btnHdnEnablePage2").click();
                enableEmail();
            }


            if (document.getElementById(btnPrice) !== null) {
                document.getElementById(btnPrice).disabled = false;
                $("#" + btnPrice).removeClass("btnDisabled").addClass("btn");
                $("#" + btnPrice).val('Price');
            }
            document.getElementById('ctl00_MainContent_btnSetResponse').click();
        }
        else {
            if (btnDeal.indexOf("JPM") == 0) {
                tmrJPM = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("HSBC") == 0) {
                tmrHSBC = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("CS") == 0) {
                tmrCS = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("UBS") == 0) {
                tmrUBS = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("MS") == 0) {
                tmrMS = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("TDS") == 0) {
                tmrTDS = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("NOMURA") == 0) {
                tmrNOMURA = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("BNPP") == 0) {
                tmrBNPP = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("SCB") == 0) {
                tmrSCB = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("OCBC") == 0) {
                tmrOCBC = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("CITI") == 0) {
                tmrCITI = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("BOCI") == 0) {
                tmrBOCI = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("LEONTEQ") == 0) {
                tmrLEONTEQ = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("BARCLAYS") == 0) {
                tmrBARCLAYS = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("RBC") == 0) {
                tmrRBC = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("SOCGEN") == 0) {
                tmrSOCGEN = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("NATIXIS") == 0) {
                tmrNATIXIS = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("RAIFFEISEN") == 0) {
                tmrRAIFFEISEN = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("VONTOBEL") == 0) {
                tmrVONTOBEL = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("BBVA") == 0) {
                tmrBBVA = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }
            else if (btnDeal.indexOf("GS") == 0) {
                tmrGS = self.setTimeout("InitializeTimer('" + lblid + "','" + ValidityTime + "','" + btnDeal + "','" + btnPrice + "');", 1000);
            }

        }
    }
    catch (e) {
        console.log("InitializeTimer : " + e.message);
    }
}
//#endregion

//#region SignalR Section


var proxy = "";
$(function () {
    firstload()
});

function firstload() {
    try {
        $.connection.hub.url = document.getElementById("ctl00_MainContent_hdnFinIQHubPath").value;
        proxy = $.connection.notificationHub;
        $.connection.hub.start().done(function () {
            console.log('firstload Connection id :' + $.connection.hub.id);
            document.getElementById("ctl00_MainContent_hdnHubConnectionID").value = $.connection.hub.id;

        });
        $.connection.hub.connectionSlow(function () {
            console.log('We are currently experiencing difficulties with the connection.');
        });
        $.connection.hub.error(function (error) {
            console.log('SignalR error: ' + error);
        });
        proxy.client.getRfqResponse = function (msg, rfqID, lblPrice, lblTimer, btnDeal, btnPrice1) {
            if (msg) {

                var PP_Code = lblTimer.match("ctl00_MainContent_lblTimer(.*)")[1];
                //getRfqResponse(msg, rfqID, lblPrice, lblTimer, btnDeal, btnPrice1);
                getRfqResponse(msg, rfqID, 'ctl00_MainContent_lbl' + PP_Code + 'Price', 'ctl00_MainContent_lblTimer' + PP_Code, PP_Code, 'ctl00_MainContent_btn' + PP_Code + 'Price');
            }
        }
    } catch (e) {
        console.log("firstload : " + e.message);
    }  
}


function callHub(loggedUser, rfqID, lblPrice, lblTimer, btnDeal, btnPrice1, strProduct, strSolveFor, parentRFQId) {
    try {
        if (btnDeal.indexOf("JPM") == 0) {
            processingJPM = true;
        }
        else if (btnDeal.indexOf("HSBC") == 0) {
            processingHSBC = true;
        }
        else if (btnDeal.indexOf("CS") == 0) {
            processingCS = true;
        }
        else if (btnDeal.indexOf("UBS") == 0) {
            processingUBS = true;
        }
        else if (btnDeal.indexOf("MS") == 0) {
            processingMS = true;
        }
        else if (btnDeal.indexOf("TDS") == 0) {
            processingTDS = true;
        }
        else if (btnDeal.indexOf("NOMURA") == 0) {
            processingNOMURA = true;
        }
        else if (btnDeal.indexOf("BNPP") == 0) {
            processingBNPP = true;
        }
        else if (btnDeal.indexOf("SCB") == 0) {
            processingSCB = true;
        }
        else if (btnDeal.indexOf("OCBC") == 0) {
            processingOCBC = true;
        }
        else if (btnDeal.indexOf("RBC") == 0) {
            processingRBC = true;
        }
        else if (btnDeal.indexOf("CITI") == 0) {
            processingCITI = true;
        }
        else if (btnDeal.indexOf("LEONTEQ") == 0) {
            processingLEONTEQ = true;
        }
        else if (btnDeal.indexOf("BARCLAYS") == 0) {
            processingBARCLAYS = true;
        }
        else if (btnDeal.indexOf("SOCGEN") == 0) {
            processingSocGen = true;
        }
        else if (btnDeal.indexOf("BOCI") == 0) {
            processingBOCI = true;
        }
        else if (btnDeal.indexOf("NATIXIS") == 0) {
            processingNATIXIS = true;
        }
        else if (btnDeal.indexOf("RAIFFEISEN") == 0) {
            processingRAIFFEISEN = true;
        }
        else if (btnDeal.indexOf("VONTOBEL") == 0) {
            processingVONTOBEL = true;
        }
        else if (btnDeal.indexOf("BBVA") == 0) {
            processingBBVA = true;
        }
        else if (btnDeal.indexOf("GS") == 0) {
            processingGS = true;
        }
        else if (btnDeal.indexOf("DBIB") == 0) {
            processingDBIB = true;
        }
        else if (btnDeal.indexOf("DBS") == 0) {
            processingDBS = true;
        }
        else if (btnDeal.indexOf("BAML") == 0) {
            processingDBIB = true;
        }
        else if (btnDeal.indexOf("EFG") == 0) {
            processingEFG = true;
        }
        proxy.server.connectNew(loggedUser, rfqID, lblPrice, lblTimer, btnDeal, btnPrice1, strProduct, strSolveFor, parentRFQId).fail(function (error) {
            console.log('connectNew error: ' + error);
        });
    } catch (e) {
        console.log("callHub : " + e.message);
    }
}
function resetRfqDictionary(loggedUser) {
    try {
        $.connection.hub.url = document.getElementById("ctl00_MainContent_hdnFinIQHubPath").value;
        proxy = $.connection.notificationHub;
        $.connection.hub.start().done(function () {
            console.log('resetRfqDictionary Connection id :' + $.connection.hub.id);
            document.getElementById("ctl00_MainContent_hdnHubConnectionID").value = $.connection.hub.id;
        });
    }
    catch (e) {
        console.log("resetRfqDictionary : " + e.message);
    }
}
//#endregion
//Added By AniruddhaJ 26Jul2021 to Set Colspan to expanded table start

$(document).ready(function () {
    setColspantogrid();  

})
var parameter = Sys.WebForms.PageRequestManager.getInstance();

parameter.add_endRequest(function () {
    setColspantogrid();

});
function setColspantogrid() {
    try {        
        let tblcolspan = $("table.Grid, table.draggable").find(".GridHeaderTitle")[0].cells.length;
        let collapsedRows = $("table.Grid, table.draggable").find('[class^="trCollapseGrid"]');
        for (let r of collapsedRows) {
            $(r).find("td").prop('colspan', tblcolspan);
        }
    } catch (err) {
        console.log(err.message);
    }
}
        //End


/*window.addEventListener("load", function () {
    var tohighlight = document.getElementsByClassName('highlight-second-word');
    for (var i = 0; i < tohighlight.length; ++i) {
        tohighlight[i].innerHTML = tohighlight[i].textContent.replace(/\w+ (\w+)/, function (s, c) {
            return s.replace(c, '<mark>' + c + '</mark>');
        });
    }
});

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function () {
    Highlightword();
});

function Highlightword() {
    var tohighlight = document.getElementsByClassName('highlight-second-word');
    for (var i = 0; i < tohighlight.length; ++i) {
        tohighlight[i].innerHTML = tohighlight[i].textContent.replace(/\w+ (\w+)/, function (s, c) {
            return s.replace(c, '<mark>' + c + '</mark>');
        });
    }
}*/