footer.php 4.46 KB
<footer id="new-footer">
    <div id="footer-sidebar" class="secondary clear">
        <div id="footer-sidebar1">
            <?php
            if (is_active_sidebar('footer-sidebar-1')) {
                dynamic_sidebar('footer-sidebar-1');
            }
            ?>
        </div>
        <div id="footer-sidebar2">
            <?php
            if (is_active_sidebar('footer-sidebar-2')) {
                dynamic_sidebar('footer-sidebar-2');
            }
            ?>
        </div>
        <div id="footer-sidebar3">
            <?php
            if (is_active_sidebar('footer-sidebar-3')) {
                dynamic_sidebar('footer-sidebar-3');
            }
            ?>
        </div>
    </div>

<!-- Change cookie name for new banner -->
<script type='text/javascript'>
            jQuery( document ).ready(function($) {

                if(getCookie('CWL-viewed-COVID-19-current-policy')){
                    $('#COVID-19-home-info-bar').addClass('hide');
                }else{
                    $('#COVID-19-home-info-bar').removeClass('hide');
                    setTimeout(function() {
                        $('#COVID-19-home-info-bar').addClass('expand');
                    }, 100);
                }

              $(document).on("click",".closeHomeBanner , .readHomeBanner", function() {
                setCookie('viewed-home-COVID-19-current-policy', true, 1);
                $('#COVID-19-home-info-bar').addClass('hide');
              });

              function setCookie(cname, cvalue, exdays) {
                var d = new Date();
                d.setTime(d.getTime() + (exdays * 60 * 60 * 1000));
                var expires = "expires="+d.toUTCString();
                var host = window.location.hostname;
                var domain_only = host.substr(host.indexOf("."))
                if(domain_only == ".ca" || domain_only == ".com" || domain_only == ".test") {
                    domain_only = "."+window.location.hostname;
                }
                document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/;Domain="+domain_only;
            }

            function getCookie(c_name) {
                    var c_value = document.cookie,
                        c_start = c_value.indexOf(" " + c_name + "=");
                    if (c_start == -1) c_start = c_value.indexOf(c_name + "=");
                    if (c_start == -1) {
                        c_value = null;
                    } else {
                        c_start = c_value.indexOf("=", c_start) + 1;
                        var c_end = c_value.indexOf(";", c_start);
                        if (c_end == -1) {
                            c_end = c_value.length;
                        }
                        c_value = unescape(c_value.substring(c_start, c_end));
                    }
                    return c_value;
                }


            });

</script>

</footer>
</div><!-- end of content-wrap -->

<script type='text/javascript'>

  function scrollScripts() {
    if(!jQuery('#content-wrap').hasClass('retract')) {
      if(jQuery(window).scrollTop() >= 100) {
          jQuery('#content-wrap').addClass('retract');
          jQuery('.sidenav').addClass('retract');
      }
    } else {
        if(jQuery(window).scrollTop() < 100) {
            jQuery('#content-wrap').removeClass('retract');
            jQuery('.sidenav').removeClass('retract');
        }
    }
  }

  var scrolling = false;
 
  jQuery( window ).scroll( function() {
      scrolling = true;
  });

  jQuery('#side-window').scroll(function() {
      scrolling = true;
  });
  
  setInterval( function() {
      if ( scrolling ) {
          scrolling = false;
          scrollScripts();
      }
  }, 250 );
  
  // or for modern browsers
  document.addEventListener( 'wheel', function( evt ) {
      scrolling = true;
  }, { capture: false, passive: true });

  scrollScripts();

</script>

<div class="modal fade" id="contact-modal" tabindex="-1" role="dialog" aria-labelledby="contact-modalTitle" aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <h5 class="modal-title" id="contact-modalTitle">Thank you for your request.</h5>

        </div>
        <div class="modal-body">
            
        </div>

    </div>
    </div>
</div>

<?php wp_footer() ?>

</body>

</html>