<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="frmDealConfirmation.aspx.vb" Inherits="FinIQWebApp.frmDealConfirmation" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>DealConfirmation</title>
</head>
<body>
    <form id="DealConfirmation" runat="server">
    <div>
    <style type="text/css">
         .lblBOLDWidth16
            {
                font-family:Verdana;
                font-size:16px;
                font:bold;
                color:darkblue;
            }    
        .lblBOLDWidth14
            {
                font-family:Verdana;
                font-size:14px;
                color:darkblue;
            }
            </style>
         <script type="text/javascript">
             var secs;
             var remsecs;
             var timerID = null;
             var timerRunning = false;
             var delay = 1000;
             var timerblinkyld = null;
             var blnblink = true;
             var blnblinkyld = true;
             var countblinkyld = 0;
             var ValidityTime;

             function InitializeTimer() {
                 // Set the length of the timer, in seconds
                
                 ValidityTime = 30;//document.getElementById('ctl00_MainContent_hdnValidityTime').value;
                 //alert(ValidityTime);
                 secs = 0;
                 remsecs = ValidityTime;
                 StopTheClock();
                 //var preM;
                 //preM = 'ctl00_MainContent_';
                 //document.getElementById(preM + 'btnProceed').disabled = false;
                 StartTheTimer();
             }
             function StopTheClock() {
                 if (timerRunning) {
                     
                     clearTimeout(timerID);
                     //var preM;
                     //preM = 'ctl00_MainContent_';
                     if (document.getElementById('btnConfirm')) { document.getElementById('btnConfirm').disabled = true; }
                    


                     document.getElementById('lblTimer').innerHTML = '';
                     remsecs = '0';
                 }
                 timerRunning = false;
             }

             function StartTheTimer() {
                 //alert('hi');
                 
                 if (secs == ValidityTime) {

                     StopTheClock();
                     // Here's where you put something useful that's
                     // supposed to happen after the allotted time.
                     // For example, you could display a message:
                 }
                 else {
                     
                     var preM;
                     preM = 'ctl00_MainContent_';
                     //alert(remsecs);
                     document.getElementById('lblTimer').innerHTML = remsecs;
                     //alert(document.getElementById('lblTimer').innerHTML);
                     if (document.getElementById('btnConfirm')) { document.getElementById('btnConfirm').disabled = false; }
                     

                     if (secs == 0) {

                     }
                     if (secs > 0 & secs <= ValidityTime / 10) {

                     }


                     if (secs == ValidityTime - 1) {

                         document.getElementById('lblTimer').innerHTML = '';


                     }
                     secs = secs + 1;
                     remsecs = remsecs - 1;
                     timerRunning = true
                     timerID = setTimeout("StartTheTimer()", delay)
                 }
             }
             function SaveDeal() {
                 //this.returnValue = "true"
                 //window.returnValue = "true"
                 //alert('confirm');
                 window.opener.document.getElementById('ctl00_MainContent_hdnDealConfirmation').innerText = "Y";
                 window.close();
                 
                 
             }
             function CancelDeal() {
                 
                 //this.returnValue = "false"
                 
                 //window.returnValue = "false"
                 //alert('cancel');
                 window.opener.document.getElementById('ctl00_MainContent_hdnDealConfirmation').innerText = "N";
                 window.close();
                 
                 
               
             }
             function OnClose() {
                 if (window.opener != null && !window.opener.closed) {
                     
                     window.opener.HideModalDiv();
                     window.opener.CallAcceptDeal();
                 }
             }
             window.onunload = OnClose;
             </script>
    <table >
    <tr>
        <td colspan="2">
<asp:Label id ="lblHeader" runat="server" CssClass="lblBOLDWidth16">You are about to book a deal with following details</asp:Label>
        </td>
        

    </tr>
        <tr>
        <td>
        <asp:Label id ="lblCcyPairCap" runat="server" CssClass="lblBOLDWidth14" Text="Currency Pair"></asp:Label>
        </td>
        <td>
            <asp:Label id ="lblCcyPair" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
        <tr>
        <td>
         <asp:Label id ="lblSpotRateCap" runat="server" CssClass="lblBOLDWidth14"  Text="Spot Rate"></asp:Label>
        </td>
        <td>
 <asp:Label id ="lblSpotRate" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
        <tr>
        <td>
           <asp:Label id ="lblStrikeRateCap" runat="server" CssClass="lblBOLDWidth14" Text="Strike Rate"></asp:Label>
        </td>
        <td>
 <asp:Label id ="lblStrikeRate" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
        <tr>
        <td>
           <asp:Label id ="lblTransactionDateCap" runat="server" CssClass="lblBOLDWidth14" Text="Transaction Date"></asp:Label>
        </td>
        <td>
 <asp:Label id ="lblTransactionDate" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
        <tr>
        <td >
          <asp:Label id ="lblValueDateCap" runat="server" CssClass="lblBOLDWidth14" Text="Valu Date"></asp:Label>
        </td>
        <td>
 <asp:Label id ="lblValueDate" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
        <tr>
        <td >
            <asp:Label id ="lblFixingDateCap" runat="server" CssClass="lblBOLDWidth14" Text="Fixing Date"></asp:Label>
        </td>
        <td>
             <asp:Label id ="lblFixingDate" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
        <tr>
        <td >
            <asp:Label id ="lblMaturityDateCap" runat="server" CssClass="lblBOLDWidth14" Text="Maturity Date"></asp:Label>
        </td>
        <td>
             <asp:Label id ="lblMaturityDate" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
        <tr>
        <td >
            <asp:Label id ="lblPrincipalCap" runat="server" CssClass="lblBOLDWidth14" Text="Principal"></asp:Label>
        </td>
        <td>
             <asp:Label id ="lblPrincipal" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
        <tr>
        <td >
            <asp:Label id ="lblCustomerYieldCap" runat="server" CssClass="lblBOLDWidth14" Text="Customer Yield"></asp:Label>
        </td>
        <td>
             <asp:Label id ="lblCustomerYield" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
        <tr>
        <td >
            <asp:Label id ="lblIntAmtCap" runat="server" CssClass="lblBOLDWidth14" Text="Interest Amount"></asp:Label>
        </td>
        <td>
             <asp:Label id ="lblIntAmt" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
         <tr>
        <td >
            <asp:Label id ="lblRepayment1Cap" runat="server" CssClass="lblBOLDWidth14" Text="Repayment1"></asp:Label>
        </td>
        <td>
             <asp:Label id ="lblRepayment1" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
         <tr>
        <td >
            <asp:Label id ="lblRepayment2Cap" runat="server" CssClass="lblBOLDWidth14" Text="Repayment2"></asp:Label>
        </td>
        <td>
             <asp:Label id ="lblRepayment2" runat="server" CssClass="lblBOLDWidth14"></asp:Label>
        </td>

    </tr>
        <tr >
            <td  style="text-align:center;" colspan="2" >
                <asp:Label id ="lblTimer" runat="server" CssClass="lblBOLDWidth14" ></asp:Label>
            </td>
        </tr>
         <tr>
        <td >
           <asp:Button ID="btnConfirm" runat="server" text="Confirm" OnClientClick="SaveDeal();"/>
        </td>
        <td>
           <asp:Button ID="btnCancel" runat="server" text="Cancel" OnClientClick="CancelDeal();"/>
        </td>

    </tr>
    </table>
    </div>
    </form>
</body>
</html>
