/*! magnific popup - v1.1.0 - 2016-02-20 * http://dimsemenov.com/plugins/magnific-popup/ * copyright (c) 2016 dmitry semenov; */ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jquery||window.zepto)}(function(a){var b,c,d,e,f,g,h="close",i="beforeclose",j="afterclose",k="beforeappend",l="markupparse",m="open",n="change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jquery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createelement("div");return f.classname="mfp-"+b,d&&(f.innerhtml=d),e?c&&c.appendchild(f):(f=a(f),c&&f.appendto(c)),f},y=function(c,d){b.ev.triggerhandler(o+c,d),b.st.callbacks&&(c=c.charat(0).tolowercase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isarray(d)?d:[d]))},z=function(c){return c===g&&b.currtemplate.closebtn||(b.currtemplate.closebtn=a(b.st.closemarkup.replace("%title%",b.st.tclose)),g=c),b.currtemplate.closebtn},a=function(){a.magnificpopup.instance||(b=new t,b.init(),a.magnificpopup.instance=b)},b=function(){var a=document.createelement("p").style,b=["ms","o","moz","webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appversion;b.islowie=b.isie8=document.all&&!document.addeventlistener,b.isandroid=/android/gi.test(c),b.isios=/iphone|ipad|ipod/gi.test(c),b.supportstransition=b(),b.probablymobile=b.isandroid||b.isios||/(opera mini)|kindle|webos|blackberry|(opera mobi)|(windows phone)|iemobile/i.test(navigator.useragent),d=a(document),b.popupscache={}},open:function(c){var e;if(c.isobj===!1){b.items=c.items.toarray(),b.index=0;var g,h=c.items;for(e=0;e(a||v.height())},_setfocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onfocusin:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setfocus(),!1)},_parsemarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replacewith"===g?f[0]!==d[0]&&f.replacewith(d):"img"===g?f.is("img")?f.attr("src",d):f.replacewith(a("").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getscrollbarsize:function(){if(void 0===b.scrollbarsize){var a=document.createelement("div");a.style.csstext="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendchild(a),b.scrollbarsize=a.offsetwidth-a.clientwidth,document.body.removechild(a)}return b.scrollbarsize}},a.magnificpopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return a(),b=b?a.extend(!0,{},b):{},b.isobj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificpopup.instance&&a.magnificpopup.instance.close()},registermodule:function(b,c){c.options&&(a.magnificpopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},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}},a.fn.magnificpopup=function(c){a();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificpopup"):d[0].magnificpopup,g=parseint(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openclick({mfpel:e},d,f)}else b.isopen&&b[c].apply(b,array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificpopup",c):d[0].magnificpopup=c,b.addgroup(d,c);return d};var c,d,e,f="inline",g=function(){e&&(d.after(e.addclass(c)).detach(),e=null)};a.magnificpopup.registermodule(f,{options:{hiddenclass:"hide",markup:"",tnotfound:"content not found"},proto:{initinline:function(){b.types.push(f),w(h+"."+f,function(){g()})},getinline:function(c,d){if(g(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentnode;g&&g.tagname&&(d||(c=e.hiddenclass,d=x(c),c="mfp-"+c),e=f.after(d).detach().removeclass(c)),b.updatestatus("ready")}else b.updatestatus("error",e.tnotfound),f=a("
");return c.inlineelement=f,f}return b.updatestatus("ready"),b._parsemarkup(d,{},c),d}}});var h,i="ajax",j=function(){h&&a(document.body).removeclass(h)},k=function(){j(),b.req&&b.req.abort()};a.magnificpopup.registermodule(i,{options:{settings:null,cursor:"mfp-ajax-cur",terror:'the content could not be loaded.'},proto:{initajax:function(){b.types.push(i),h=b.st.ajax.cursor,w(h+"."+i,k),w("beforechange."+i,k)},getajax:function(c){h&&a(document.body).addclass(h),b.updatestatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("parseajax",g),b.appendcontent(a(g.data),i),c.finished=!0,j(),b._setfocus(),settimeout(function(){b.wrap.addclass(q)},16),b.updatestatus("ready"),y("ajaxcontentadded")},error:function(){j(),c.finished=c.loaderror=!0,b.updatestatus("error",b.st.ajax.terror.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var l,m=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titlesrc;if(d){if(a.isfunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.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 c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.curritem.type&&c.cursor&&a(document.body).addclass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeclass(c.cursor),v.off("resize"+p)}),w("resize"+d,b.resizeimage),b.islowie&&w("afterchange",b.resizeimage)},resizeimage:function(){var a=b.curritem;if(a&&a.img&&b.st.image.verticalfit){var c=0;b.islowie&&(c=parseint(a.img.css("padding-top"),10)+parseint(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wh-c)}},_onimagehassize:function(a){a.img&&(a.hassize=!0,l&&clearinterval(l),a.ischeckingimgsize=!1,y("imagehassize",a),a.imghidden&&(b.content&&b.content.removeclass("mfp-loading"),a.imghidden=!1))},findimagesize:function(a){var c=0,d=a.img[0],e=function(f){l&&clearinterval(l),l=setinterval(function(){return d.naturalwidth>0?void b._onimagehassize(a):(c>200&&clearinterval(l),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getimage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.curritem&&(b._onimagehassize(c),b.updatestatus("ready")),c.hassize=!0,c.loaded=!0,y("imageloadcomplete")):(e++,200>e?settimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.curritem&&(b._onimagehassize(c),b.updatestatus("error",h.terror.replace("%url%",c.src))),c.hassize=!0,c.loaded=!0,c.loaderror=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createelement("img");j.classname="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalwidth>0?c.hassize=!0:j.width||(c.hassize=!1)}return b._parsemarkup(d,{title:m(c),img_replacewith:c.img},c),b.resizeimage(),c.hassize?(l&&clearinterval(l),c.loaderror?(d.addclass("mfp-loading"),b.updatestatus("error",h.terror.replace("%url%",c.src))):(d.removeclass("mfp-loading"),b.updatestatus("ready")),d):(b.updatestatus("loading"),c.loading=!0,c.hassize||(c.imghidden=!0,d.addclass("mfp-loading"),b.findimagesize(c)),d)}}});var n,o=function(){return void 0===n&&(n=void 0!==document.createelement("p").style.moztransform),n};a.magnificpopup.registermodule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initzoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportstransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeattr("style").removeattr("class").addclass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zindex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("buildcontrols"+d,function(){if(b._allowzoom()){if(cleartimeout(e),b.content.css("visibility","hidden"),a=b._getitemtozoom(),!a)return void k();f=j(a),f.css(b._getoffset()),b.wrap.append(f),e=settimeout(function(){f.css(b._getoffset(!0)),e=settimeout(function(){k(),settimeout(function(){f.remove(),a=f=null,y("zoomanimationended")},16)},g)},16)}}),w(i+d,function(){if(b._allowzoom()){if(cleartimeout(e),b.st.removaldelay=g,!a){if(a=b._getitemtozoom(),!a)return;f=j(a)}f.css(b._getoffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),settimeout(function(){f.css(b._getoffset())},16)}}),w(h+d,function(){b._allowzoom()&&(k(),f&&f.remove(),a=null)})}},_allowzoom:function(){return"image"===b.curritem.type},_getitemtozoom:function(){return b.curritem.hassize?b.curritem.img:!1},_getoffset:function(c){var d;d=c?b.curritem.img:b.st.zoom.opener(b.curritem.el||b.curritem);var e=d.offset(),f=parseint(d.css("padding-top"),10),g=parseint(d.css("padding-bottom"),10);e.top-=a(window).scrolltop()-f;var h={width:d.width(),height:(u?d.innerheight():d[0].offsetheight)-g-f};return o()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var p="iframe",q="//about:blank",r=function(a){if(b.currtemplate[p]){var c=b.currtemplate[p].find("iframe");c.length&&(a||(c[0].src=q),b.isie8&&c.css("display",a?"block":"none"))}};a.magnificpopup.registermodule(p,{options:{markup:'
',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(){b.types.push(p),w("beforechange",function(a,b,c){b!==c&&(b===p?r():c===p&&r(!0))}),w(h+"."+p,function(){r()})},getiframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexof(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastindexof(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcaction&&(g[f.srcaction]=e),b._parsemarkup(d,g,c),b.updatestatus("ready"),d}}});var s=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},t=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificpopup.registermodule("gallery",{options:{enabled:!1,arrowmarkup:'',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 c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigatebyimgclick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keycode?b.prev():39===a.keycode&&b.next()})}),w("updatestatus"+e,function(a,c){c.text&&(c.text=t(c.text,b.curritem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?t(c.tcounter,f.index,g):""}),w("buildcontrols"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowleft){var d=c.arrowmarkup,e=b.arrowleft=a(d.replace(/%title%/gi,c.tprev).replace(/%dir%/gi,"left")).addclass(s),f=b.arrowright=a(d.replace(/%title%/gi,c.tnext).replace(/%dir%/gi,"right")).addclass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadtimeout&&cleartimeout(b._preloadtimeout),b._preloadtimeout=settimeout(function(){b.preloadnearbyimages(),b._preloadtimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowright=b.arrowleft=null})):!1},next:function(){b.direction=!0,b.index=s(b.index+1),b.updateitemhtml()},prev:function(){b.direction=!1,b.index=s(b.index-1),b.updateitemhtml()},goto:function(a){b.direction=a>=b.index,b.index=a,b.updateitemhtml()},preloadnearbyimages:function(){var a,c=b.st.gallery.preload,d=math.min(c[0],b.items.length),e=math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloaditem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloaditem(b.index-a)},_preloaditem:function(c){if(c=s(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseel(c)),y("lazyload",d),"image"===d.type&&(d.img=a('').on("load.mfploader",function(){d.hassize=!0}).on("error.mfploader",function(){d.hassize=!0,d.loaderror=!0,y("lazyloaderror",d)}).attr("src",d.src)),d.preloaded=!0}}}});var u="retina";a.magnificpopup.registermodule(u,{options:{replacesrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initretina:function(){if(window.devicepixelratio>1){var a=b.st.retina,c=a.ratio;c=isnan(c)?c():c,c>1&&(w("imagehassize."+u,function(a,b){b.img.css({"max-width":b.img[0].naturalwidth/c,width:"100%"})}),w("elementparse."+u,function(b,d){d.src=a.replacesrc(d,c)}))}}}}),a()});