/*! jqPhotoSwipe v0.1.1 - jQuery for PhotoSwipe https://ergec.github.io/jQuery-for-PhotoSwipe/ */ !function(jQuery){jQuery.fn.jqPhotoSwipe=function(options){if(this.length){var _photoswipe={},defaults={forceSingleGallery:!1,galleryOpen:function(gallery){}};_photoswipe.galleries=[],_photoswipe.galleriesindex=[];var pswpElement,$galleryid=0;if($(".pswp[role='dialog']").length)pswpElement=$(".pswp[role='dialog']")[0];else{pswpElement=$('').appendTo("body")[0]}return this.each((function(){var $options=$.extend(defaults,options),$this=$(this),$galleryname=$this.data("fancybox-group");$galleryname||($options.forceSingleGallery?($galleryname="pswg-forced",$this.data("fancybox-group",$galleryname)):($galleryname="pswgname"+_photoswipe.galleriesindex.length,$this.data("fancybox-group",$galleryname))),-1===_photoswipe.galleriesindex.indexOf($galleryname)?($galleryid=_photoswipe.galleriesindex.length,_photoswipe.galleriesindex.push($galleryname),_photoswipe.galleries[$galleryid]={},_photoswipe.galleries[$galleryid].items=[],_photoswipe.galleries[$galleryid].i=0):$galleryid=_photoswipe.galleriesindex.indexOf($galleryname);var $galleryid2=$galleryid;$this.data("i",_photoswipe.galleries[$galleryid].i),$this.data("gid",$galleryname),_photoswipe.galleries[$galleryid2].items.push({src:$this.attr("href"),title:$this.attr("title"),w:0,h:0}),$this.off("click").on("click",(function(e){e.preventDefault();var index=$(this).data("i");function loadImg(index,item){if(0==item.w&&0==item.h){var imgpreload=new Image;imgpreload.onload=function(){item.w=this.width,item.h=this.height,item.needsUpdate=!0,_photoswipe.galleries[$galleryid2].obj.updateSize(!0)},imgpreload.src=item.src}}$options.index=index,$options.galleryUID=$(this).data("gid"),_photoswipe.galleries[$galleryid2].obj=new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,_photoswipe.galleries[$galleryid2].items,$options),_photoswipe.galleries[$galleryid2].obj.init(),_photoswipe.galleries[$galleryid2].obj.listen("initialZoomInEnd",(function(){$options.galleryOpen(_photoswipe.galleries[$galleryid2].obj)})),_photoswipe.galleries[$galleryid2].obj.listen("imageLoadComplete",(function(index,item){loadImg(index,item)})),_photoswipe.galleries[$galleryid2].obj.listen("gettingData",(function(index,item){loadImg(index,item)}))}));var $hashparams=function(){for(var params={},vars=window.location.hash.substring(1).split("&"),i=0;i