<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>GCC-CANADA SALES</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }
        header {
            background-color: #007BFF;
            color: white;
            padding: 10px 0;
            text-align: center;
            width: 100%; /* Full width header */
        }
        footer {
            background-color: black;
            color: white;
            padding: 10px 0;
            text-align: center;
            width: 100%; /* Full width footer */
            margin-top: auto;
        }
        .container {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
        }
        .form-container, .disclosure-container {
            max-width: 400px;
            width: 100%;
            background: #f9f9f9;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            padding: 20px;
            margin: 10px;
        }
        label {
            display: block;
            margin-top: 10px;
        }
        select, input[type="text"] {
            width: 100%;
            padding: 8px;
            margin-top: 5px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        input[type="text"] {
            font-weight: bold;
            color: #333;
        }
        button {
            margin-top: 20px;
            padding: 10px 15px;
            background-color: #007BFF;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s;
            width: 100%;
        }
        button:hover {
            background-color: #0056b3;
        }
        @media (min-width: 768px) {
            .container {
                flex-direction: row;
                justify-content: space-between;
                align-items: flex-start;
            }
        }
    </style>
</head>
<body>
    <header>
        <h1>GCC-CANADA SALES</h1>
    </header>
    <div class="container">
        <div class="form-container">
            <label for="type">Select Type:</label>
            <select id="type" onchange="updateProducts()">
                <option value="">Select</option>
                <option value="sales">Sales</option>
                <option value="saves">Saves</option>
                <option value="breach">Breach</option>
                <option value="cancellation">Cancellation</option>
                <option value="freeCopy">Free Copy</option>
                <option value="breachExchange">Breach Exchange</option>
            </select>
            <label for="product">Select Product:</label>
            <select id="product" onchange="updateDetails()" disabled>
                <option value="">Select</option>
            </select>
            <label for="price">Price:</label>
            <input type="text" id="price" readonly disabled>
            <label for="billingTerm">Billing Term:</label>
            <input type="text" id="billingTerm" readonly disabled>
            <label for="jurisdiction">Select Jurisdiction:</label>
            <select id="jurisdiction" onchange="updateTax()" disabled>
                <option value="">Select</option>
                <option value="ON">Ontario</option>
                <option value="QC">Quebec</option>
                <option value="BC">British Columbia</option>
                <option value="AB">Alberta</option>
                <option value="MB">Manitoba</option>
                <option value="SK">Saskatchewan</option>
                <option value="NS">Nova Scotia</option>
                <option value="NB">New Brunswick</option>
                <option value="PE">Prince Edward Island</option>
                <option value="NL">Newfoundland & Labrador</option>
                <option value="YT">Yukon</option>
                <option value="NT">Northwest Territories</option>
                <option value="NU">Nunavut</option>
            </select>
            <label for="tax">Tax:</label>
            <input type="text" id="tax" readonly disabled>
            <label for="finalAmount">Final Amount:</label>
            <input type="text" id="finalAmount" readonly disabled>
            <button onclick="resetSelections()">Reset</button>
    <a href="Canada_Tool.html" style="color:red;">Back To Home</a>
        </div>
        <div class="disclosure-container" id="disclosureContainer" style="display: none;">
            <p id="disclosureText"></p>
        </div>
    </div>
    <footer>
        <p>© TP 2024</p>
    </footer>
    <script>
        const data = {
            sales: [
                { product: "Equifax Complete™ Premier", price: "$24.95", billingTerm: "Monthly", description: "Comprehensive identity theft protection." },
                { product: "Equifax Complete™ Friends & Family", price: "$34.95", billingTerm: "Monthly", description: "Protect your family with identity theft protection." },
                { product: "Equifax Complete™ Protection", price: "$34.95", billingTerm: "Monthly", description: "Full protection against identity theft." },
                { product: "Equifax Complete™ Premier - Trial", price: "$4.95", billingTerm: "Monthly", description: "Trial version of our premier service." },
                { product: "Equifax Complete™ Friends & Family - Trial-$4.95", price: "$4.95", billingTerm: "Monthly", description: "Trial for family protection." },
                { product: "Equifax Complete™ Friends & Family - Trial-$9.95", price: "$9.95", billingTerm: "Monthly", description: "Another trial option for family." },
            ],
            saves: [
                { product: "Equifax Complete™ Premier - 50%/Annual", price: "$12.47", billingTerm: "Monthly", description: "50% off for annual subscription." },
                { product: "Equifax Complete™ Premier - Annual", price: "$99.95", billingTerm: "Annual", description: "Full annual protection." },
                { product: "Equifax Complete™ Friends & Family - 50%/Annual", price: "$17.47", billingTerm: "Monthly", description: "Family protection at half price." },
                { product: "Equifax Complete™ Premier Lite", price: "$4.95", billingTerm: "Monthly", description: "Basic protection plan." },
            ],
            breach: [
                { product: "PROMO Code", price: "-", billingTerm: "-", description: "Use this code for discounts." },
                { product: "Equifax Complete™ Premier - VIP", price: "$5.95", billingTerm: "Monthly", description: "VIP service for premium users." },
                { product: "Equifax Complete™ Premier - Trial", price: "$4.95", billingTerm: "Monthly", description: "Trial version of VIP service." },
            ],
            cancellation: [],
            freeCopy: [],
            breachExchange: [] // Placeholder for breach exchange
        };

        const taxRates = {
            ON: { HST: 0.13 },
            QC: { GST: 0.05, QST: 0.09975 },
            BC: { GST: 0.05, PST: 0.07 },
            AB: { GST: 0.05 },
            MB: { GST: 0.05, PST: 0.07 },
            SK: { GST: 0.05, PST: 0.06 },
            NS: { HST: 0.15 },
            NB: { HST: 0.15 },
            PE: { HST: 0.15 },
            NL: { HST: 0.15 },
            YT: { GST: 0.05 },
            NT: { GST: 0.05 },
            NU: { GST: 0.05 }
        };function updateProducts() {
            const type = document.getElementById("type").value;
            const productSelect = document.getElementById("product");
            const priceInput = document.getElementById("price");
            const billingTermInput = document.getElementById("billingTerm");
            const jurisdictionSelect = document.getElementById("jurisdiction");
            const taxInput = document.getElementById("tax");
            const finalAmountInput = document.getElementById("finalAmount");

            productSelect.innerHTML = '<option value="">Select</option>'; // Reset options

            if (type === "cancellation" || type === "freeCopy") {
                // Combine all products for cancellation and free copy
                const combinedProducts = [...data.sales, ...data.saves, ...data.breach];
                combinedProducts.forEach(item => {
                    const option = document.createElement("option");
                    option.value = item.product;
                    option.textContent = item.product;
                    productSelect.appendChild(option);
                });
            } else if (type === "breachExchange") {
                // Filter out trial products for breach exchange
                const filteredSales = data.sales.filter(item => !item.product.includes("Trial"));
                filteredSales.forEach(item => {
                    const option = document.createElement("option");
                    option.value = item.product;
                    option.textContent = item.product;
                    productSelect.appendChild(option);
                });
            } else if (type) {
                data[type].forEach(item => {
                    const option = document.createElement("option");
                    option.value = item.product;
                    option.textContent = item.product;
                    productSelect.appendChild(option);
                });
            }

            // Disable fields for free copy
            const isFreeCopy = type === "freeCopy";
            productSelect.disabled = isFreeCopy;
            priceInput.disabled = isFreeCopy;
            billingTermInput.disabled = isFreeCopy;
            jurisdictionSelect.disabled = isFreeCopy;
            taxInput.disabled = isFreeCopy;
            finalAmountInput.disabled = isFreeCopy;

            updateDetails(); // Reset details
        }

        function updateDetails() {
            const type = document.getElementById("type").value;
            const product = document.getElementById("product").value;
            const priceInput = document.getElementById("price");
            const billingTermInput = document.getElementById("billingTerm");

            let selectedProduct;
            if (type === "cancellation" || type === "freeCopy" || type === "breachExchange") {
                const combinedProducts = [...data.sales, ...data.saves, ...data.breach];
                selectedProduct = combinedProducts.find(item => item.product === product);
            } else if (type && product) {
                selectedProduct = data[type].find(item => item.product === product);
            }

            if (selectedProduct) {
                priceInput.value = selectedProduct.price;
                billingTermInput.value = selectedProduct.billingTerm;
            } else {
                priceInput.value = '';
                billingTermInput.value = '';
            }
            updateTax(); // Update tax and final amount
            updateDisclosure(); // Update disclosure text
        }

        function updateTax() {
            const jurisdiction = document.getElementById("jurisdiction").value;
            const price = parseFloat(document.getElementById("price").value.replace('$', ''));
            const taxInput = document.getElementById("tax");
            const finalAmountInput = document.getElementById("finalAmount");

            if (jurisdiction && !isNaN(price)) {
                const taxes = taxRates[jurisdiction];
                let totalTaxRate = 0;
                let taxDetails = '';

                for (const [taxType, rate] of Object.entries(taxes)) {
                    totalTaxRate += rate;
                    taxDetails += `${taxType}: ${(rate * 100).toFixed(2)}% `;
                }

                const totalTaxAmount = price * totalTaxRate;
                const finalAmount = price + totalTaxAmount;

                taxInput.value = `${taxDetails.trim()} (Total: ${(totalTaxRate * 100).toFixed(2)}%)`;
                finalAmountInput.value = `$${finalAmount.toFixed(2)}`;
            } else {
                taxInput.value = '';
                finalAmountInput.value = '';
            }
        }        function updateDisclosure() {
            const type = document.getElementById("type").value;
            const product = document.getElementById("product").value;
            const price = document.getElementById("price").value.replace('$', '');
            const billingTerm = document.getElementById("billingTerm").value;
            const disclosureContainer = document.getElementById("disclosureContainer");
            const disclosureText = document.getElementById("disclosureText");

            if (type === "breach" && product) {
                const todayDateObj = new Date();
                const nextYearDateObj = new Date();
                nextYearDateObj.setFullYear(todayDateObj.getFullYear() + 1);

                const todayDateStr = todayDateObj.toLocaleDateString();
                const nextYearDateStr = nextYearDateObj.toLocaleDateString();

                disclosureText.innerHTML =
                    `To summarize what we discussed, you have agreed to sign up for ${product} and you will not be charged for this product during the one year subscription period from ${todayDateStr} to ${nextYearDateStr} because you used a promotional code provided by Equifax as a means of payment. You will receive an email confirming this transaction. Do I have your approval?`;
                
                disclosureContainer.style.display = "block";
            } else if (type === "breachExchange" && product) {
                disclosureText.innerHTML =
                    `To summarize what we discussed, we will Exchange your subscription to ${product} immediately and we will bill you ${price} ${billingTerm}. You will receive a confirmation email. You may call Equifax at 800-871-3250 to cancel your product at any time; however, we do not provide partial month refunds. If you decide to cancel, you must call in before your next billing date to avoid further charges. Do I have your consent on this?`;
                
                disclosureContainer.style.display = "block";
            } else if (type === "freeCopy") {
                disclosureText.innerHTML =
                    `To summarize what we discussed, you agreed to order a free copy of your credit report and score. Please note that the copy is a screen print of your file and will be available for 30 days. Do I have your approval?`;
                
                disclosureContainer.style.display = "block";
            } else if (type === "saves" && product === "Equifax Complete™ Premier - Annual") {
                disclosureText.innerHTML =
                    `To summarize what we discussed, you will keep your Equifax Complete Premier product and we will bill you $99.95 for one year. After one year, your annual subscription will renew for $99.95. You will receive a confirmation email. You may call Equifax at 1-800-871-3250 to cancel your product at any time. If you decide to cancel, you must call in before your next billing date to avoid further charges. Do I have your consent on this?`;
                
                disclosureContainer.style.display = "block";
            } else if (type === "saves" && product === "Equifax Complete™ Premier Lite") {
                disclosureText.innerHTML =
                    `To summarize what we discussed, we will change your subscription to Equifax Complete Premier Lite immediately and we will bill you ${price} per month. You will receive a confirmation email. You may call Equifax at 1-800-871-3250 to cancel your product at any time; however, we do not provide partial month refunds. If you decide to cancel, you must call in before your next billing date to avoid further charges. Do I have your consent on this?`;
                
                disclosureContainer.style.display = "block";
            } else if (type === "saves" && product.includes("50%")) {
                const doublePrice = (parseFloat(price) * 2).toFixed(2);
                disclosureText.innerHTML =
                    `To summarize what we discussed, you will keep your Equifax Complete Premier product and we will bill you $${price} + taxes per month for 12 months. After 12 months you will resume payments of $${doublePrice} + taxes per month. You will receive a confirmation email. You may call Equifax at 1-800-871-3250 to cancel your product at any time. If you decide to cancel, you must call in before your next billing date to avoid further charges. Do I have your consent on this?`;
                
                disclosureContainer.style.display = "block";
            } else if (type === "sales" && (product === "Equifax Complete™ Premier - Trial" || product === "Equifax Complete™ Friends & Family - Trial-$4.95"|| product === "Equifax Complete™ Friends & Family - Trial-$9.95")) {
                const regularPrice = product.includes("Premier") ? "24.95" : "34.95";
                disclosureText.innerHTML =
                    `To summarize what we have discussed, you will be charged  $${price} plus taxes for the first month and after you will be charged $${regularPrice} plus taxes per month for purchase/exchange of your ${product}. You will receive a confirmation email on ${new Date().toLocaleDateString()}. You can call/contact Equifax at 1-800-871-3250 to cancel your product at any time. If you decide to cancel, you should call before your next billing date to avoid additional charges. Do I have your approval?`;
                
                disclosureContainer.style.display = "block";
            } else if (type === "sales" && (product === "Equifax Complete™ Premier" || product === "Equifax Complete™ Friends & Family" || product === "Equifax Complete™ Protection")) {
                const todayDateStr = new Date().toLocaleDateString();

                disclosureText.innerHTML =
                    `To summarize what we have discussed, you will be charged $${price} ${billingTerm} for the purchase/exchange of your ${product}. You will receive an email confirming your purchase on ${todayDateStr}. You can call/contact Equifax at 1-800-871-3250 to cancel your product at any time. If you decide to cancel, you must call before your next billing date to avoid additional charges. Do I have your approval?`;
                
                disclosureContainer.style.display = "block";
            } else if (type === "cancellation" && product) {
                const todayDateStr = `<span style="color: red; font-weight: bold;">${new Date().toLocaleDateString()}</span>`;

                disclosureText.innerHTML =
                    `To summarize what we talked about, your product will be canceled on ${todayDateStr} and we will no longer charge you for <span style="color: red; font-weight: bold;">${product}</span>. You will no longer receive <span style="color: red; font-weight: bold;">${product}</span> after ${todayDateStr}. You will receive an email confirming your cancellation on ${todayDateStr}. Do I have your approval?`;
                
                disclosureContainer.style.display = "block";
            } else {
                disclosureContainer.style.display = "none";
                disclosureText.innerHTML = '';
            }
        }

        function resetSelections() {
            document.getElementById("type").value = '';
            document.getElementById("product").innerHTML = '<option value="">Select</option>';
            document.getElementById("price").value = '';
            document.getElementById("billingTerm").value = '';
            document.getElementById("jurisdiction").value = '';
            document.getElementById("tax").value = '';
            document.getElementById("finalAmount").value = '';
            document.getElementById("disclosureContainer").style.display = 'none';
            document.getElementById("disclosureText").innerHTML = '';
        }
    </script>
</body>
</html>