<footer class="footer">
  <div class="footer__container container">
    <div class="footer__logo">
      <a href="/" title="">
        <img src="https://storage.googleapis.com/idz-garden/northpass/images/idz-logo-white.png" style="height: 30px; width: auto;" alt="" />
      </a>
    </div>
  </div>
  <div class="idz-custom-data" style="display: none;">
    <div class="learner-email">
      {{ current_person.email }}
    </div>
  </div>
</footer>
<script>
  (function(){
    var userLang = navigator.language || navigator.userLanguage;
    var curLang = userLang.toLowerCase().indexOf('fr') > -1 ? 'fr' : 'en';
  
    var headerNavElements = [
      {
        fr: {
          label: "Parcours",
          href:"/",
          title: "",
          internal: true,
        },
        en: {
          label: "Courses",
          href:"/",
          title: "",
          internal: true,
        }
      },
      {
        fr: {
          label: "Webinars",
          href:"/",
          title: "",
          internal: false,
        },
        en: {
          label: "Webinars",
          href:"/",
          title: "",
          internal: false,
        }
      },
    ];
  
    var footerNavElements = [
      {
        fr: {
          label: "Base de connaissance",
          href:"https://help.iadvize.com/hc/fr",
          title: "",
          internal: false,
        },
        en: {
          label: "Knowledge base",
          href:"https://help.iadvize.com/hc/en-gb",
          title: "",
          internal: false,
        }
      },
      {
        fr: {
          label: "iAdvize.com",
          href:"https://iadvize.com",
          title: "",
          internal: false,
        },
        en: {
          label: "iAdvize.com",
          href:"https://iadvize.com",
          title: "",
          internal: false,
        }
      },
      
    ];
  
    var initialNavElements = [
      {
        fr: {
          label: "Accueil",
          href:"/",
          title: "",
          internal: true,
        },
        en: {
          label: "Home",
          href:"/",
          title: "",
          internal: true,
        }
      }
    ];
  
    var createNavigation = function(parentSelector, className = '', lang = 'en', navigationElements = initialNavElements) {
      var parent = document.querySelectorAll(parentSelector);
  
      if(
        parent &&
        parent.length &&
        navigationElements.length
      ) {
        var nav = document.createElement('nav');
          nav.classList.add(className);
        var navList = document.createElement('ul');
          navList.classList.add('nav');
  
        navigationElements
          .map(function(navEl) {
            return navEl[lang];
          })
          .forEach(function(el) {
            var item = document.createElement('li');
              item.classList.add('nav__item');
            var link = document.createElement('a');
              link.href = el.href;
              link.title = el.title;
              link.target = el.internal ? '_self' : '_blank';
  
            link.append(el.label);
            item.append(link);
            navList.append(item);
          });
          nav.append(navList);
          parent[0].append(nav);
      }
    }
    createNavigation('.footer__container', 'footer__nav', curLang, footerNavElements);
  })()
  
  </script>
  
  <!-- START IADVIZE LIVECHAT -->
  <script type='text/javascript'>
    var idzCustomData = {};
    (function() {
        var idz = document.createElement('script');
        idz.type = 'text/javascript';
        idz.async = true;
        idz.src = document.location.protocol + '//halc.iadvize.com/iadvize.js?sid=7163';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(idz, s);
    })();
  </script><!-- END IADVIZE LIVECHAT -->

  <!-- Start Screeb -->

<script type="text/javascript">
 (function (w,d,s,o,f,js,fjs) {
 w['ScreebObject']=o;w[o]=w[o]||function(){(w[o].q=w[o].q||[]).push(arguments)};
 js=d.createElement(s),fjs=d.getElementsByTagName(s)[0];js.type='text/javascript';
 js.id=o;js.src=f;js.async=1;d.getElementsByTagName("head")[0].appendChild(js);
 }(window,document,'script','$screeb','https://t.screeb.app/tag.js'));
 $screeb('init', '54db1ce2-aae0-4c6c-b481-e1725ce24935');
 $screeb('identity', '{{ current_person.email }}', {
    name: '{{ current_person.name }}',
});

const interval = setInterval(() => {
  if (!!window.iAdvize && !!iAdvize.platform && iAdvize.platform.length > 0 && !!iAdvize.client_id) {
        $screeb('identity.properties', {
            CID: iAdvize.platform+'-'+iAdvize.client_id,
        });
        clearInterval(interval);
    }
}, 1000);
 
</script>
<!-- End Screeb -->

<script>
  $(document).ready(function() {
  var language = window.navigator.userLanguage || window.navigator.language;
    
    console.log(language);

    if( language != 'fr' ){
      $( "a:contains('Aller au cours')" ).text("Go to the course");      
      $('input[name="q"]').attr("placeholder", "Search by keyword");
    }
    
  });
</script>
