<?php

// Add the mediabox style sheet
$GLOBALS['TL_CSS'][] = 'assets/mootools/mediabox/'. $GLOBALS['TL_ASSETS']['MEDIABOX'] .'/css/mediaboxAdvBlack21.css|static';

?>

<script src="<?= TL_ASSETS_URL ?>assets/mootools/mediabox/<?= $GLOBALS['TL_ASSETS']['MEDIABOX'] ?>/js/mediabox.js"></script>
<script>
  (function($) {
    window.addEvent('domready', function() {
      $$('a[data-lightbox]').mediabox({
        // Put custom options here
      }, function(el) {
        return [el.href, el.title, el.getAttribute('data-lightbox')];
      }, function(el) {
        var data = this.getAttribute('data-lightbox').split(' ');
        return (this == el) || (data[0] && el.getAttribute('data-lightbox').match(data[0]));
      });
      $('mbImage').addEvent('swipe', function(e) {
        (e.direction == 'left') ? $('mbNextLink').fireEvent('click') : $('mbPrevLink').fireEvent('click');
      });
    });
  })(document.id);
</script>
