');
- }
-
- item.inlineElement = el;
- return el;
- }
-
- mfp.updateStatus('ready');
- mfp._parseMarkup(template, {}, item);
- return template;
- }
- }
- });
-
- /*>>inline*/
-
- /*>>ajax*/
- var AJAX_NS = 'ajax',
- _ajaxCur,
- _removeAjaxCursor = function() {
- if(_ajaxCur) {
- $(document.body).removeClass(_ajaxCur);
- }
- },
- _destroyAjaxRequest = function() {
- _removeAjaxCursor();
- if(mfp.req) {
- mfp.req.abort();
- }
- };
-
- $.magnificPopup.registerModule(AJAX_NS, {
-
- options: {
- settings: null,
- cursor: 'mfp-ajax-cur',
- tError: '
The content could not be loaded.'
- },
-
- proto: {
- initAjax: function() {
- mfp.types.push(AJAX_NS);
- _ajaxCur = mfp.st.ajax.cursor;
-
- _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
- _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
- },
- getAjax: function(item) {
-
- if(_ajaxCur) {
- $(document.body).addClass(_ajaxCur);
- }
-
- mfp.updateStatus('loading');
-
- var opts = $.extend({
- url: item.src,
- success: function(data, textStatus, jqXHR) {
- var temp = {
- data:data,
- xhr:jqXHR
- };
-
- _mfpTrigger('ParseAjax', temp);
-
- mfp.appendContent( $(temp.data), AJAX_NS );
-
- item.finished = true;
-
- _removeAjaxCursor();
-
- mfp._setFocus();
-
- setTimeout(function() {
- mfp.wrap.addClass(READY_CLASS);
- }, 16);
-
- mfp.updateStatus('ready');
-
- _mfpTrigger('AjaxContentAdded');
- },
- error: function() {
- _removeAjaxCursor();
- item.finished = item.loadError = true;
- mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
- }
- }, mfp.st.ajax.settings);
-
- mfp.req = $.ajax(opts);
-
- return '';
- }
- }
- });
-
- /*>>ajax*/
-
- /*>>image*/
- var _imgInterval,
- _getTitle = function(item) {
- if(item.data && item.data.title !== undefined)
- return item.data.title;
-
- var src = mfp.st.image.titleSrc;
-
- if(src) {
- if($.isFunction(src)) {
- return src.call(mfp, item);
- } else if(item.el) {
- return item.el.attr(src) || '';
- }
- }
- return '';
- };
-
- $.magnificPopup.registerModule('image', {
-
- options: {
- markup: '
',
- cursor: 'mfp-zoom-out-cur',
- titleSrc: 'title',
- verticalFit: true,
- tError: '
The image could not be loaded.'
- },
-
- proto: {
- initImage: function() {
- var imgSt = mfp.st.image,
- ns = '.image';
-
- mfp.types.push('image');
-
- _mfpOn(OPEN_EVENT+ns, function() {
- if(mfp.currItem.type === 'image' && imgSt.cursor) {
- $(document.body).addClass(imgSt.cursor);
- }
- });
-
- _mfpOn(CLOSE_EVENT+ns, function() {
- if(imgSt.cursor) {
- $(document.body).removeClass(imgSt.cursor);
- }
- _window.off('resize' + EVENT_NS);
- });
-
- _mfpOn('Resize'+ns, mfp.resizeImage);
- if(mfp.isLowIE) {
- _mfpOn('AfterChange', mfp.resizeImage);
- }
- },
- resizeImage: function() {
- var item = mfp.currItem;
- if(!item || !item.img) return;
-
- if(mfp.st.image.verticalFit) {
- var decr = 0;
- // fix box-sizing in ie7/8
- if(mfp.isLowIE) {
- decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
- }
- item.img.css('max-height', mfp.wH-decr);
- }
- },
- _onImageHasSize: function(item) {
- if(item.img) {
-
- item.hasSize = true;
-
- if(_imgInterval) {
- clearInterval(_imgInterval);
- }
-
- item.isCheckingImgSize = false;
-
- _mfpTrigger('ImageHasSize', item);
-
- if(item.imgHidden) {
- if(mfp.content)
- mfp.content.removeClass('mfp-loading');
-
- item.imgHidden = false;
- }
-
- }
- },
-
- /**
- * Function that loops until the image has size to display elements that rely on it asap
- */
- findImageSize: function(item) {
-
- var counter = 0,
- img = item.img[0],
- mfpSetInterval = function(delay) {
-
- if(_imgInterval) {
- clearInterval(_imgInterval);
- }
- // decelerating interval that checks for size of an image
- _imgInterval = setInterval(function() {
- if(img.naturalWidth > 0) {
- mfp._onImageHasSize(item);
- return;
- }
-
- if(counter > 200) {
- clearInterval(_imgInterval);
- }
-
- counter++;
- if(counter === 3) {
- mfpSetInterval(10);
- } else if(counter === 40) {
- mfpSetInterval(50);
- } else if(counter === 100) {
- mfpSetInterval(500);
- }
- }, delay);
- };
-
- mfpSetInterval(1);
- },
-
- getImage: function(item, template) {
-
- var guard = 0,
-
- // image load complete handler
- onLoadComplete = function() {
- if(item) {
- if (item.img[0].complete) {
- item.img.off('.mfploader');
-
- if(item === mfp.currItem){
- mfp._onImageHasSize(item);
-
- mfp.updateStatus('ready');
- }
-
- item.hasSize = true;
- item.loaded = true;
-
- _mfpTrigger('ImageLoadComplete');
-
- }
- else {
- // if image complete check fails 200 times (20 sec), we assume that there was an error.
- guard++;
- if(guard < 200) {
- setTimeout(onLoadComplete,100);
- } else {
- onLoadError();
- }
- }
- }
- },
-
- // image error handler
- onLoadError = function() {
- if(item) {
- item.img.off('.mfploader');
- if(item === mfp.currItem){
- mfp._onImageHasSize(item);
- mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
- }
-
- item.hasSize = true;
- item.loaded = true;
- item.loadError = true;
- }
- },
- imgSt = mfp.st.image;
-
-
- var el = template.find('.mfp-img');
- if(el.length) {
- var img = document.createElement('img');
- img.className = 'mfp-img';
- if(item.el && item.el.find('img').length) {
- img.alt = item.el.find('img').attr('alt');
- }
- item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
- img.src = item.src;
-
- // without clone() "error" event is not firing when IMG is replaced by new IMG
- // TODO: find a way to avoid such cloning
- if(el.is('img')) {
- item.img = item.img.clone();
- }
-
- img = item.img[0];
- if(img.naturalWidth > 0) {
- item.hasSize = true;
- } else if(!img.width) {
- item.hasSize = false;
- }
- }
-
- mfp._parseMarkup(template, {
- title: _getTitle(item),
- img_replaceWith: item.img
- }, item);
-
- mfp.resizeImage();
-
- if(item.hasSize) {
- if(_imgInterval) clearInterval(_imgInterval);
-
- if(item.loadError) {
- template.addClass('mfp-loading');
- mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
- } else {
- template.removeClass('mfp-loading');
- mfp.updateStatus('ready');
- }
- return template;
- }
-
- mfp.updateStatus('loading');
- item.loading = true;
-
- if(!item.hasSize) {
- item.imgHidden = true;
- template.addClass('mfp-loading');
- mfp.findImageSize(item);
- }
-
- return template;
- }
- }
- });
-
- /*>>image*/
-
- /*>>zoom*/
- var hasMozTransform,
- getHasMozTransform = function() {
- if(hasMozTransform === undefined) {
- hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
- }
- return hasMozTransform;
- };
-
- $.magnificPopup.registerModule('zoom', {
-
- options: {
- enabled: false,
- easing: 'ease-in-out',
- duration: 300,
- opener: function(element) {
- return element.is('img') ? element : element.find('img');
- }
- },
-
- proto: {
-
- initZoom: function() {
- var zoomSt = mfp.st.zoom,
- ns = '.zoom',
- image;
-
- if(!zoomSt.enabled || !mfp.supportsTransition) {
- return;
- }
-
- var duration = zoomSt.duration,
- getElToAnimate = function(image) {
- var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
- transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
- cssObj = {
- position: 'fixed',
- zIndex: 9999,
- left: 0,
- top: 0,
- '-webkit-backface-visibility': 'hidden'
- },
- t = 'transition';
-
- cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
-
- newImg.css(cssObj);
- return newImg;
- },
- showMainContent = function() {
- mfp.content.css('visibility', 'visible');
- },
- openTimeout,
- animatedImg;
-
- _mfpOn('BuildControls'+ns, function() {
- if(mfp._allowZoom()) {
-
- clearTimeout(openTimeout);
- mfp.content.css('visibility', 'hidden');
-
- // Basically, all code below does is clones existing image, puts in on top of the current one and animated it
-
- image = mfp._getItemToZoom();
-
- if(!image) {
- showMainContent();
- return;
- }
-
- animatedImg = getElToAnimate(image);
-
- animatedImg.css( mfp._getOffset() );
-
- mfp.wrap.append(animatedImg);
-
- openTimeout = setTimeout(function() {
- animatedImg.css( mfp._getOffset( true ) );
- openTimeout = setTimeout(function() {
-
- showMainContent();
-
- setTimeout(function() {
- animatedImg.remove();
- image = animatedImg = null;
- _mfpTrigger('ZoomAnimationEnded');
- }, 16); // avoid blink when switching images
-
- }, duration); // this timeout equals animation duration
-
- }, 16); // by adding this timeout we avoid short glitch at the beginning of animation
-
-
- // Lots of timeouts...
- }
- });
- _mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
- if(mfp._allowZoom()) {
-
- clearTimeout(openTimeout);
-
- mfp.st.removalDelay = duration;
-
- if(!image) {
- image = mfp._getItemToZoom();
- if(!image) {
- return;
- }
- animatedImg = getElToAnimate(image);
- }
-
- animatedImg.css( mfp._getOffset(true) );
- mfp.wrap.append(animatedImg);
- mfp.content.css('visibility', 'hidden');
-
- setTimeout(function() {
- animatedImg.css( mfp._getOffset() );
- }, 16);
- }
-
- });
-
- _mfpOn(CLOSE_EVENT+ns, function() {
- if(mfp._allowZoom()) {
- showMainContent();
- if(animatedImg) {
- animatedImg.remove();
- }
- image = null;
- }
- });
- },
-
- _allowZoom: function() {
- return mfp.currItem.type === 'image';
- },
-
- _getItemToZoom: function() {
- if(mfp.currItem.hasSize) {
- return mfp.currItem.img;
- } else {
- return false;
- }
- },
-
- // Get element postion relative to viewport
- _getOffset: function(isLarge) {
- var el;
- if(isLarge) {
- el = mfp.currItem.img;
- } else {
- el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
- }
-
- var offset = el.offset();
- var paddingTop = parseInt(el.css('padding-top'),10);
- var paddingBottom = parseInt(el.css('padding-bottom'),10);
- offset.top -= ( $(window).scrollTop() - paddingTop );
-
-
- /*
-
- Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
-
- */
- var obj = {
- width: el.width(),
- // fix Zepto height+padding issue
- height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
- };
-
- // I hate to do this, but there is no another option
- if( getHasMozTransform() ) {
- obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
- } else {
- obj.left = offset.left;
- obj.top = offset.top;
- }
- return obj;
- }
-
- }
- });
-
-
-
- /*>>zoom*/
-
- /*>>iframe*/
-
- var IFRAME_NS = 'iframe',
- _emptyPage = '//about:blank',
-
- _fixIframeBugs = function(isShowing) {
- if(mfp.currTemplate[IFRAME_NS]) {
- var el = mfp.currTemplate[IFRAME_NS].find('iframe');
- if(el.length) {
- // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
- if(!isShowing) {
- el[0].src = _emptyPage;
- }
-
- // IE8 black screen bug fix
- if(mfp.isIE8) {
- el.css('display', isShowing ? 'block' : 'none');
- }
- }
- }
- };
-
- $.magnificPopup.registerModule(IFRAME_NS, {
-
- options: {
- markup: '
',
-
- srcAction: 'iframe_src',
-
- // we don't care and support only one default type of URL by default
- patterns: {
- youtube: {
- index: 'youtube.com',
- id: 'v=',
- src: '//www.youtube.com/embed/%id%?autoplay=1'
- },
- vimeo: {
- index: 'vimeo.com/',
- id: '/',
- src: '//player.vimeo.com/video/%id%?autoplay=1'
- },
- gmaps: {
- index: '//maps.google.',
- src: '%id%&output=embed'
- }
- }
- },
-
- proto: {
- initIframe: function() {
- mfp.types.push(IFRAME_NS);
-
- _mfpOn('BeforeChange', function(e, prevType, newType) {
- if(prevType !== newType) {
- if(prevType === IFRAME_NS) {
- _fixIframeBugs(); // iframe if removed
- } else if(newType === IFRAME_NS) {
- _fixIframeBugs(true); // iframe is showing
- }
- }// else {
- // iframe source is switched, don't do anything
- //}
- });
-
- _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
- _fixIframeBugs();
- });
- },
-
- getIframe: function(item, template) {
- var embedSrc = item.src;
- var iframeSt = mfp.st.iframe;
-
- $.each(iframeSt.patterns, function() {
- if(embedSrc.indexOf( this.index ) > -1) {
- if(this.id) {
- if(typeof this.id === 'string') {
- embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
- } else {
- embedSrc = this.id.call( this, embedSrc );
- }
- }
- embedSrc = this.src.replace('%id%', embedSrc );
- return false; // break;
- }
- });
-
- var dataObj = {};
- if(iframeSt.srcAction) {
- dataObj[iframeSt.srcAction] = embedSrc;
- }
- mfp._parseMarkup(template, dataObj, item);
-
- mfp.updateStatus('ready');
-
- return template;
- }
- }
- });
-
-
-
- /*>>iframe*/
-
- /*>>gallery*/
- /**
- * Get looped index depending on number of slides
- */
- var _getLoopedId = function(index) {
- var numSlides = mfp.items.length;
- if(index > numSlides - 1) {
- return index - numSlides;
- } else if(index < 0) {
- return numSlides + index;
- }
- return index;
- },
- _replaceCurrTotal = function(text, curr, total) {
- return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
- };
-
- $.magnificPopup.registerModule('gallery', {
-
- options: {
- enabled: false,
- arrowMarkup: '
',
- preload: [0,2],
- navigateByImgClick: true,
- arrows: true,
-
- tPrev: 'Previous (Left arrow key)',
- tNext: 'Next (Right arrow key)',
- tCounter: '%curr% of %total%'
- },
-
- proto: {
- initGallery: function() {
-
- var gSt = mfp.st.gallery,
- ns = '.mfp-gallery';
-
- mfp.direction = true; // true - next, false - prev
-
- if(!gSt || !gSt.enabled ) return false;
-
- _wrapClasses += ' mfp-gallery';
-
- _mfpOn(OPEN_EVENT+ns, function() {
-
- if(gSt.navigateByImgClick) {
- mfp.wrap.on('click'+ns, '.mfp-img', function() {
- if(mfp.items.length > 1) {
- mfp.next();
- return false;
- }
- });
- }
-
- _document.on('keydown'+ns, function(e) {
- if (e.keyCode === 37) {
- mfp.prev();
- } else if (e.keyCode === 39) {
- mfp.next();
- }
- });
- });
-
- _mfpOn('UpdateStatus'+ns, function(e, data) {
- if(data.text) {
- data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
- }
- });
-
- _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
- var l = mfp.items.length;
- values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
- });
-
- _mfpOn('BuildControls' + ns, function() {
- if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
- var markup = gSt.arrowMarkup,
- arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
- arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
-
- arrowLeft.click(function() {
- mfp.prev();
- });
- arrowRight.click(function() {
- mfp.next();
- });
-
- mfp.container.append(arrowLeft.add(arrowRight));
- }
- });
-
- _mfpOn(CHANGE_EVENT+ns, function() {
- if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
-
- mfp._preloadTimeout = setTimeout(function() {
- mfp.preloadNearbyImages();
- mfp._preloadTimeout = null;
- }, 16);
- });
-
-
- _mfpOn(CLOSE_EVENT+ns, function() {
- _document.off(ns);
- mfp.wrap.off('click'+ns);
- mfp.arrowRight = mfp.arrowLeft = null;
- });
-
- },
- next: function() {
- mfp.direction = true;
- mfp.index = _getLoopedId(mfp.index + 1);
- mfp.updateItemHTML();
- },
- prev: function() {
- mfp.direction = false;
- mfp.index = _getLoopedId(mfp.index - 1);
- mfp.updateItemHTML();
- },
- goTo: function(newIndex) {
- mfp.direction = (newIndex >= mfp.index);
- mfp.index = newIndex;
- mfp.updateItemHTML();
- },
- preloadNearbyImages: function() {
- var p = mfp.st.gallery.preload,
- preloadBefore = Math.min(p[0], mfp.items.length),
- preloadAfter = Math.min(p[1], mfp.items.length),
- i;
-
- for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
- mfp._preloadItem(mfp.index+i);
- }
- for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
- mfp._preloadItem(mfp.index-i);
- }
- },
- _preloadItem: function(index) {
- index = _getLoopedId(index);
-
- if(mfp.items[index].preloaded) {
- return;
- }
-
- var item = mfp.items[index];
- if(!item.parsed) {
- item = mfp.parseEl( index );
- }
-
- _mfpTrigger('LazyLoad', item);
-
- if(item.type === 'image') {
- item.img = $('
').on('load.mfploader', function() {
- item.hasSize = true;
- }).on('error.mfploader', function() {
- item.hasSize = true;
- item.loadError = true;
- _mfpTrigger('LazyLoadError', item);
- }).attr('src', item.src);
- }
-
-
- item.preloaded = true;
- }
- }
- });
-
- /*>>gallery*/
-
- /*>>retina*/
-
- var RETINA_NS = 'retina';
-
- $.magnificPopup.registerModule(RETINA_NS, {
- options: {
- replaceSrc: function(item) {
- return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
- },
- ratio: 1 // Function or number. Set to 1 to disable.
- },
- proto: {
- initRetina: function() {
- if(window.devicePixelRatio > 1) {
-
- var st = mfp.st.retina,
- ratio = st.ratio;
-
- ratio = !isNaN(ratio) ? ratio : ratio();
-
- if(ratio > 1) {
- _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
- item.img.css({
- 'max-width': item.img[0].naturalWidth / ratio,
- 'width': '100%'
- });
- });
- _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
- item.src = st.replaceSrc(item, ratio);
- });
- }
- }
-
- }
- }
- });
-
- /*>>retina*/
- _checkInstance(); }));
+!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery||window.Zepto)}(function(d){var u,i,p,o,f,t,l="Close",c="BeforeClose",m="MarkupParse",g="Open",a="Change",n="mfp",h="."+n,v="mfp-ready",r="mfp-removing",s="mfp-prevent-close",e=function(){},y=!!window.jQuery,C=d(window),w=function(e,t){u.ev.on(n+e+h,t)},b=function(e,t,n,i){var o=document.createElement("div");return o.className="mfp-"+e,n&&(o.innerHTML=n),i?t&&t.appendChild(o):(o=d(o),t&&o.appendTo(t)),o},I=function(e,t){u.ev.triggerHandler(n+e,t),u.st.callbacks&&(e=e.charAt(0).toLowerCase()+e.slice(1),u.st.callbacks[e]&&u.st.callbacks[e].apply(u,d.isArray(t)?t:[t]))},x=function(e){return e===t&&u.currTemplate.closeBtn||(u.currTemplate.closeBtn=d(u.st.closeMarkup.replace("%title%",u.st.tClose)),t=e),u.currTemplate.closeBtn},k=function(){d.magnificPopup.instance||((u=new e).init(),d.magnificPopup.instance=u)};e.prototype={constructor:e,init:function(){var e=navigator.appVersion;u.isLowIE=u.isIE8=document.all&&!document.addEventListener,u.isAndroid=/android/gi.test(e),u.isIOS=/iphone|ipad|ipod/gi.test(e),u.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),u.probablyMobile=u.isAndroid||u.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),p=d(document),u.popupsCache={}},open:function(e){var t;if(!1===e.isObj){u.items=e.items.toArray(),u.index=0;var n,i=e.items;for(t=0;t
(e||C.height())},_setFocus:function(){(u.st.focus?u.content.find(u.st.focus).eq(0):u.wrap).focus()},_onFocusIn:function(e){if(e.target!==u.wrap[0]&&!d.contains(u.wrap[0],e.target))return u._setFocus(),!1},_parseMarkup:function(o,e,t){var r;t.data&&(e=d.extend(t.data,e)),I(m,[o,e,t]),d.each(e,function(e,t){if(void 0===t||!1===t)return!0;if(1<(r=e.split("_")).length){var n=o.find(h+"-"+r[0]);if(0").attr("src",t).attr("class",n.attr("class"))):n.attr(r[1],t)}}else o.find(h+"-"+e).html(t)})},_getScrollbarSize:function(){if(void 0===u.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),u.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return u.scrollbarSize}},d.magnificPopup={instance:null,proto:e.prototype,modules:[],open:function(e,t){return k(),(e=e?d.extend(!0,{},e):{}).isObj=!0,e.index=t||0,this.instance.open(e)},close:function(){return d.magnificPopup.instance&&d.magnificPopup.instance.close()},registerModule:function(e,t){t.options&&(d.magnificPopup.defaults[e]=t.options),d.extend(this.proto,t.proto),this.modules.push(e)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'× ',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},d.fn.magnificPopup=function(e){k();var t=d(this);if("string"==typeof e)if("open"===e){var n,i=y?t.data("magnificPopup"):t[0].magnificPopup,o=parseInt(arguments[1],10)||0;i.items?n=i.items[o]:(n=t,i.delegate&&(n=n.find(i.delegate)),n=n.eq(o)),u._openClick({mfpEl:n},t,i)}else u.isOpen&&u[e].apply(u,Array.prototype.slice.call(arguments,1));else e=d.extend(!0,{},e),y?t.data("magnificPopup",e):t[0].magnificPopup=e,u.addGroup(t,e);return t};var T,_,P,S="inline",E=function(){P&&(_.after(P.addClass(T)).detach(),P=null)};d.magnificPopup.registerModule(S,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){u.types.push(S),w(l+"."+S,function(){E()})},getInline:function(e,t){if(E(),e.src){var n=u.st.inline,i=d(e.src);if(i.length){var o=i[0].parentNode;o&&o.tagName&&(_||(T=n.hiddenClass,_=b(T),T="mfp-"+T),P=i.after(_).detach().removeClass(T)),u.updateStatus("ready")}else u.updateStatus("error",n.tNotFound),i=d("");return e.inlineElement=i}return u.updateStatus("ready"),u._parseMarkup(t,{},e),t}}});var z,O="ajax",M=function(){z&&d(document.body).removeClass(z)},B=function(){M(),u.req&&u.req.abort()};d.magnificPopup.registerModule(O,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'
The content could not be loaded.'},proto:{initAjax:function(){u.types.push(O),z=u.st.ajax.cursor,w(l+"."+O,B),w("BeforeChange."+O,B)},getAjax:function(o){z&&d(document.body).addClass(z),u.updateStatus("loading");var e=d.extend({url:o.src,success:function(e,t,n){var i={data:e,xhr:n};I("ParseAjax",i),u.appendContent(d(i.data),O),o.finished=!0,M(),u._setFocus(),setTimeout(function(){u.wrap.addClass(v)},16),u.updateStatus("ready"),I("AjaxContentAdded")},error:function(){M(),o.finished=o.loadError=!0,u.updateStatus("error",u.st.ajax.tError.replace("%url%",o.src))}},u.st.ajax.settings);return u.req=d.ajax(e),""}}});var L;d.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'
The image could not be loaded.'},proto:{initImage:function(){var e=u.st.image,t=".image";u.types.push("image"),w(g+t,function(){"image"===u.currItem.type&&e.cursor&&d(document.body).addClass(e.cursor)}),w(l+t,function(){e.cursor&&d(document.body).removeClass(e.cursor),C.off("resize"+h)}),w("Resize"+t,u.resizeImage),u.isLowIE&&w("AfterChange",u.resizeImage)},resizeImage:function(){var e=u.currItem;if(e&&e.img&&u.st.image.verticalFit){var t=0;u.isLowIE&&(t=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",u.wH-t)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,L&&clearInterval(L),e.isCheckingImgSize=!1,I("ImageHasSize",e),e.imgHidden&&(u.content&&u.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(t){var n=0,i=t.img[0],o=function(e){L&&clearInterval(L),L=setInterval(function(){0
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){u.types.push(A),w("BeforeChange",function(e,t,n){t!==n&&(t===A?F():n===A&&F(!0))}),w(l+"."+A,function(){F()})},getIframe:function(e,t){var n=e.src,i=u.st.iframe;d.each(i.patterns,function(){if(-1',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var r=u.st.gallery,e=".mfp-gallery";if(u.direction=!0,!r||!r.enabled)return!1;f+=" mfp-gallery",w(g+e,function(){r.navigateByImgClick&&u.wrap.on("click"+e,".mfp-img",function(){if(1=u.index,u.index=e,u.updateItemHTML()},preloadNearbyImages:function(){var e,t=u.st.gallery.preload,n=Math.min(t[0],u.items.length),i=Math.min(t[1],u.items.length);for(e=1;e<=(u.direction?i:n);e++)u._preloadItem(u.index+e);for(e=1;e<=(u.direction?n:i);e++)u._preloadItem(u.index-e)},_preloadItem:function(e){if(e=j(e),!u.items[e].preloaded){var t=u.items[e];t.parsed||(t=u.parseEl(e)),I("LazyLoad",t),"image"===t.type&&(t.img=d(' ').on("load.mfploader",function(){t.hasSize=!0}).on("error.mfploader",function(){t.hasSize=!0,t.loadError=!0,I("LazyLoadError",t)}).attr("src",t.src)),t.preloaded=!0}}}});var W="retina";d.magnificPopup.registerModule(W,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(1