';$body.appendChild($modal);$modalImage = $('#' + this.id + '-modal img');$modalImage.addEventListener('load', function() {setTimeout(function() {if (!$modal.classList.contains('visible'))return;$modal.classList.add('loaded');setTimeout(function() {$modal.classList.remove('switching');}, _this.delay);}, ($modal.classList.contains('switching') ? 0 : _this.delay));});$modalNext = $('#' + this.id + '-modal .next');$modalPrevious = $('#' + this.id + '-modal .previous');$modal.show = function(index) {var item;if (_this.locked)return;if (index < 0)index = _this.$links.length - 1; else if (index >= _this.$links.length)index = 0;if (index == _this.current)return;item = _this.$links.item(index);if (!item)return;_this.locked = true;if (_this.current !== null) {$modal.classList.remove('loaded');$modal.classList.add('switching');setTimeout(function() {_this.current = index;$modalImage.src = item.href;setTimeout(function() {$modal.focus();_this.locked = false;}, _this.delay);}, _this.delay);} else {_this.current = index;$modalImage.src = item.href;$modal.classList.add('visible');setTimeout(function() {$modal.focus();_this.locked = false;}, _this.delay);}};$modal.hide = function() {if (_this.locked)return;if (!$modal.classList.contains('visible'))return;_this.locked = true;$modal.classList.remove('visible');$modal.classList.remove('loaded');$modal.classList.remove('switching');setTimeout(function() {$modalImage.src = '';_this.locked = false;$body.focus();_this.current = null;}, _this.delay);};$modal.next = function() {$modal.show(_this.current + 1);};$modal.previous = function() {$modal.show(_this.current - 1);};$modal.first = function() {$modal.show(0);};$modal.last = function() {$modal.show(_this.$links.length - 1);};$modal.addEventListener('touchmove', function(event) {event.preventDefault();});$modal.addEventListener('click', function(event) {$modal.hide();});$modal.addEventListener('keydown', function(event) {if (!$modal.classList.contains('visible'))return;switch (event.keyCode) {case 39:case 32:if (!_this.navigation)break;event.preventDefault();event.stopPropagation();$modal.next();break;case 37:if (!_this.navigation)break;event.preventDefault();event.stopPropagation();$modal.previous();break;case 36:if (!_this.navigation)break;event.preventDefault();event.stopPropagation();$modal.first();break;case 35:if (!_this.navigation)break;event.preventDefault();event.stopPropagation();$modal.last();break;case 27:event.preventDefault();event.stopPropagation();$modal.hide();break;}});$modalNext.addEventListener('click', function(event) {$modal.next();});$modalPrevious.addEventListener('click', function(event) {$modal.previous();});this.$modal = $modal;this.$modalImage = $modalImage;this.$modalNext = $modalNext;this.$modalPrevious = $modalPrevious;};lightboxGallery.prototype.show = function(href, config) {this.$links = config.$links;this.navigation = config.navigation;this.mobile = config.mobile;if (this.navigation) {this.$modalNext.style.display = '';this.$modalPrevious.style.display = '';} else {this.$modalNext.style.display = 'none';this.$modalPrevious.style.display = 'none';}if (client.mobile && !this.mobile)return;this.$modal.show(href);};var _lightboxGallery = new lightboxGallery;_lightboxGallery.init({id: 'gallery02',navigation: true,mobile: true});})();