!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n:n(jQuery)}(function(n){function u(r){var u=r||window.event,h=[].slice.call(arguments,1),f=0,e=0,o=0,s=0,s=0;r=n.event.fix(u);r.type="mousewheel";u.wheelDelta&&(f=u.wheelDelta);u.detail&&(f=-1*u.detail);u.deltaY&&(f=o=-1*u.deltaY);u.deltaX&&(e=u.deltaX,f=-1*e);void 0!==u.wheelDeltaY&&(o=u.wheelDeltaY);void 0!==u.wheelDeltaX&&(e=-1*u.wheelDeltaX);s=Math.abs(f);(!i||s<i)&&(i=s);s=Math.max(Math.abs(o),Math.abs(e));(!t||s<t)&&(t=s);u=0<f?"floor":"ceil";f=Math[u](f/i);e=Math[u](e/t);o=Math[u](o/t);try{r.originalEvent.hasOwnProperty("wheelDelta")}catch(c){o=f}return h.unshift(r,f,e,o),(n.event.dispatch||n.event.handle).apply(this,h)}var i,t,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],f;if(n.event.fixHooks)for(f=e.length;f;)n.event.fixHooks[e[--f]]=n.event.mouseHooks;n.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var n=r.length;n;)this.addEventListener(r[--n],u,!1);else this.onmousewheel=u},teardown:function(){if(this.removeEventListener)for(var n=r.length;n;)this.removeEventListener(r[--n],u,!1);else this.onmousewheel=null}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})}),function(n,t,i,r){var p=i("html"),o=i(n),e=i(t),u=i.fancybox=function(){u.open.apply(this,arguments)},y=navigator.userAgent.match(/msie/i),v=null,s=t.createTouch!==r,a=function(n){return n&&n.hasOwnProperty&&n instanceof i},c=function(n){return n&&"string"===i.type(n)},l=function(n){return c(n)&&0<n.indexOf("%")},f=function(n,t){var i=parseInt(n,10)||0;return t&&l(n)&&(i*=u.getViewport()[t]/100),Math.ceil(i)},h=function(n,t){return f(n,t)+"px"};i.extend(u,{version:"2.1.7",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"><\/div><\/div><\/div><\/div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(y?' allowtransparency="true"':"")+"><\/iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.<\/p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"><\/a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span><\/span><\/a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span><\/span><\/a>',loading:'<div id="fancybox-loading"><div><\/div><\/div>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(n,t){if(n&&(i.isPlainObject(t)||(t={}),!1!==u.close(!0)))return i.isArray(n)||(n=a(n)?i(n).get():[n]),i.each(n,function(f,e){var s,y,l,o,v,h={};"object"===i.type(e)&&(e.nodeType&&(e=i(e)),a(e)?(h={href:e.data("fancybox-href")||e.attr("href"),title:i("<div/>").text(e.data("fancybox-title")||e.attr("title")||"").html(),isDom:!0,element:e},i.metadata&&i.extend(!0,h,e.metadata())):h=e);s=t.href||h.href||(c(e)?e:null);y=t.title!==r?t.title:h.title||"";o=(l=t.content||h.content)?"html":t.type||h.type;!o&&h.isDom&&(o=e.data("fancybox-type"),o||(o=(o=e.prop("class").match(/fancybox\.(\w+)/))?o[1]:null));c(s)&&(o||(u.isImage(s)?o="image":u.isSWF(s)?o="swf":"#"===s.charAt(0)?o="inline":c(e)&&(o="html",l=e)),"ajax"===o&&(v=s.split(/\s+/,2),s=v.shift(),v=v.shift()));l||("inline"===o?s?l=i(c(s)?s.replace(/.*(?=#[^\s]+$)/,""):s):h.isDom&&(l=e):"html"===o?l=s:o||s||!h.isDom||(o="inline",l=e));i.extend(h,{href:s,type:o,content:l,title:y,selector:v});n[f]=h}),u.opts=i.extend(!0,{},u.defaults,t),t.keys!==r&&(u.opts.keys=!!t.keys&&i.extend({},u.defaults.keys,t.keys)),u.group=n,u._start(u.opts.index)},cancel:function(){var n=u.coming;n&&!1===u.trigger("onCancel")||(u.hideLoading(),n&&(u.ajaxLoad&&u.ajaxLoad.abort(),u.ajaxLoad=null,u.imgPreload&&(u.imgPreload.onload=u.imgPreload.onerror=null),n.wrap&&n.wrap.stop(!0,!0).trigger("onReset").remove(),u.coming=null,u.current||u._afterZoomOut(n)))},close:function(n){u.cancel();!1!==u.trigger("beforeClose")&&(u.unbindEvents(),u.isActive&&(u.isOpen&&!0!==n?(u.isOpen=u.isOpened=!1,u.isClosing=!0,i(".fancybox-item, .fancybox-nav").remove(),u.wrap.stop(!0,!0).removeClass("fancybox-opened"),u.transitions[u.current.closeMethod]()):(i(".fancybox-wrap").stop(!0).trigger("onReset").remove(),u._afterZoomOut())))},play:function(n){var t=function(){clearTimeout(u.player.timer)},i=function(){t();u.current&&u.player.isActive&&(u.player.timer=setTimeout(u.next,u.current.playSpeed))},r=function(){t();e.unbind(".player");u.player.isActive=!1;u.trigger("onPlayEnd")};!0===n||!u.player.isActive&&!1!==n?u.current&&(u.current.loop||u.current.index<u.group.length-1)&&(u.player.isActive=!0,e.bind({"onCancel.player beforeClose.player":r,"onUpdate.player":i,"beforeLoad.player":t}),i(),u.trigger("onPlayStart")):r()},next:function(n){var t=u.current;t&&(c(n)||(n=t.direction.next),u.jumpto(t.index+1,n,"next"))},prev:function(n){var t=u.current;t&&(c(n)||(n=t.direction.prev),u.jumpto(t.index-1,n,"prev"))},jumpto:function(n,t,i){var e=u.current;e&&(n=f(n),u.direction=t||e.direction[n>=e.index?"next":"prev"],u.router=i||"jumpto",e.loop&&(0>n&&(n=e.group.length+n%e.group.length),n%=e.group.length),e.group[n]!==r&&(u.cancel(),u._start(n)))},reposition:function(n,t){var r,f=u.current,e=f?f.wrap:null;e&&(r=u._getPosition(t),n&&"scroll"===n.type?(delete r.position,e.stop(!0,!0).animate(r,200)):(e.css(r),f.pos=i.extend({},f.dim,r)))},update:function(n){var t=n&&n.originalEvent&&n.originalEvent.type,i=!t||"orientationchange"===t;i&&(clearTimeout(v),v=null);u.isOpen&&!v&&(v=setTimeout(function(){var r=u.current;r&&!u.isClosing&&(u.wrap.removeClass("fancybox-tmp"),(i||"load"===t||"resize"===t&&r.autoResize)&&u._setDimension(),"scroll"===t&&r.canShrink||u.reposition(n),u.trigger("onUpdate"),v=null)},i&&!s?0:300))},toggle:function(n){u.isOpen&&(u.current.fitToView="boolean"===i.type(n)?n:!u.current.fitToView,s&&(u.wrap.removeAttr("style").addClass("fancybox-tmp"),u.trigger("onUpdate")),u.update())},hideLoading:function(){e.unbind(".loading");i("#fancybox-loading").remove()},showLoading:function(){var t,n;u.hideLoading();t=i(u.opts.tpl.loading).click(u.cancel).appendTo("body");e.bind("keydown.loading",function(n){27===(n.which||n.keyCode)&&(n.preventDefault(),u.cancel())});u.defaults.fixed||(n=u.getViewport(),t.css({position:"absolute",top:.5*n.h+n.y,left:.5*n.w+n.x}));u.trigger("onLoading")},getViewport:function(){var i=u.current&&u.current.locked||!1,t={x:o.scrollLeft(),y:o.scrollTop()};return i&&i.length?(t.w=i[0].clientWidth,t.h=i[0].clientHeight):(t.w=s&&n.innerWidth?n.innerWidth:o.width(),t.h=s&&n.innerHeight?n.innerHeight:o.height()),t},unbindEvents:function(){u.wrap&&a(u.wrap)&&u.wrap.unbind(".fb");e.unbind(".fb");o.unbind(".fb")},bindEvents:function(){var t,n=u.current;n&&(o.bind("orientationchange.fb"+(s?"":" resize.fb")+(n.autoCenter&&!n.locked?" scroll.fb":""),u.update),(t=n.keys)&&e.bind("keydown.fb",function(f){var e=f.which||f.keyCode,o=f.target||f.srcElement;return(27!==e||!u.coming)&&void(f.ctrlKey||f.altKey||f.shiftKey||f.metaKey||o&&(o.type||i(o).is("[contenteditable]"))||i.each(t,function(t,o){return 1<n.group.length&&o[e]!==r?(u[t](o[e]),f.preventDefault(),!1):-1<i.inArray(e,o)?(u[t](),f.preventDefault(),!1):void 0}))}),i.fn.mousewheel&&n.mouseWheel&&u.wrap.bind("mousewheel.fb",function(t,r,f,e){for(var s=i(t.target||null),o=!1;s.length&&!(o||s.is(".fancybox-skin")||s.is(".fancybox-wrap"));)o=(o=s[0])&&!(o.style.overflow&&"hidden"===o.style.overflow)&&(o.clientWidth&&o.scrollWidth>o.clientWidth||o.clientHeight&&o.scrollHeight>o.clientHeight),s=i(s).parent();0!==r&&!o&&1<u.group.length&&!n.canShrink&&(0<e||0<f?u.prev(0<e?"down":"left"):(0>e||0>f)&&u.next(0>e?"up":"right"),t.preventDefault())}))},trigger:function(n,t){var f,r=t||u.coming||u.current;if(r){if(i.isFunction(r[n])&&(f=r[n].apply(r,Array.prototype.slice.call(arguments,1))),!1===f)return!1;r.helpers&&i.each(r.helpers,function(t,f){f&&u.helpers[t]&&i.isFunction(u.helpers[t][n])&&u.helpers[t][n](i.extend(!0,{},u.helpers[t].defaults,f),r)})}e.trigger(n)},isImage:function(n){return c(n)&&n.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(n){return c(n)&&n.match(/\.(swf)((\?|#).*)?$/i)},_start:function(n){var e,r,t={};if(n=f(n),e=u.group[n]||null,!e)return!1;if(t=i.extend(!0,{},u.opts,e),e=t.margin,r=t.padding,"number"===i.type(e)&&(t.margin=[e,e,e,e]),"number"===i.type(r)&&(t.padding=[r,r,r,r]),t.modal&&i.extend(!0,t,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),t.autoSize&&(t.autoWidth=t.autoHeight=!0),"auto"===t.width&&(t.autoWidth=!0),"auto"===t.height&&(t.autoHeight=!0),t.group=u.group,t.index=n,u.coming=t,!1===u.trigger("beforeLoad"))u.coming=null;else{if(r=t.type,e=t.href,!r)return u.coming=null,!(!u.current||!u.router||"jumpto"===u.router)&&(u.current.index=n,u[u.router](u.direction));if(u.isActive=!0,"image"!==r&&"swf"!==r||(t.autoHeight=t.autoWidth=!1,t.scrolling="visible"),"image"===r&&(t.aspectRatio=!0),"iframe"===r&&s&&(t.scrolling="scroll"),t.wrap=i(t.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+r+" fancybox-tmp "+t.wrapCSS).appendTo(t.parent||"body"),i.extend(t,{skin:i(".fancybox-skin",t.wrap),outer:i(".fancybox-outer",t.wrap),inner:i(".fancybox-inner",t.wrap)}),i.each(["Top","Right","Bottom","Left"],function(n,i){t.skin.css("padding"+i,h(t.padding[n]))}),u.trigger("onReady"),"inline"===r||"html"===r){if(!t.content||!t.content.length)return u._error("content")}else if(!e)return u._error("href");"image"===r?u._loadImage():"ajax"===r?u._loadAjax():"iframe"===r?u._loadIframe():u._afterLoad()}},_error:function(n){i.extend(u.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:n,content:u.coming.tpl.error});u._afterLoad()},_loadImage:function(){var n=u.imgPreload=new Image;n.onload=function(){this.onload=this.onerror=null;u.coming.width=this.width/u.opts.pixelRatio;u.coming.height=this.height/u.opts.pixelRatio;u._afterLoad()};n.onerror=function(){this.onload=this.onerror=null;u._error("image")};n.src=u.coming.href;!0!==n.complete&&u.showLoading()},_loadAjax:function(){var n=u.coming;u.showLoading();u.ajaxLoad=i.ajax(i.extend({},n.ajax,{url:n.href,error:function(n,t){u.coming&&"abort"!==t?u._error("ajax",n):u.hideLoading()},success:function(t,i){"success"===i&&(n.content=t,u._afterLoad())}}))},_loadIframe:function(){var n=u.coming,t=i(n.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":n.iframe.scrolling).attr("src",n.href);i(n.wrap).bind("onReset",function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(n){}});n.iframe.preload&&(u.showLoading(),t.one("load",function(){i(this).data("ready",1);s||i(this).bind("load.fb",u.update);i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();u._afterLoad()}));n.content=t.appendTo(n.inner);n.iframe.preload||u._afterLoad()},_preloadImages:function(){for(var n,r=u.group,i=u.current,f=r.length,e=i.preload?Math.min(i.preload,f-1):0,t=1;t<=e;t+=1)n=r[(i.index+t)%f],"image"===n.type&&n.href&&((new Image).src=n.href)},_afterLoad:function(){var t,s,f,e,o,n=u.coming,r=u.current;if(u.hideLoading(),n&&!1!==u.isActive)if(!1===u.trigger("afterLoad",n,r))n.wrap.stop(!0).trigger("onReset").remove(),u.coming=null;else{switch(r&&(u.trigger("beforeChange",r),r.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),u.unbindEvents(),t=n.content,s=n.type,f=n.scrolling,i.extend(u,{wrap:n.wrap,skin:n.skin,outer:n.outer,inner:n.inner,current:n,previous:r}),e=n.href,s){case"inline":case"ajax":case"html":n.selector?t=i("<div>").html(t).find(n.selector):a(t)&&(t.data("fancybox-placeholder")||t.data("fancybox-placeholder",i('<div class="fancybox-placeholder"><\/div>').insertAfter(t).hide()),t=t.show().detach(),n.wrap.bind("onReset",function(){i(this).find(t).length&&t.hide().replaceAll(t.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case"image":t=n.tpl.image.replace(/\{href\}/g,e);break;case"swf":t='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+e+'"><\/param>';o="";i.each(n.swf,function(n,i){t+='<param name="'+n+'" value="'+i+'"><\/param>';o+=" "+n+'="'+i+'"'});t+='<embed src="'+e+'" type="application/x-shockwave-flash" width="100%" height="100%"'+o+"><\/embed><\/object>"}a(t)&&t.parent().is(n.inner)||n.inner.append(t);u.trigger("beforeShow");n.inner.css("overflow","yes"===f?"scroll":"no"===f?"hidden":f);u._setDimension();u.reposition();u.isOpen=!1;u.coming=null;u.bindEvents();u.isOpened?r.prevMethod&&u.transitions[r.prevMethod]():i(".fancybox-wrap").not(n.wrap).stop(!0).trigger("onReset").remove();u.transitions[u.isOpened?n.nextMethod:n.openMethod]();u._preloadImages()}},_setDimension:function(){var n,o=u.getViewport(),et=0,p=u.wrap,nt=u.skin,e=u.inner,r=u.current;n=r.width;var ot,w,ut,d,b,tt,st,g,it,t=r.height,s=r.minWidth,c=r.minHeight,a=r.maxWidth,v=r.maxHeight,ht=r.scrolling,ft=r.scrollOutside?r.scrollbarWidth:0,y=r.margin,k=f(y[1]+y[3]),rt=f(y[0]+y[2]);if(p.add(nt).add(e).width("auto").height("auto").removeClass("fancybox-tmp"),y=f(nt.outerWidth(!0)-nt.width()),ot=f(nt.outerHeight(!0)-nt.height()),w=k+y,ut=rt+ot,d=l(n)?(o.w-w)*f(n)/100:n,b=l(t)?(o.h-ut)*f(t)/100:t,"iframe"===r.type){if(it=r.content,r.autoHeight&&it&&1===it.data("ready"))try{it[0].contentWindow.document.location&&(e.width(d).height(9999),tt=it.contents().find("body"),ft&&tt.css("overflow-x","hidden"),b=tt.outerHeight(!0))}catch(ct){}}else(r.autoWidth||r.autoHeight)&&(e.addClass("fancybox-tmp"),r.autoWidth||e.width(d),r.autoHeight||e.height(b),r.autoWidth&&(d=e.width()),r.autoHeight&&(b=e.height()),e.removeClass("fancybox-tmp"));if(n=f(d),t=f(b),g=d/b,s=f(l(s)?f(s,"w")-w:s),a=f(l(a)?f(a,"w")-w:a),c=f(l(c)?f(c,"h")-ut:c),v=f(l(v)?f(v,"h")-ut:v),tt=a,st=v,r.fitToView&&(a=Math.min(o.w-w,a),v=Math.min(o.h-ut,v)),w=o.w-k,rt=o.h-rt,r.aspectRatio?(n>a&&(n=a,t=f(n/g)),t>v&&(t=v,n=f(t*g)),n<s&&(n=s,t=f(n/g)),t<c&&(t=c,n=f(t*g))):(n=Math.max(s,Math.min(n,a)),r.autoHeight&&"iframe"!==r.type&&(e.width(n),t=e.height()),t=Math.max(c,Math.min(t,v))),r.fitToView)if(e.width(n).height(t),p.width(n+y),o=p.width(),k=p.height(),r.aspectRatio)for(;(o>w||k>rt)&&n>s&&t>c&&!(19<et++);)t=Math.max(c,Math.min(v,t-10)),n=f(t*g),n<s&&(n=s,t=f(n/g)),n>a&&(n=a,t=f(n/g)),e.width(n).height(t),p.width(n+y),o=p.width(),k=p.height();else n=Math.max(s,Math.min(n,n-(o-w))),t=Math.max(c,Math.min(t,t-(k-rt)));ft&&"auto"===ht&&t<b&&n+y+ft<w&&(n+=ft);e.width(n).height(t);p.width(n+y);o=p.width();k=p.height();et=(o>w||k>rt)&&n>s&&t>c;n=r.aspectRatio?n<tt&&t<st&&n<d&&t<b:(n<tt||t<st)&&(n<d||t<b);i.extend(r,{dim:{width:h(o),height:h(k)},origWidth:d,origHeight:b,canShrink:et,canExpand:n,wPadding:y,hPadding:ot,wrapSpace:k-nt.outerHeight(!0),skinSpace:nt.height()-t});!it&&r.autoHeight&&t>c&&t<v&&!n&&e.height("auto")},_getPosition:function(n){var i=u.current,r=u.getViewport(),t=i.margin,f=u.wrap.width()+t[1]+t[3],e=u.wrap.height()+t[0]+t[2],t={position:"absolute",top:t[0],left:t[3]};return i.autoCenter&&i.fixed&&!n&&e<=r.h&&f<=r.w?t.position="fixed":i.locked||(t.top+=r.y,t.left+=r.x),t.top=h(Math.max(t.top,t.top+(r.h-e)*i.topRatio)),t.left=h(Math.max(t.left,t.left+(r.w-f)*i.leftRatio)),t},_afterZoomIn:function(){var n=u.current;n&&(u.isOpen=u.isOpened=!0,u.wrap.css("overflow","visible").addClass("fancybox-opened").hide().show(0),u.update(),(n.closeClick||n.nextClick&&1<u.group.length)&&u.inner.css("cursor","pointer").bind("click.fb",function(t){i(t.target).is("a")||i(t.target).parent().is("a")||(t.preventDefault(),u[n.closeClick?"close":"next"]())}),n.closeBtn&&i(n.tpl.closeBtn).appendTo(u.skin).bind("click.fb",function(n){n.preventDefault();u.close()}),n.arrows&&1<u.group.length&&((n.loop||0<n.index)&&i(n.tpl.prev).appendTo(u.outer).bind("click.fb",u.prev),(n.loop||n.index<u.group.length-1)&&i(n.tpl.next).appendTo(u.outer).bind("click.fb",u.next)),u.trigger("afterShow"),n.loop||n.index!==n.group.length-1?u.opts.autoPlay&&!u.player.isActive&&(u.opts.autoPlay=!1,u.play(!0)):u.play(!1))},_afterZoomOut:function(n){n=n||u.current;i(".fancybox-wrap").trigger("onReset").remove();i.extend(u,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});u.trigger("afterClose",n)}});u.transitions={getOrigPosition:function(){var n=u.current,f=n.element,t=n.orig,i={},e=50,o=50,s=n.hPadding,c=n.wPadding,r=u.getViewport();return!t&&n.isDom&&f.is(":visible")&&(t=f.find("img:first"),t.length||(t=f)),a(t)?(i=t.offset(),t.is("img")&&(e=t.outerWidth(),o=t.outerHeight())):(i.top=r.y+(r.h-o)*n.topRatio,i.left=r.x+(r.w-e)*n.leftRatio),("fixed"===u.wrap.css("position")||n.locked)&&(i.top-=r.y,i.left-=r.x),i={top:h(i.top-s*n.topRatio),left:h(i.left-c*n.leftRatio),width:h(e+c),height:h(o+s)}},step:function(n,t){var e,i,r=t.prop,o,s;i=u.current;o=i.wrapSpace;s=i.skinSpace;"width"!==r&&"height"!==r||(e=t.end===t.start?1:(n-t.start)/(t.end-t.start),u.isClosing&&(e=1-e),i="width"===r?i.wPadding:i.hPadding,i=n-i,u.skin[r](f("width"===r?i:i-o*e)),u.inner[r](f("width"===r?i:i-o*e-s*e)))},zoomIn:function(){var n=u.current,t=n.pos,r=n.openEffect,f="elastic"===r,e=i.extend({opacity:1},t);delete e.position;f?(t=this.getOrigPosition(),n.openOpacity&&(t.opacity=.1)):"fade"===r&&(t.opacity=.1);u.wrap.css(t).animate(e,{duration:"none"===r?0:n.openSpeed,easing:n.openEasing,step:f?this.step:null,complete:u._afterZoomIn})},zoomOut:function(){var n=u.current,i=n.closeEffect,r="elastic"===i,t={opacity:.1};r&&(t=this.getOrigPosition(),n.closeOpacity&&(t.opacity=.1));u.wrap.animate(t,{duration:"none"===i?0:n.closeSpeed,easing:n.closeEasing,step:r?this.step:null,complete:u._afterZoomOut})},changeIn:function(){var n,i=u.current,o=i.nextEffect,t=i.pos,e={opacity:1},r=u.direction;t.opacity=.1;"elastic"===o&&(n="down"===r||"up"===r?"top":"left","down"===r||"right"===r?(t[n]=h(f(t[n])-200),e[n]="+=200px"):(t[n]=h(f(t[n])+200),e[n]="-=200px"));"none"===o?u._afterZoomIn():u.wrap.css(t).animate(e,{duration:i.nextSpeed,easing:i.nextEasing,complete:u._afterZoomIn})},changeOut:function(){var n=u.previous,r=n.prevEffect,f={opacity:.1},t=u.direction;"elastic"===r&&(f["down"===t||"up"===t?"top":"left"]=("up"===t||"left"===t?"-":"+")+"=200px");n.wrap.animate(f,{duration:"none"===r?0:n.prevSpeed,easing:n.prevEasing,complete:function(){i(this).trigger("onReset").remove()}})}};u.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:i("html"),create:function(n){var t;n=i.extend({},this.defaults,n);this.overlay&&this.close();t=u.coming?u.coming.parent:n.parent;this.overlay=i('<div class="fancybox-overlay"><\/div>').appendTo(t&&t.length?t:"body");this.fixed=!1;n.fixed&&u.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(n){var t=this;n=i.extend({},this.defaults,n);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(n);this.fixed||(o.bind("resize.overlay",i.proxy(this.update,this)),this.update());n.closeClick&&this.overlay.bind("click.overlay",function(n){if(i(n.target).hasClass("fancybox-overlay"))return u.isActive?u.close():t.close(),!1});this.overlay.css(n.css).show()},close:function(){o.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(i(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),o.scrollTop(this.scrollV).scrollLeft(this.scrollH));i(".fancybox-overlay").remove().hide();i.extend(this,{overlay:null,fixed:!1})},update:function(){var i,n="100%";this.overlay.width(n).height("100%");y?(i=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),e.width()>i&&(n=e.width())):e.width()>o.width()&&(n=e.width());this.overlay.width(n).height(e.height())},onReady:function(n,t){var r=this.overlay;i(".fancybox-overlay").stop(!0,!0);r||this.create(n);n.locked&&this.fixed&&t.fixed&&(t.locked=this.overlay.append(t.wrap),t.fixed=!1);!0===n.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(n,t){t.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&i("*:not(object)").filter(function(){return"fixed"===i(this).css("position")&&!i(this).hasClass("fancybox-overlay")&&!i(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=o.scrollTop(),this.scrollH=o.scrollLeft(),this.el.addClass("fancybox-lock"),o.scrollTop(this.scrollV).scrollLeft(this.scrollH));this.open(n)},onUpdate:function(){this.fixed||this.update()},afterClose:function(n){this.overlay&&!u.coming&&this.overlay.fadeOut(n.speedOut,i.proxy(this.close,this))}};u.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(n){var t=u.current,e=t.title,r=n.type;if(i.isFunction(e)&&(e=e.call(t.element,t)),c(e)&&""!==i.trim(e)){switch(t=i('<div class="fancybox-title fancybox-title-'+r+'-wrap">'+e+"<\/div>"),r){case"inside":r=u.skin;break;case"outside":r=u.wrap;break;case"over":r=u.inner;break;default:r=u.skin;t.appendTo("body");y&&t.width(t.width());t.wrapInner('<span class="child"><\/span>');u.current.margin[2]+=Math.abs(f(t.css("margin-bottom")))}t["top"===n.position?"prependTo":"appendTo"](r)}}};i.fn.fancybox=function(n){var r,f=i(this),t=this.selector||"",o=function(e){var h,s,o=i(this).blur(),c=r;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||o.is(".fancybox-wrap")||(h=n.groupAttr||"data-fancybox-group",s=o.attr(h),s||(h="rel",s=o.get(0)[h]),s&&""!==s&&"nofollow"!==s&&(o=t.length?i(t):f,o=o.filter("["+h+'="'+s+'"]'),c=o.index(this)),n.index=c,!1!==u.open(o,n)&&e.preventDefault())};return n=n||{},r=n.index||0,t&&!1!==n.live?e.undelegate(t,"click.fb-start").delegate(t+":not('.fancybox-item, .fancybox-nav')","click.fb-start",o):f.unbind("click.fb-start").bind("click.fb-start",o),this.filter("[data-fancybox-start=1]").trigger("click"),this};e.ready(function(){var t,f;i.scrollbarWidth===r&&(i.scrollbarWidth=function(){var t=i('<div style="width:50px;height:50px;overflow:auto"><div/><\/div>').appendTo("body"),n=t.children(),n=n.innerWidth()-n.height(99).innerWidth();return t.remove(),n});i.support.fixedPosition===r&&(i.support.fixedPosition=function(){var n=i('<div style="position:fixed;top:20px;"><\/div>').appendTo("body"),t=20===n[0].offsetTop||15===n[0].offsetTop;return n.remove(),t}());i.extend(u.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")});t=i(n).width();p.addClass("fancybox-lock-test");f=i(n).width();p.removeClass("fancybox-lock-test");i("<style type='text/css'>.fancybox-margin{margin-right:"+(f-t)+"px;}<\/style>").appendTo("head")})}(window,document,jQuery),function(n){var t=n.fancybox;t.helpers.buttons={defaults:{skipSingle:!1,position:"top",tpl:'<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"><\/a><\/li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"><\/a><\/li><li><a class="btnNext" title="Next" href="javascript:;"><\/a><\/li><li><a class="btnToggle" title="Toggle size" href="javascript:;"><\/a><\/li><li><a class="btnClose" title="Close" href="javascript:;"><\/a><\/li><\/ul><\/div>'},list:null,buttons:null,beforeLoad:function(n,t){return n.skipSingle&&t.group.length<2?(t.helpers.buttons=!1,void(t.closeBtn=!0)):void(t.margin["bottom"===n.position?2:0]+=30)},onPlayStart:function(){this.buttons&&this.buttons.play.attr("title","Pause slideshow").addClass("btnPlayOn")},onPlayEnd:function(){this.buttons&&this.buttons.play.attr("title","Start slideshow").removeClass("btnPlayOn")},afterShow:function(i,r){var u=this.buttons;u||(this.list=n(i.tpl).addClass(i.position).appendTo("body"),u={prev:this.list.find(".btnPrev").click(t.prev),next:this.list.find(".btnNext").click(t.next),play:this.list.find(".btnPlay").click(t.play),toggle:this.list.find(".btnToggle").click(t.toggle),close:this.list.find(".btnClose").click(t.close)});r.index>0||r.loop?u.prev.removeClass("btnDisabled"):u.prev.addClass("btnDisabled");r.loop||r.index<r.group.length-1?(u.next.removeClass("btnDisabled"),u.play.removeClass("btnDisabled")):(u.next.addClass("btnDisabled"),u.play.addClass("btnDisabled"));this.buttons=u;this.onUpdate(i,r)},onUpdate:function(n,t){var i;this.buttons&&(i=this.buttons.toggle.removeClass("btnDisabled btnToggleOn"),t.canShrink?i.addClass("btnToggleOn"):t.canExpand||i.addClass("btnDisabled"))},beforeClose:function(){this.list&&this.list.remove();this.list=null;this.buttons=null}}}(jQuery),function(n){var t=n.fancybox;t.helpers.thumbs={defaults:{width:50,height:50,position:"bottom",source:function(t){var i;return t.element&&(i=n(t.element).find("img").attr("src")),!i&&"image"===t.type&&t.href&&(i=t.href),i}},wrap:null,list:null,width:0,init:function(t,i){for(var o=this,r=t.width,u=t.height,s=t.source,e="",f=0;f<i.group.length;f++)e+='<li><a style="width:'+r+"px;height:"+u+'px;" href="javascript:jQuery.fancybox.jumpto('+f+');"><\/a><\/li>';this.wrap=n('<div id="fancybox-thumbs"><\/div>').addClass(t.position).appendTo("body");this.list=n("<ul>"+e+"<\/ul>").appendTo(this.wrap);n.each(i.group,function(t){var f=i.group[t],e=s(f);e&&n("<img />").on("load",function(){var e,s,h,i=this.width,f=this.height;o.list&&i&&f&&(e=i/r,s=f/u,h=o.list.children().eq(t).find("a"),e>=1&&s>=1&&(e>s?(i=Math.floor(i/s),f=u):(i=r,f=Math.floor(f/e))),n(this).css({width:i,height:f,top:Math.floor(u/2-f/2),left:Math.floor(r/2-i/2)}),h.width(r).height(u),n(this).hide().appendTo(h).fadeIn(300))}).attr("src",e).attr("title",f.title)});this.width=this.list.children().eq(0).outerWidth(!0);this.list.width(this.width*(i.group.length+1)).css("left",Math.floor(.5*n(window).width()-(i.index*this.width+.5*this.width)))},beforeLoad:function(n,t){return t.group.length<2?void(t.helpers.thumbs=!1):void(t.margin["top"===n.position?0:2]+=n.height+15)},afterShow:function(n,t){this.list?this.onUpdate(n,t):this.init(n,t);this.list.children().removeClass("active").eq(t.index).addClass("active")},onUpdate:function(t,i){this.list&&this.list.stop(!0).animate({left:Math.floor(.5*n(window).width()-(i.index*this.width+.5*this.width))},150)},beforeClose:function(){this.wrap&&this.wrap.remove();this.wrap=null;this.list=null;this.width=0}}}(jQuery),function(n){"use strict";var t=n.fancybox,i=function(t,i,r){return r=r||"","object"===n.type(r)&&(r=n.param(r,!0)),n.each(i,function(n,i){t=t.replace("$"+n,i||"")}),r.length&&(t+=(t.indexOf("?")>0?"&":"?")+r),t};t.helpers.media={defaults:{youtube:{matcher:/(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"opaque",enablejsapi:1,ps:"docs",controls:1},type:"iframe",url:"//www.youtube.com/embed/$3"},vimeo:{matcher:/(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},type:"iframe",url:"//player.vimeo.com/video/$1"},metacafe:{matcher:/metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,params:{autoPlay:"yes"},type:"swf",url:function(t,i,r){return r.swf.flashVars="playerVars="+n.param(i,!0),"//www.metacafe.com/fplayer/"+t[1]+"/.swf"}},dailymotion:{matcher:/dailymotion.com\/video\/(.*)\/?(.*)/,params:{additionalInfos:0,autoStart:1},type:"swf",url:"//www.dailymotion.com/swf/video/$1"},twitvid:{matcher:/twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,params:{autoplay:0},type:"iframe",url:"//www.twitvid.com/embed.php?guid=$1"},twitpic:{matcher:/twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,type:"image",url:"//twitpic.com/show/full/$1/"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},google_maps:{matcher:/maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,type:"iframe",url:function(n){return"//maps.google."+n[1]+"/"+n[3]+n[4]+"&output="+(n[4].indexOf("layer=c")>0?"svembed":"embed")}}},beforeLoad:function(t,r){var f,u,e,o,s=r.href||"",h=!1;for(f in t)if(t.hasOwnProperty(f)&&(u=t[f],e=s.match(u.matcher))){h=u.type;o=n.extend(!0,{},u.params,r[f]||(n.isPlainObject(t[f])?t[f].params:null));s="function"===n.type(u.url)?u.url.call(this,e,o,r):i(u.url,e,o);break}h&&(r.href=s,r.type=h,r.autoHeight=!1)}}}(jQuery),function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n:n(jQuery)}(function(n){function u(i){var u=i||window.event,h=[].slice.call(arguments,1),f=0,e=0,o=0,s=0,s=0;i=n.event.fix(u);i.type="mousewheel";u.wheelDelta&&(f=u.wheelDelta);u.detail&&(f=-1*u.detail);u.deltaY&&(f=o=-1*u.deltaY);u.deltaX&&(e=u.deltaX,f=-1*e);void 0!==u.wheelDeltaY&&(o=u.wheelDeltaY);void 0!==u.wheelDeltaX&&(e=-1*u.wheelDeltaX);s=Math.abs(f);(!r||s<r)&&(r=s);s=Math.max(Math.abs(o),Math.abs(e));(!t||s<t)&&(t=s);u=0<f?"floor":"ceil";f=Math[u](f/r);e=Math[u](e/t);o=Math[u](o/t);try{i.originalEvent.hasOwnProperty("wheelDelta")}catch(c){o=f}return h.unshift(i,f,e,o),(n.event.dispatch||n.event.handle).apply(this,h)}var e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],r,t,f;if(n.event.fixHooks)for(f=e.length;f;)n.event.fixHooks[e[--f]]=n.event.mouseHooks;n.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var n=i.length;n;)this.addEventListener(i[--n],u,!1);else this.onmousewheel=u},teardown:function(){if(this.removeEventListener)for(var n=i.length;n;)this.removeEventListener(i[--n],u,!1);else this.onmousewheel=null}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})})