!function(){"use strict";var t,e,i,n,s={animate:!0,layout:"justified",filter:"*",filterControls:"",autoConsiderScrollBars:!0,onBeforeOptionsChanged:function(){},onOptionsChanged:function(){},onBeforeRender:function(){},onRender:function(){},autoInitOnDomReady:!0,autoInitOnDomMutation:!0,autoSyncChildListMutation:!0,useOptionAttributes:!0,autoSyncAttributesMutation:!0,autoSyncChildClassMutation:!0},l={},o=null,a=0,r=null,u={isTruly:function(t){return!!t&&("string"!=typeof t||"false"!==t.toLowerCase())},expectArray:function(t){return u.isArrayLike(t)?t:[t]},isArrayLike:function(t){return t.length===+t.length&&"string"!=typeof t},inArray:function(t,e){return-1!==t.indexOf(e)},objectWalk:function(t,e){var i;if(e(t),"object"==typeof t)for(i in t)u.objectWalk(t[i],e)},objectAssign:function(t){var e,i;for(e=1;e=0&&i.item(n)!==t;);return n>-1},changeMultipleClassNames:(n=document.createElement("div").classList,n.add("a","b"),n.contains("b")?function(t,e,i){t.classList[e?"add":"remove"].apply(t.classList,i)}:function(t,e,i){for(var n=i.length,s=e?"add":"remove",l=n;l--;)t.classList[s](i[n-l-1])}),expectNaturalImageSize:(i=[],e=function(){var e;for(e=0;e-.5&&e<1.5&&i>-.5&&i<1.5&&o.push(r.splice(n,1)[0]);for(n=0;n0&&parseInt(n)>0?e.imagesStatus.push(this.IMG_LOADING_READY):e.imagesStatus.push(this.IMG_LOADING)}).bind(this)(i[n]);return document.body.offsetWidth,e.images.forEach(function(t,i){var n=function(){e.imagesStatus[i]=t.naturalWidth?this.IMG_FINISHED:this.IMG_FAILURE,this._onImageFinished(e)}.bind(this),s=function(){e.imagesStatus[i]=this.IMG_FAILURE,this._onImageFinished(e)}.bind(this);t.addEventListener("load",n,!1),t.addEventListener("error",s,!1),t.complete&&n(),e.imagesInfo[i].lazySrc||e.imagesInfo[i].lazySrcset||u.expectNaturalImageSize(t,function(n,s){e.imagesStatus[i]=s&&t.naturalWidth?t.complete?this.IMG_FINISHED:this.IMG_READY:this.IMG_FAILURE,this._onImageReady(e)}.bind(this))}.bind(this)),this._onImageReady(e),this._onImageFinished(e),e},_processInsertQueue:function(t){var e,i,n,s,l,o,a=this._insertQueue.lastProcess<(new Date).getTime()-this._insertQueue.maxQueueTime,r=[],u=[],h=this._options.filter,m=[];if(null!==this._insertQueue.timer&&(clearTimeout(this._insertQueue.timer),this._insertQueue.timer=null),t||a){for(d(),e=this._insertQueue.items.shift();e;)u.push(e),e=this._insertQueue.items.shift();for(o=u.length;o--;)for(s=(e=u[o]).item.images.length;s--;)!(n=e.item.imagesInfo[s]).attributeWidth&&e.item.images[s].offsetWidth<40&&e.item.images[s].naturalWidth&&(n.attributeWidth=e.item.images[s].naturalWidth),!n.attributeHeight&&e.item.images[s].offsetHeight<40&&e.item.images[s].naturalHeight&&(n.attributeHeight=e.item.images[s].naturalHeight),(n.attributeWidth||n.attributeHeight)&&(l=getComputedStyle(e.item.images[s]),(parseInt(l.width)<40||"auto"===l.width||n.lazySrc||n.lazySrcset)&&n.attributeWidth&&!n.styleWidth&&r.push({image:e.item.images[s],definition:"width",value:n.attributeWidth+"px"}),(parseInt(l.height)<40||"auto"===l.height||n.lazySrc||n.lazySrcset)&&n.attributeHeight&&!n.styleHeight&&r.push({image:e.item.images[s],definition:"height",value:n.attributeHeight+"px"})),(n.lazySrc||n.lazySrcset)&&m.push({item:e.item,image:e.item.images[s],src:n.lazySrc,srcset:n.lazySrcset});for(i=r.length;i--;)r[i].image.style[r[i].definition]=r[i].value,r[i].image.style.display="none";for(document.body.offsetWidth,i=r.length;i--;)r[i].image.style.display="";for(o=u.length;o--;)(e=u[o]).item.size=[e.contentElement.offsetWidth,e.contentElement.offsetHeight],e.item.ratio=e.item.size[0]/e.item.size[1];for(i=r.length;i--;)r[i].image.style[r[i].definition]="";for(o=u.length;o--;)(e=u[o]).item.status=this.ITEM_INSERTED,e.item.valid=!(!e.item.size[0]||!e.item.size[1]),this._setMatchFilter(e.item,h),e.item.contentElement.classList.remove("jgalleryItemInitializing"),e.item.contentElement.classList.add("jgalleryItemReady");for(this.render(),o=u.length;o--;)(e=u[o]).item.contentElement.style.visibility="";m.length&&this._addImagesToLazyLoadQueue(m),this._insertQueue.lastProcess=(new Date).getTime()}else this._insertQueue.timer=setTimeout(function(){this._processInsertQueue(!0)}.bind(this),this._insertQueue.maxQuietTime)},_addImagesToLazyLoadQueue:function(t){null===r&&t.length&&(r=[],window.addEventListener("resize",u.processLazyLoading,!1),window.addEventListener("scroll",u.processLazyLoading,!0)),r=r.concat(t),u.processLazyLoading()},_addToInsertQueue:function(t,e){this._insertQueue.items.push({contentElement:t,item:e}),this._processInsertQueue(!1)},_onImageFinished:function(t){var e=t.failures;u.inArray(t.imagesStatus,this.IMG_LOADING)||u.inArray(t.imagesStatus,this.IMG_LOADING_READY)||u.inArray(t.imagesStatus,this.IMG_READY)||(d(),u.inArray(t.imagesStatus,this.IMG_FAILURE)&&(t.failures=!0),t.status===this.ITEM_INSERTED&&e!==t.failures&&this.render(),t.contentElement.classList.remove("jgalleryItemLoading"),t.contentElement.classList.add("jgalleryItemComplete"))},_onImageReady:function(t){var e=t.failures;t.failures=u.inArray(t.imagesStatus,this.IMG_FAILURE),t.status===this.ITEM_INSERTED&&e!==t.failures&&this.render(),t.status!==this.ITEM_REGISTERED||u.inArray(t.imagesStatus,this.IMG_LOADING)||(t.status=this.ITEM_INSERT_QUEUE,this._addToInsertQueue(t.contentElement,t))},_getOptionParametersFromElement:function(t,e,i){var n,s,l,o,a={},r={};for(s in t=t||this.element,e=e||t.getAttribute("data-jgallery-layout")||this._options.layout,l=t.attributes,n=Jgallery.getDefaultOptions(e))a[s.toLowerCase()]={name:s,value:n[s]};if(i)void 0!==a[s=i.substr(14).toLowerCase()]&&(r.name=a[s].name,r.value=void 0!==l[i]?l[i].value:null);else for(t.classList.contains("jgalleryAnimated")&&(r.animate=!0),o=l.length;o--;)"data-jgallery-"===l[o].name.substr(0,14)&&void 0!==a[s=l[o].name.substr(14).toLowerCase()]&&(r[a[s].name]=l[o].value);return r},_updateOptionParameters:function(t){var e,i,n,s,l,o,a,r,h=!1;if(t=t||{},this._options.onBeforeOptionsChanged(this),i=u.objectAssign({},this._options),"object"==typeof t.layout&&null===t.layout&&this._options.layout!==Jgallery._defaultOptions.layout&&(this._options.layout=Jgallery._defaultOptions.layout,h=!0),"string"==typeof t.layout&&"object"==typeof Jgallery._layouts[t.layout]&&Jgallery._layouts[t.layout].constructor===JgalleryLayout&&this._options.layout!==t.layout&&(this._options.layout=t.layout,h=!0),n=Jgallery.getDefaultOptions(this._options.layout),h){for(e in this._options)void 0===n[e]&&delete this._options[e];for(e in n)void 0===this._options[e]&&(this._options[e]=n[e]);if(this._options.useOptionAttributes)for(e in s=this._getOptionParametersFromElement(null,this._options.layout))void 0!==n[e]&&void 0===t[e]&&this._options[e]!==s[e]&&(t[e]=s[e])}for(e in n)if(void 0!==t[e]&&null!==t[e])switch(typeof n[e]){case"boolean":this._options[e]=u.isTruly(t[e]);break;case"number":this._options[e]=+t[e];break;default:this._options[e]=t[e]}for(e in"string"==typeof t.filter&&this._options.filter!==t.filter&&u.isValidCssSelector(t.filter)&&(this._options.filter=t.filter),"string"!=typeof t.filterControls||""!==t.filterControls&&!u.isValidCssSelector(t.filterControls)||(this._options.filterControls=t.filterControls),void 0!==t.animate&&null!==t.animate&&(this._options.animate=u.isTruly(t.animate)),void 0!==t.autoConsiderScrollBars&&null!==t.autoConsiderScrollBars&&(this._options.autoConsiderScrollBars=u.isTruly(t.autoConsiderScrollBars)),"function"==typeof t.onBeforeOptionsChanged&&(this._options.onBeforeOptionsChanged=t.onBeforeOptionsChanged),"function"==typeof t.onOptionsChanged&&(this._options.onOptionsChanged=t.onOptionsChanged),"function"==typeof t.onBeforeRender&&(this._options.onBeforeRender=t.onBeforeRender),"function"==typeof t.onRender&&(this._options.onRender=t.onRender),void 0!==t.autoSyncChildListMutation&&null!==t.autoSyncChildListMutation&&(this._options.autoSyncChildListMutation=u.isTruly(t.autoSyncChildListMutation)),void 0!==t.autoSyncAttributesMutation&&null!==t.autoSyncAttributesMutation&&(this._options.autoSyncAttributesMutation=u.isTruly(t.autoSyncAttributesMutation)),void 0!==t.autoSyncChildClassMutation&&null!==t.autoSyncChildClassMutation&&(this._options.autoSyncChildClassMutation=u.isTruly(t.autoSyncChildClassMutation)),t)null===t[e]&&void 0!==n[e]&&(this._options[e]=n[e]);if(i.filter!==this._options.filter)for(l=this._allItems.length;l--;)this._setMatchFilter(this._allItems[l],this._options.filter);if(i.filterControls!==this._options.filterControls||this._options.filterControls&&0===this._filterControls.length){for(a=[].slice.call(this._options.filterControls?document.querySelectorAll(this._options.filterControls):[]),l=this._filterControls.length;l--;)if(!u.inArray(a,this._filterControls[l])){switch(this._filterControls[l].nodeName+this._filterControls[l].type){case"SELECT":case"INPUTcheckbox":case"INPUTradio":this._filterControls[l].removeEventListener("change",this._filterControls[l].jgalleryFilterControlHandler);break;case"INPUTbutton":case"INPUTsubmit":case"BUTTONbutton":case"BUTTONsubmit":case"BUTTONreset":this._filterControls[l].removeEventListener("click",this._filterControls[l].jgalleryFilterControlHandler);break;default:this._filterControls[l].removeEventListener("input",this._filterControls[l].jgalleryFilterControlHandler)}this._filterControls.splice(l,1)}for(l=a.length;l--;)if(!u.inArray(this._filterControls,a[l])){switch(a[l].jgalleryFilterControlHandler=this._filterControlEventHandler.bind(this),a[l].nodeName+a[l].type){case"SELECT":case"INPUTcheckbox":case"INPUTradio":a[l].addEventListener("change",a[l].jgalleryFilterControlHandler);break;case"INPUTbutton":case"INPUTsubmit":case"BUTTONbutton":case"BUTTONsubmit":case"BUTTONreset":a[l].addEventListener("click",a[l].jgalleryFilterControlHandler);break;default:a[l].addEventListener("input",a[l].jgalleryFilterControlHandler)}this._filterControls.push(a[l])}}if(d(),this._resetElementMutationObserver(),this.element.classList[this._options.animate?"add":"remove"]("jgalleryAnimated"),this._options.useOptionAttributes)for(e in this._options)if(r="data-jgallery-"+e.toLowerCase(),o=this._options[e],void 0!==t[e]&&null===t[e]&&this.element.hasAttribute(r))this.element.removeAttribute(r);else if(n[e]!==this._options[e]||this.element.hasAttribute(r)){switch(typeof o){case"boolean":o=o?"true":"false";break;case"number":o+=""}"string"==typeof o&&this.element.setAttribute(r,o)}this._resetChildMutationObserver(),this._options.onOptionsChanged(this)}},document.addEventListener("DOMContentLoaded",(function(){Jgallery._defaultOptions.autoInitOnDomReady&&y(),m.reset()})),"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.jgallery=function(t){return this.each((function(){jQuery(this).data("jgallery",new Jgallery(this,t))}))})}(),new JgalleryLayout({name:"justified",options:{itemHeight:260,hideOnMissingImage:!0,itemGap:0,fillLastRow:!0,fillSingleRow:!0},handler:function(t){var e,i,n,s,l,o,a,r,u,h,d,m=parseInt(t.jgalleryInstance.getOption("itemHeight")),c=!!t.jgalleryInstance.getOption("hideOnMissingImage"),g=parseInt(t.jgalleryInstance.getOption("itemGap")),y=!!t.jgalleryInstance.getOption("fillLastRow"),p=!!t.jgalleryInstance.getOption("fillSingleRow"),f=t.items,_=[],b=[],I=t.dimensions.contentBox.width,v=0,O=0,A=[],C=0,E=0;for(e=f.length;e--;)!(s=f[e]).valid||!s.matchFilter||c&&s.imageError?b.unshift(s):(_.unshift(s),s.optWidth=m*s.width/s.height,v+=s.optWidth);for(n=_.length,l=y?v/(Math.round((v+g*n)/(I+g))||1):I,e=n;e--;)O+(s=_[n-1-e]).optWidth/2>l*A.length&&A.push(a={displaySizeY:0,displayPosY:0,ratioAll:0,optWidth:0,items:[]}),O+=s.optWidth,a.optWidth+=s.optWidth,a.ratioAll+=s.aspectRatio,a.items.push(s);for(t.height=0,o=A.length,u=null,e=0;e1&&y||e=h,i=0;ia?a:e)-1)*m,l=e;l--;)c+=n=i-Math.round(i*l/e)-c,g.push({index:g.length,width:n,left:i-c+l*m,height:0});for(l=a;l--;){if(d)s=g[s&&s.index>0?s.index-1:e-1];else for(s=g[o=e-1];o--;)g[o].height