<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PayNow.aspx.cs" Inherits="TruxWebPortal.PayNow" %>
<%@ Import Namespace="TruxWebPortal.Common" %>
<%@ Import Namespace="System.Data" %>

<%@ PreviousPageType VirtualPath="BillAndPayments.aspx" %>
<%@ Register TagPrefix="ucHeader" TagName="truxHeader" Src="header.ascx" %>
<%@ Register TagPrefix="ucFooter" TagName="truxFooter" Src="footer.ascx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="HeadPayNow" runat="server">
    <meta http-equiv="Expires" content="-1" />
    
    <title>Pay Now</title>

    <script src="js/jquery/jquery-1.11.2.min.js" type="text/javascript"> </script>
    <script type="text/javascript">
        var achReceiptKey = '<%= PaymentAchGuid %>';
        var ccReceiptKey = '<%= PaymentCCGuid %>';

        window.addEventListener("storage", function(event) {
            if (event.key === achReceiptKey) {
                try {
                    var receipt = localStorage.getItem(achReceiptKey);
                    if (receipt.length > 0) {
                        document.getElementById("<%= hfAchReceipt.ClientID %>").value = receipt;
                        if ($("#<%= hfAchReceipt.ClientID %>").val().length > 0) {
                            __doPostBack("<%= btnSubmit.ClientID %>", '');
                        }
                    }
                } finally {
                    localStorage.removeItem(achReceiptKey);
                }
            } else if (event.key === ccReceiptKey) {
                try {
                    var receipt = localStorage.getItem(ccReceiptKey);
                    if (receipt.length > 0) {
                        document.getElementById("<%= hfCCReceipt.ClientID %>").value = receipt;
                        if ($("#<%= hfCCReceipt.ClientID %>").val().length > 0) {
                            __doPostBack("<%= btnSubmit.ClientID %>", '');
                        }
                    }
                } finally {
                    localStorage.removeItem(ccReceiptKey);
                }
            }

        });

        var globalPaymentPopup = null;

        function openRequestedPopup(url, isAch) {
            
            if (globalPaymentPopup == null || globalPaymentPopup.closed)
            {
                //document.getElementById("<%= btnSubmit.ClientID %>").disabled = true;
                globalPaymentPopup = window.open(url, "_blank", "resizable,scrollbars,status");
            }
            else {
                globalPaymentPopup.focus();
            };
        }

        function refreshPage() {
            if ($("#radCreditCard").is(":checked")) {
                $("#ccInformation").css("display", "table");
                $("#ppInformation").css("display", "none");
                $("#option_one").css("display", "block");
                $("#preauthorizedACH").css("display", "none");
                $("#setAsDefault").css("display", "block");
                $("#autoPay").css("display", "block");
                $("#lblNewCardMsg").css("display", "block");

                if ($("#radNewCreditCard").is(":checked")) {
                    $("#btnAddCard").attr("disabled", false);
                    $("#New_Credit_Card :input").attr("disabled", false);
                    $("#Credit_Card_On_File :input").attr("disabled", true);
                } else {
                    $("#btnAddCard").attr("disabled", true);
                    $("#New_Credit_Card :input").attr("disabled", true);
                    $("#Credit_Card_On_File :input").attr("disabled", false);
                }
            } else {
                $("#ccInformation").css("display", "none");
                $("#ppInformation").css("display", "table");
                $("#option_one").css("display", "none");
                $("#preauthorizedACH").css("display", "block");
                $("#setAsDefault").css("display", "block");
                $("#autoPay").css("display", "block");
                $("#lblNewCardMsg").css("display", "none");

                if ($("#radNewCreditCard").is(":checked")) {
                    $("#btnAddCard").attr("disabled", false);
                    $("#New_Credit_Card :input").attr("disabled", false);
                    $("#Credit_Card_On_File :input").attr("disabled", true);
                } else {
                    $("#btnAddCard").attr("disabled", true);
                    $("#New_Credit_Card :input").attr("disabled", true);
                    $("#Credit_Card_On_File :input").attr("disabled", false);
                }

            }
        }

        $(document).ready(function () {
            var oneTimePayChecked = true;
            var setAsDefaultCard = true;

            if ($("#radACH").is(":checked")) {
                if ($("#radACHOnFile").is(":disabled")) {
                    $("#radNewCreditCard").prop("checked", true).change();
                }
            }

            if ($("#radCreditCard").is(":checked")) {
                if ($("#radCreditCardOnFile").is(":disabled")) {
                    $("#radNewCreditCard").prop("checked", true).change();
                }
            }

            refreshPage();

            /*
            $("#radACH").change(function () {
                $("#ccInformation").css("display", "none");
                $("#ppInformation").css("display", "table");
                $("#option_one").css("display", "none");
                $("#preauthorizedACH").css("display", "block");
                $("#setAsDefault").css("display", "block");
                $("#autoPay").css("display", "block");
                $("#lblNewCardMsg").css("display", "none");

                oneTimePayChecked = $("#radOnetime").is(":checked");
                setAsDefaultCard = $("#chkSetAsDefault").prop("checked") === true;

                if (setAsDefaultCard) {
                    $("#chkSetAsDefault").prop("checked", true).change();
                } else {
                    $("#chkSetAsDefault").removeAttr("checked").change();
                }

                if ($("#radACHOnFile").is(":disabled")) {
                    $("#radNewCreditCard").prop("checked", true).change();
                } else {
                    $("#radACHOnFile").prop("checked", true).change();
                }

                if (oneTimePayChecked) {
                    $("#radOneTime").prop("checked", true).change();
                } else {
                    $("#radRecurring").prop("checked", true).change();
                }
            });
            */



            $("#radACHOnFile").change(function () {
                $("#btnAddCard").attr("disabled", true);
                $("#New_Credit_Card :input").attr("disabled", true);
            });

            /*
            $("#radCreditCard").change(function () {
                $("#ccInformation").css("display", "table");
                $("#ppInformation").css("display", "none");1
                $("#option_one").css("display", "block");
                $("#preauthorizedACH").css("display", "none");
                $("#setAsDefault").css("display", "block");
                $("#autoPay").css("display", "block");
                $("#lblNewCardMsg").css("display", "block");

                if (setAsDefaultCard) {
                    $("#chkSetAsDefault").prop("checked", true).change();
                } else {
                    $("#chkSetAsDefault").removeAttr("checked").change();
                }

                if (oneTimePayChecked) {
                    $("#radOneTime").prop("checked", true).change();
                } else {
                    $("#radRecurring").prop("checked", true).change();
                }

                if ($("#radCreditCardOnFile").is(":disabled")) {
                    $("#radNewCreditCard").prop("checked", true).change();
                } else {
                    $("#radCreditCardOnFile").prop("checked", true).change();
                }

            });
            */

            $("#radCreditCardOnFile").change(function () {
                $("#btnAddCard").attr("disabled", true);
                $("#New_Credit_Card :input").attr("disabled", true);
                $("#Credit_Card_On_File :input").removeAttr("disabled");
            });

            $("#radNewCreditCard").change(function () {
                $("#btnAddCard").removeAttr("disabled");
                $("#New_Credit_Card :input").removeAttr("disabled");
                $("#Credit_Card_On_File :input").attr("disabled", true);
            });


            var prm = Sys.WebForms.PageRequestManager.getInstance();
            prm.add_endRequest(EndRequest);

            function EndRequest(sender, args) {
                refreshPage();
            }
        });

        function errorMessage() {
            var isValid = true;

            if (globalPaymentPopup != null && !globalPaymentPopup.closed) {
                globalPaymentPopup.focus();
                return false;
            }

            if (typeof Page_ClientValidate === "function") {
                if ($("#radNewCreditCard").is(":checked")) {
                    isValid = Page_ClientValidate("shared");
                    if ($("#radACH").prop("checked")) {
                        isValid = isValid && Page_ClientValidate("ach");

                    } else {
                        //isValid = isValid && Page_ClientValidate("credit");
                    }
                }
            }

            if ($("#radCreditCard").is(":checked")) {
                isValid =
                    ('<%=  Convert.ToDecimal( CommonUtilities.GetCompanySetting((DataTable)Session["CompSetting"], "MaxCreditCardPayment")) <= 0 || decimal.Parse(lblAmountInCardOnFile.Text.Replace("$","")) <= Convert.ToDecimal( CommonUtilities.GetCompanySetting((DataTable)Session["CompSetting"], "MaxCreditCardPayment")) %>' === 'True');

                if (!isValid) {
                    alert("Maximum amount payable by credit card is " + '<%= string.Format("{0:C}",Convert.ToDecimal( CommonUtilities.GetCompanySetting((DataTable)Session["CompSetting"], "MaxCreditCardPayment"))) %>');
                }

            }

            return isValid;
        }


    </script>

    <script type="text/javascript">

        function DisableButton() {
            document.getElementById("<%= btnSubmit.ClientID %>").disabled = true;
        }

        window.onbeforeunload = DisableButton;
    </script>

    <link rel="stylesheet" type="text/css" href="_style/stylesheet.css" title="TRUX7" />

    <script src="showhide.js" type="text/javascript"></script>

    <style>
        a.info
        {
            color: #0066CC;
            position: relative;
            text-decoration: none;
            z-index: 24;
        }

            a.info:hover
            {
                color: black;
                z-index: 25;
            }

            a.info .tooltip
            {
                display: none;
            }

            a.info:hover .tooltip
            {
                background-color: white;
                border: 1px solid #0cf;
                bottom: 2em;
                color: black;
                /*the span will display just on :hover state*/
                display: block;
                left: 1em;
                min-width: 220px;
                padding: 10px;
                padding-left: 20px;
                position: absolute;
            }

        .style1
        {
            height: 99px;
        }
    </style>


</head>
<body>
    <ucHeader:truxHeader ID="Hdr1" runat="server"></ucHeader:truxHeader>
    <div id="main_area">
        <form id="form1" runat="server" autocomplete="off" onsubmit="$(this).find('input').removeAttr('disabled'); return true">
            <div id="work_area">


                <div id="Payment_Summary">
                    <div id="payment_confirm">

                        <div class="title_bar_orange">
                            <asp:Label ID="lblEmail" runat="server" Text=""></asp:Label>, please confirm this secure
            <img src="_images/littlelock.gif" />
                            transaction
                        </div>

                        <p id="intro_text">You're about to pay</p>
                        <p id="total_pay">
                            <asp:Label ID="lblAmountInCardOnFile" runat="server"></asp:Label>
                        </p>
                        <p id="cc_proc_fee">
                            <asp:Label ID="lblCCProcFee" runat="server"></asp:Label>
                        </p>
                        <p id="company">
                            To:
            <asp:Label ID="lblCompany" runat="server" Text=""></asp:Label>
                        </p>

                        <p>Your payment will be applied as follows:</p>
                        <asp:GridView ID="gvSelectedInvoiceList" runat="server"
                            OnRowDataBound="gvSelectedInvoiceList_RowDataBound" GridLines="None"
                            PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"
                            AutoGenerateColumns="False" CssClass="mGrid" Width="565px"
                            OnSelectedIndexChanged="gvSelectedInvoiceList_SelectedIndexChanged">
                            <Columns>
                                <asp:BoundField DataField="dm01_invc" HeaderText="Invoice"></asp:BoundField>
                                <asp:BoundField DataField="dm01_date" HeaderText="Invoice Date"
                                    DataFormatString="{0:MM/dd/yyyy}"></asp:BoundField>
                                <asp:BoundField DataField="applied" HeaderText="Payment Amount"
                                    DataFormatString="{0:c2}">
                                    <HeaderStyle CssClass="money" />
                                    <ItemStyle CssClass="money" />
                                </asp:BoundField>
                                <asp:BoundField DataField="dm01_amnt" HeaderText="Balance Remaining"
                                    DataFormatString="{0:c2}">
                                    <HeaderStyle CssClass="money" />
                                    <ItemStyle CssClass="money" />
                                </asp:BoundField>
                            </Columns>
                            <HeaderStyle CssClass="col_headers"></HeaderStyle>
                            <PagerStyle CssClass="pgr" />
                            <AlternatingRowStyle CssClass="alt_row" />
                        </asp:GridView>
                    </div>
                    <!-- close Payment Confirm -->
                </div>

                <div id="Div1" class="payment_option">
                    <span style="float: left">
                    <asp:RadioButton ID="radCreditCard" runat="server"
                        Text="Credit Card" Checked="True"
                        GroupName="PaymentOptions" AutoPostBack="true" OnCheckedChanged="radCreditCard_CheckedChanged" />
                        </span>
                    <span style="float: right">
                    <asp:RadioButton ID="radACH" runat="server"
                        Text="Preauthorized(ACH)" Checked="False"
                        GroupName="PaymentOptions" AutoPostBack="true" OnCheckedChanged="radCreditCard_CheckedChanged" />
                        </span>
                </div>

                <div id="preauthorizedACH" class="payment_option">
                    <asp:RadioButton ID="radACHOnFile" runat="server"
                        Text="Preauthorized(ACH) on file" Checked="True"
                        GroupName="CreditCardRadioButtons" AutoPostBack="true" OnCheckedChanged="radCreditCard_CheckedChanged" />
                    <a href="_help/my_invoices.aspx#existingcard" target="_blank">
                        <img style="margin-left: 5px; vertical-align: middle; width: 18px;" src="_images/help.png" />
                    </a>
                    <div id="ACHOnFile">
                        <table>
                            <tr id="rowBankName" runat="server">
                                <td>
                                    Bank Name:
                                </td>
                                <td>
                                    <asp:Label ID="lblBankNameFile" runat="server" Text=""></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Account Number:
                                </td>
                                <td>
                                    <asp:Label ID="lblBankAccountNumberFile" runat="server" Text=""></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <!-- close Credit Card On File -->
                </div>
                <!-- close option_one -->

                <div id="option_one" class="payment_option">
                    <asp:RadioButton ID="radCreditCardOnFile" runat="server"
                        Text="Credit Card on File" Checked="True"
                        GroupName="CreditCardRadioButtons" AutoPostBack="true" OnCheckedChanged="radCreditCard_CheckedChanged" />
                    <a href="_help/my_invoices.aspx#existingcard" target="_blank">
                        <img style="margin-left: 5px; vertical-align: middle; width: 18px;" src="_images/help.png" />
                    </a>
                    <div id="Credit_Card_On_File">
                        Card No.:
        <asp:Label ID="lblCardNumber" runat="server" Text=""></asp:Label>
                        Expiration:
        <asp:Label ID="lblExpirationDate" runat="server" Text=""></asp:Label><div id="CVV2" runat="server">
                        CVV2:
        <asp:TextBox ID="txtcvv2OnFile" runat="server" class="textfield"></asp:TextBox>
                        <a class="cvv2_helplnk" href="_help/my_account.aspx#cvv2help" target="_blank">what's this?</a></div>
                    </div>
                    <!-- close Credit Card On File -->
                </div>
                <!-- close option_one -->

                <div id="option_two" class="payment_option">

                    <asp:RadioButton ID="radNewCreditCard" runat="server"
                        Text="New Payment Method:" GroupName="CreditCardRadioButtons" AutoPostBack="true" OnCheckedChanged="radCreditCard_CheckedChanged" />
                    <a href="_help/my_invoices.aspx#newcard" target="_blank">
                        <img style="margin-left: 5px; vertical-align: middle; width: 18px;" src="_images/help.png" />
                    </a>
                    <asp:ScriptManager ID="ScriptManager1" runat="server" />
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            
                            <div id="New_Credit_Card">

                                <p class="frm_error_lbl">
                                    <asp:Label ID="lblNewCardMsg" runat="server"></asp:Label>
                                </p>
                                <asp:ValidationSummary ID="ValidationSummary2" runat="server" DisplayMode="List" ValidationGroup="ach" />
                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="List" ValidationGroup="shared" />
                            
                                <table id="ccInformation">
                                    
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblCardType" runat="server" CssClass="lblPayNow">Card Type: </asp:Label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlCardType" runat="server"></asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr  id="rowCardNumber" runat="server" >
                                        <td>
                                            <asp:Label ID="lblCardNumber2" runat="server" CssClass="lblPayNow">Card Number: </asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCardNumb" runat="server"></asp:TextBox>
                                        </td>
                                        <td id="divGlobalPayCVV2" runat="server">
                                            CVV2:<asp:TextBox ID="txtCvv2NewCard" runat="server" class="textfield"></asp:TextBox><a class="cvv2_helplnk" href="_help/my_account.aspx#cvv2help" target="_blank">what's this?</a>
                                        </td>
                                    </tr>
                                    <tr id="rowExpiration" runat="server" >
                                        <td>
                                            <asp:Label ID="lblExpiration" runat="server" CssClass="lblPayNow">Expiration: </asp:Label>
                                        </td>
                                        <td colspan="3">
                                            <asp:DropDownList ID="ddlExpMonth" name="ddlExpMonth" runat="server" CssClass="DropDownList"></asp:DropDownList>
                                            <asp:DropDownList ID="ddlExpYear" name="ddlExpYear" runat="server" CssClass="DropDownList"></asp:DropDownList>
                                        </td>
                                    </tr>
                                </table>
                            

                                <table id="ppInformation" runat="server" style="width: 100%">
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblBankName" runat="server" CssClass="lblPayNow">Bank Name: </asp:Label>
                                        </td>
                                        <td style="width: 100%">
                                            <asp:TextBox ID="txtBankName" MaxLength="30" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="lblPayNow">
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtBankAccountNumber" ErrorMessage="Bank Account Number Required"  Text="*" ValidationGroup="ach"></asp:RequiredFieldValidator>
                                            <asp:Label ID="lblBankAccountNumber" runat="server" >Account Number: </asp:Label>
                                                </span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtBankAccountNumber" runat="server" MaxLength="100"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="lblPayNow">
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Routing Number Required"  Text="*" ControlToValidate="txtBankRoutingNumber" ValidationGroup="ach"></asp:RequiredFieldValidator>
                                            <asp:Label ID="lblBankRoutingNumber" runat="server">Routing Number: </asp:Label>
                                                </span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtBankRoutingNumber" runat="server" MaxLength="100"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblBankAccountType" runat="server" CssClass="lblPayNow">Account Type: </asp:Label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlBankAccountType" runat="server" CssClass="DropDownList">
                                                <asp:ListItem Value="0">Checking</asp:ListItem>
                                                <asp:ListItem Value="1">Saving</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label1" runat="server" CssClass="lblPayNow">Drivers License: </asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtDriversLicense" runat="server"></asp:TextBox><asp:DropDownList ID="ddlDriverStateProv" runat="server" CssClass="DropDownList"></asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="lblPayNow">
                                                <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="Invalid Date of Birth"  Text="*" ControlToValidate="txtDateOfBirth" Type="Date" Operator="DataTypeCheck" ValidationGroup="ach"></asp:CompareValidator>
                                            <asp:Label ID="Label2" runat="server" >Date of Birth: </asp:Label>
                                               </span>
                                        </td>
                                        <td>
                                            
                                            <asp:TextBox ID="txtDateOfBirth" runat="server" placeholder="12/30/2014"></asp:TextBox>
                                        </td>
                                    </tr>

                                </table>

                                <table id="new_card" runat="server" >
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblName" runat="server" CssClass="lblPayNow">Cardholder Name: </asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtFirstName" runat="server" MaxLength="50"></asp:TextBox><asp:TextBox ID="txtLastName" runat="server" MaxLength="50"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblAddress" runat="server" CssClass="lblPayNow">Address: </asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtAddress" runat="server" MaxLength="40"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblCity" runat="server" CssClass="lblPayNow">City: </asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCity" runat="server" MaxLength="40"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblStateProv" runat="server" Text="Province: " CssClass="lblPayNow"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlStateProv" runat="server" CssClass="DropDownList" OnSelectedIndexChanged="ddlStateProv_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList><asp:TextBox ID="txtCountry" runat="server" ReadOnly="True"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="lblPayNow">
                                                <asp:RegularExpressionValidator ID="rePostalCode" runat="server"
                                                    ControlToValidate="txtPostalCode" EnableClientScript="true" ErrorMessage="Invalid Postal Code" Text="*" Style="display: inline"
                                                    ValidationExpression="^[a-zA-Z]{1}[0-9]{1}[a-zA-Z]{1}(\s?|[-]?)[0-9]{1}[a-zA-Z]{1}[0-9]{1}$" ValidationGroup="shared">
                                                </asp:RegularExpressionValidator>
         
                                                <asp:Label ID="lblPostalCode" runat="server" Text="Postal Code: "></asp:Label>
                                            </span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtPostalCode" runat="server" MaxLength="10" placeholder="A1A 1A1"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="lblPayNow">
                                                <asp:RegularExpressionValidator ID="rePhoneNumber" runat="server"
                                                    ControlToValidate="txtPhoneNumber" EnableClientScript="true"  ValidationGroup="shared" Text="*" ErrorMessage="Invalid Phone Number" Style="display: inline"
                                                    ValidationExpression="^([(](?=[0-9]{3}[)]{1}))?[0-9]{3}(([)]?\s?)|([-]?))[0-9]{3}([-]?|\s?)[0-9]{4}$">
                                                </asp:RegularExpressionValidator>
                                                <asp:Label ID="lblPhoneNumber" runat="server">Phone: </asp:Label>
                                        </span>
                                            </td>
                    <td>
                        <asp:TextBox ID="txtPhoneNumber" runat="server" MaxLength="15"></asp:TextBox>
                    </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="lblPayNow">
                                                <asp:RegularExpressionValidator ID="reEmail" runat="server"
                                                    ControlToValidate="txtEmail"  ValidationGroup="shared" EnableClientScript="true" Text="*" ErrorMessage="Invalid Email Address" Style="display: inline"
                                                    ValidationExpression="^([\w-\.+_#$%&*~]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]+|[0-9]{1,3})(\]?)$">
                                                </asp:RegularExpressionValidator>
                                                <asp:Label ID="lblEmail2" runat="server" Style="display: inline">Email: </asp:Label>
                                            </span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtEmail" runat="server" MaxLength="80"></asp:TextBox>
                                        </td>
                                    </tr>
                                    
                                </table>
                            <table>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                </tr>
                                <tr>
                                    <td class="style1"></td>
                                    <td class="style1">
                                        <p id="setAsDefault" class="checkbox" runat="server">
                                            <asp:CheckBox ID="chkSetAsDefault" Checked="true" runat="server" />Set As Default Card
                                        </p>
                                        <p class="checkbox">
                                            <asp:RadioButton ID="radOnetime" runat="server" Text="" Checked="True" GroupName="GroupPayment" />
                                            One Time Pay<br />
                                            <asp:Label ID="lblOneTimePay" runat="server" Text=""></asp:Label>
                                        </p>
                                        <p id="autoPay" class="checkbox" runat="server">
                                            <asp:RadioButton ID="radRecurring" runat="server" Checked="False"
                                                             GroupName="GroupPayment" Text="" />Auto Pay<br />
                                            <asp:Label ID="lblAutoPay" runat="server" Text=""></asp:Label>
                                        </p>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <!-- close New Credit Card -->
                        </ContentTemplate>
                    </asp:UpdatePanel>
                

            </div>
            <!-- close Option Two -->


            <div id="group_buttons">
                <asp:HiddenField ID="hfCCReceipt" runat="server" />
                <asp:HiddenField ID="hfAchReceipt" runat="server" />
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" Style="margin-left: 190px;"
                    CssClass="default_button" OnClientClick="return errorMessage(); " OnClick="btnSubmit_Click"  />
                <asp:Button ID="btnCancel"
                    runat="server" Text="Cancel" CssClass="default_button" Style="margin-left: 30px;"
                    OnClick="btnCancel_Click" />

            </div>
            <!-- close Group Buttons -->
            </div>

        </form>
    </div>
    <%-- Close div work_area--%>
    <ucFooter:truxFooter ID="Ftr1" runat="server"></ucFooter:truxFooter>
</body>
</html>
