<!DOCTYPE html>
<html>
    
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Swim for Tri - Page not found</title>
        <meta name="description" content="Swim for Tri - Page not found.">
        <meta name="keywords" content="swim,swimming,triathlon,tri,swimfortri,4,for,plans,training,tutorial,lesson,guide,lessons,pdf,articles,free,article,learn,download,purchase"/>
        <meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0" />
        <link rel="stylesheet" href="style/sft.css">
        <link rel="stylesheet" href="style/error-style.css">
        <link rel="stylesheet" href="style/cookies.css?4">
        <link rel="stylesheet" href="https://ampanula.online/style/sft.css">
        <link rel="stylesheet" href="https://ampanula.online/style/error-style.css">
        <link href="https://fonts.googleapis.com/css?family=Ubuntu:400,500,700" rel="stylesheet">
        
        <link rel="shortcut icon" type="image/png" href="images/smudge_fav_words_curved.png"/>
    </head>

    <!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QWRBN5N8TW"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('consent', 'default', {
        'analytics_storage': 'denied',
        'ad_storage': 'denied'
    });

  gtag('config', 'G-QWRBN5N8TW');
</script>
    
    <body>
        <div class="outer">
          <div class="middle">
            <div class="inner">
                <!-- <img src="images/sft-favicon.png" alt="Swim for Tri logo" title="Swim for Tri logo" width="100" /> -->
                <img src="https://ampanula.online/images/sft-favicon.png" alt="Swim for Tri logo" title="Swim for Tri logo" width="100" />
              <h1 class="error_header">Page not found</h1>
              <p class="error_body">The page that you have tried to load is no longer available.</p>
                <!-- <button class="returnHomeBtn" onclick="returnHome()">Return Home</button> -->
                <a href="https://ampanula.online" style="text-decoration: none;"><button class="returnHomeBtn">Return Home</button></a>
            </div>
          </div>
        </div>  
        <p style="position: absolute; bottom: 10px; width: 100%; text-align: center; font-size: 12px; font-family: Arial, Helvetica, sans-serif; font-weight: 600; color: gray;">&copy; 2019 - <script>document.write(new Date().getFullYear())</script> Tom Coomer</p>
    <div class="cookies_banner" id="cookies_banner" style="display: none;">
            <h4>Cookies</h4>
            <p>We use cookies and other tracking technologies to help us to improve your expereince on our website, analyze website traffic and learn where our visitors find us.</p>
            <p>Please see our <a target="_blank" href="/gdpr-compliance-policy.html">privacy policy</a> for more information on how we use this data. You can choose which cookies you would like to allow below.</p>


            <div class="cookies_banner_checkboxes">
                <label class="cookies_banner_checkboxes_container">Analytics
                    <input id="cookies_analytics_checkbox" type="checkbox">
                    <span class="checkmark"></span>
                  </label>

                  <label class="cookies_banner_checkboxes_container">Advertising
                    <input id="cookies_advertising_checkbox" type="checkbox">
                    <span class="checkmark"></span>
                  </label>
                  
                  <label class="cookies_banner_checkboxes_container">Required
                    <input type="checkbox" checked="checked" disabled>
                    <span class="checkmark"></span>
                  </label>
            </div>

            <div>
                <button onclick="cookiesBannerAllowAll()">Allow All</button>
                <button onclick="cookiesBannerAllowSelected()">Allow Selected</button>
                <button onclick="cookiesBannerDeclineAll()">Decline All</button>
            </div>
            
        </div>

        <script>
            // Check if the user has previously provided consent
            // const consent = localStorage.getItem('analyticsConsent_test');
            const consent = sessionStorage.getItem('analyticsConsent_jul_23');

            // If consent is not given, display the banner
            if (!consent) {
            document.getElementById('cookies_banner').style.display = 'block';
            }

            function cookiesBannerAllowAll() {

                //Update allowed cookies
                gtag('consent', 'update', {
                  'analytics_storage': 'granted',
                  'ad_storage': 'granted'
                });

                sessionStorage.setItem('analyticsConsent_jul_23', 'true');
                document.getElementById('cookies_banner').style.display = 'none';
            }

            function cookiesBannerAllowSelected() {

                //Get selected checkboxes
                const cookies_analytics_checkbox = document.getElementById('cookies_analytics_checkbox');
                var analyticsStoragePermission = 'denied';
                if (cookies_analytics_checkbox.checked) {
                    analyticsStoragePermission = 'granted';
                } else {
                    analyticsStoragePermission = 'denied';
                }

                const cookies_advertising_checkbox = document.getElementById('cookies_advertising_checkbox');
                var adStoragePermission = 'denied';
                if (cookies_advertising_checkbox.checked) {
                    adStoragePermission = 'granted';
                } else {
                    adStoragePermission = 'denied';
                }

                //Update allowed cookies
                gtag('consent', 'update', {
                  'analytics_storage': analyticsStoragePermission,
                  'ad_storage': adStoragePermission
                });

                console.log("Analytcis permission: " + analyticsStoragePermission);
                console.log("Ads permission: " + adStoragePermission);

                sessionStorage.setItem('analyticsConsent_jul_23', 'selected');
                document.getElementById('cookies_banner').style.display = 'none';
            }

            function cookiesBannerDeclineAll() {

                //Update allowed cookies
                gtag('consent', 'update', {
                  'analytics_storage': 'denied',
                  'ad_storage': 'denied'
                });


                sessionStorage.setItem('analyticsConsent_jul_23', 'false');
                document.getElementById('cookies_banner').style.display = 'none';
            }
        </script>

    </body>
    
    <script src="scripts/error-page.js"></script>
</html>