{% if DISABLE_TRACKING %}

{% else %}

{% autoescape off %}{{ TRACKING_HTML }}{% endautoescape %}

<!-- Piwik -->
<script type="text/javascript">
<!--
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  _paq.push([function() {
    function getOriginalVisitorCookieTimeout(obj) {
      var now = new Date(),
        nowTs = Math.round(now.getTime() / 1000),
        visitorInfo = obj.getVisitorInfo();
      var createTs = parseInt(visitorInfo[2]);
      var cookieTimeout = 33696000; // 13 mois en secondes
      var originalTimeout = createTs + cookieTimeout - nowTs;
      return originalTimeout;
    }
    this.setVisitorCookieTimeout(getOriginalVisitorCookieTimeout(this));
  }]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://piwik.sopinspace.net/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "17"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
<!-- End Piwik Code -->
$(document).ready(function() {
  $('#hide-piwik-cookies-optout').click(function() {
    $('#piwik-cookies-optout iframe').slideToggle("fast");
  });
});
-->
</script>
<div id="piwik-cookies-optout"><iframe frameborder="no" width="900px" height="120px" src="https://piwik.sopinspace.net/index.php?module=CoreAdminHome&action=optOut&language={{ LANGUAGE_CODE }}"></iframe></div>
{% endif %}
