OwlCyberSecurity - MANAGER
Edit File: jquery.fancybox.pack.js
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(l){function t(e){var t=e||window.event,i=[].slice.call(arguments,1),o=0,n=0,a=0,r=0,r=0;(e=l.event.fix(t)).type="mousewheel",t.wheelDelta&&(o=t.wheelDelta),t.detail&&(o=-1*t.detail),t.deltaY&&(o=a=-1*t.deltaY),t.deltaX&&(o=-1*(n=t.deltaX)),void 0!==t.wheelDeltaY&&(a=t.wheelDeltaY),void 0!==t.wheelDeltaX&&(n=-1*t.wheelDeltaX),r=Math.abs(o),(!s||r<s)&&(s=r),r=Math.max(Math.abs(a),Math.abs(n)),(!c||r<c)&&(c=r),t=0<o?"floor":"ceil",o=Math[t](o/s),n=Math[t](n/c),a=Math[t](a/c);try{e.originalEvent.hasOwnProperty("wheelDelta")}catch(e){a=o}return i.unshift(e,o,n,a),(l.event.dispatch||l.event.handle).apply(this,i)}var s,c,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"];if(l.event.fixHooks)for(var o=e.length;o;)l.event.fixHooks[e[--o]]=l.event.mouseHooks;l.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=i.length;e;)this.addEventListener(i[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=i.length;e;)this.removeEventListener(i[--e],t,!1);else this.onmousewheel=null}},l.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),function(i,r,_,p){"use strict";function f(e){return e&&e.hasOwnProperty&&e instanceof _}function E(e){return d(e)&&0<e.indexOf("%")}function L(e,t){var i=parseInt(e,10)||0;return t&&E(e)&&(i=D.getViewport()[t]/100*i),Math.ceil(i)}function W(e,t){return L(e,t)+"px"}var l=_("html"),o=_(i),n=_(r),D=_.fancybox=function(){D.open.apply(this,arguments)},s=navigator.userAgent.match(/msie/i),c=null,a=r.createTouch!==p,d=function(e){return e&&"string"==typeof e};_.extend(D,{version:"2.1.9",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:!a,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'+(s?' 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:_.noop,beforeLoad:_.noop,afterLoad:_.noop,beforeShow:_.noop,afterShow:_.noop,beforeChange:_.noop,beforeClose:_.noop,afterClose:_.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(c,h){if(c&&(_.isPlainObject(h)||(h={}),!1!==D.close(!0)))return Array.isArray(c)||(c=f(c)?_(c).get():[c]),_.each(c,function(e,t){var i,o,n,a,r,l,s={};"object"==typeof t&&null!==s&&(t.nodeType&&(t=_(t)),f(t)?(s={href:t.data("fancybox-href")||t.attr("href"),title:_("<div/>").text(t.data("fancybox-title")||t.attr("title")||"").html(),isDom:!0,element:t},_.metadata&&_.extend(!0,s,t.metadata())):s=t),i=h.href||s.href||(d(t)?t:null),o=h.title!==p?h.title:s.title||"",!(a=(n=h.content||s.content)?"html":h.type||s.type)&&s.isDom&&(a=(a=t.data("fancybox-type"))||((r=t.prop("class").match(/fancybox\.(\w+)/))?r[1]:null)),d(i)&&(a||(D.isImage(i)?a="image":D.isSWF(i)?a="swf":"#"===i.charAt(0)?a="inline":d(t)&&(a="html",n=t)),"ajax"===a&&(i=(r=i.split(/\s+/,2)).shift(),l=r.shift())),n||("inline"===a?i?n=_(d(i)?i.replace(/.*(?=#[^\s]+$)/,""):i):s.isDom&&(n=t):"html"===a?n=i:a||i||!s.isDom||(a="inline",n=t)),_.extend(s,{href:i,type:a,content:n,title:o,selector:l}),c[e]=s}),D.opts=_.extend(!0,{},D.defaults,h),h.keys!==p&&(D.opts.keys=!!h.keys&&_.extend({},D.defaults.keys,h.keys)),D.group=c,D._start(D.opts.index)},cancel:function(){var e=D.coming;e&&!1===D.trigger("onCancel")||(D.hideLoading(),e&&(D.ajaxLoad&&D.ajaxLoad.abort(),D.ajaxLoad=null,D.imgPreload&&(D.imgPreload.onload=D.imgPreload.onerror=null),e.wrap&&e.wrap.stop(!0,!0).trigger("onReset").remove(),D.coming=null,D.current||D._afterZoomOut(e)))},close:function(e){D.cancel(),!1!==D.trigger("beforeClose")&&(D.unbindEvents(),D.isActive&&(D.isOpen&&!0!==e?(D.isOpen=D.isOpened=!1,D.isClosing=!0,_(".fancybox-item, .fancybox-nav").remove(),D.wrap.stop(!0,!0).removeClass("fancybox-opened"),D.transitions[D.current.closeMethod]()):(_(".fancybox-wrap").stop(!0).trigger("onReset").remove(),D._afterZoomOut())))},play:function(e){function t(){o(),D.current&&D.player.isActive&&(D.player.timer=setTimeout(D.next,D.current.playSpeed))}function i(){o(),n.off(".player"),D.player.isActive=!1,D.trigger("onPlayEnd")}var o=function(){clearTimeout(D.player.timer)};!0===e||!D.player.isActive&&!1!==e?D.current&&(D.current.loop||D.current.index<D.group.length-1)&&(D.player.isActive=!0,n.on({"onCancel.player beforeClose.player":i,"onUpdate.player":t,"beforeLoad.player":o}),t(),D.trigger("onPlayStart")):i()},next:function(e){var t=D.current;t&&(d(e)||(e=t.direction.next),D.jumpto(t.index+1,e,"next"))},prev:function(e){var t=D.current;t&&(d(e)||(e=t.direction.prev),D.jumpto(t.index-1,e,"prev"))},jumpto:function(e,t,i){var o=D.current;o&&(e=L(e),D.direction=t||o.direction[e>=o.index?"next":"prev"],D.router=i||"jumpto",o.loop&&(e<0&&(e=o.group.length+e%o.group.length),e%=o.group.length),o.group[e]!==p&&(D.cancel(),D._start(e)))},reposition:function(e,t){var i=D.current,o=i?i.wrap:null;o&&(t=D._getPosition(t),e&&"scroll"===e.type?(delete t.position,o.stop(!0,!0).animate(t,200)):(o.css(t),i.pos=_.extend({},i.dim,t)))},update:function(t){var i=t&&t.originalEvent&&t.originalEvent.type,o=!i||"orientationchange"===i;o&&(clearTimeout(c),c=null),D.isOpen&&!c&&(c=setTimeout(function(){var e=D.current;e&&!D.isClosing&&(D.wrap.removeClass("fancybox-tmp"),(o||"load"===i||"resize"===i&&e.autoResize)&&D._setDimension(),"scroll"===i&&e.canShrink||D.reposition(t),D.trigger("onUpdate"),c=null)},o&&!a?0:300))},toggle:function(e){D.isOpen&&(D.current.fitToView="boolean"==typeof e?e:!D.current.fitToView,a&&(D.wrap.removeAttr("style").addClass("fancybox-tmp"),D.trigger("onUpdate")),D.update())},hideLoading:function(){n.off(".loading"),_("#fancybox-loading").remove()},showLoading:function(){var e,t;D.hideLoading(),e=_(D.opts.tpl.loading).on("click",D.cancel).appendTo("body"),n.on("keydown.loading",function(e){27===e.which&&(e.preventDefault(),D.cancel())}),D.defaults.fixed||(t=D.getViewport(),e.css({position:"absolute",top:.5*t.h+t.y,left:.5*t.w+t.x})),D.trigger("onLoading")},getViewport:function(){var e=D.current&&D.current.locked||!1,t={x:o.scrollLeft(),y:o.scrollTop()};return e&&e.length?(t.w=e[0].clientWidth,t.h=e[0].clientHeight):(t.w=a&&i.innerWidth?i.innerWidth:o.width(),t.h=a&&i.innerHeight?i.innerHeight:o.height()),t},unbindEvents:function(){D.wrap&&f(D.wrap)&&D.wrap.off(".fb"),n.off(".fb"),o.off(".fb")},bindEvents:function(){var t,s=D.current;s&&(o.on("orientationchange.fb"+(a?"":" resize.fb")+(s.autoCenter&&!s.locked?" scroll.fb":""),D.update),(t=s.keys)&&n.on("keydown.fb",function(i){var o=i.which||i.keyCode,e=i.target||i.srcElement;if(27===o&&D.coming)return!1;i.ctrlKey||i.altKey||i.shiftKey||i.metaKey||e&&(e.type||_(e).is("[contenteditable]"))||_.each(t,function(e,t){return 1<s.group.length&&t[o]!==p?(D[e](t[o]),i.preventDefault(),!1):-1<_.inArray(o,t)?(D[e](),i.preventDefault(),!1):void 0})}),_.fn.mousewheel&&s.mouseWheel&&D.wrap.on("mousewheel.fb",function(e,t,i,o){for(var n,a=e.target||null,r=_(a),l=!1;r.length&&!(l||r.is(".fancybox-skin")||r.is(".fancybox-wrap"));)l=(n=r[0])&&!(n.style.overflow&&"hidden"===n.style.overflow)&&(n.clientWidth&&n.scrollWidth>n.clientWidth||n.clientHeight&&n.scrollHeight>n.clientHeight),r=_(r).parent();0===t||l||1<D.group.length&&!s.canShrink&&(0<o||0<i?D.prev(0<o?"down":"left"):(o<0||i<0)&&D.next(o<0?"up":"right"),e.preventDefault())}))},trigger:function(i,e){var t,o=e||D.coming||D.current;if(o){if(!1===(t="function"==typeof o[i]?o[i].apply(o,Array.prototype.slice.call(arguments,1)):t))return!1;o.helpers&&_.each(o.helpers,function(e,t){t&&D.helpers[e]&&"function"==typeof D.helpers[e][i]&&D.helpers[e][i](_.extend(!0,{},D.helpers[e].defaults,t),o)})}n.trigger(i)},isImage:function(e){return d(e)&&e.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(e){return d(e)&&e.match(/\.(swf)((\?|#).*)?$/i)},_start:function(e){var t,i,o={};if(e=L(e),!(t=D.group[e]||null))return!1;if(t=(o=_.extend(!0,{},D.opts,t)).margin,i=o.padding,"number"==typeof t&&(o.margin=[t,t,t,t]),"number"==typeof i&&(o.padding=[i,i,i,i]),o.modal&&_.extend(!0,o,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),o.autoSize&&(o.autoWidth=o.autoHeight=!0),"auto"===o.width&&(o.autoWidth=!0),"auto"===o.height&&(o.autoHeight=!0),o.group=D.group,o.index=e,D.coming=o,!1!==D.trigger("beforeLoad")){if(t=o.type,i=o.href,!t)return D.coming=null,!(!D.current||!D.router||"jumpto"===D.router)&&(D.current.index=e,D[D.router](D.direction));if(D.isActive=!0,"image"!==t&&"swf"!==t||(o.autoHeight=o.autoWidth=!1,o.scrolling="visible"),"image"===t&&(o.aspectRatio=!0),"iframe"===t&&a&&(o.scrolling="scroll"),o.wrap=_(o.tpl.wrap).addClass("fancybox-"+(a?"mobile":"desktop")+" fancybox-type-"+t+" fancybox-tmp "+o.wrapCSS).appendTo(o.parent||"body"),_.extend(o,{skin:_(".fancybox-skin",o.wrap),outer:_(".fancybox-outer",o.wrap),inner:_(".fancybox-inner",o.wrap)}),_.each(["Top","Right","Bottom","Left"],function(e,t){o.skin.css("padding"+t,W(o.padding[e]))}),D.trigger("onReady"),"inline"===t||"html"===t){if(!o.content||!o.content.length)return D._error("content")}else if(!i)return D._error("href");"image"===t?D._loadImage():"ajax"===t?D._loadAjax():"iframe"===t?D._loadIframe():D._afterLoad()}else D.coming=null},_error:function(e){_.extend(D.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:e,content:D.coming.tpl.error}),D._afterLoad()},_loadImage:function(){var e=D.imgPreload=new Image;e.onload=function(){this.onload=this.onerror=null,D.coming.width=this.width/D.opts.pixelRatio,D.coming.height=this.height/D.opts.pixelRatio,D._afterLoad()},e.onerror=function(){this.onload=this.onerror=null,D._error("image")},e.src=D.coming.href,!0!==e.complete&&D.showLoading()},_loadAjax:function(){var i=D.coming;D.showLoading(),D.ajaxLoad=_.ajax(_.extend({},i.ajax,{url:i.href,error:function(e,t){D.coming&&"abort"!==t?D._error("ajax",e):D.hideLoading()},success:function(e,t){"success"===t&&(i.content=e,D._afterLoad())}}))},_loadIframe:function(){var e=D.coming,t=_(e.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",a?"auto":e.iframe.scrolling).attr("src",e.href);_(e.wrap).on("onReset",function(){try{_(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(e){}}),e.iframe.preload&&(D.showLoading(),t.one("load",function(){_(this).data("ready",1),a||_(this).on("load.fb",D.update),_(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),D._afterLoad()})),e.content=t.appendTo(e.inner),e.iframe.preload||D._afterLoad()},_preloadImages:function(){for(var e,t=D.group,i=D.current,o=t.length,n=i.preload?Math.min(i.preload,o-1):0,a=1;a<=n;a+=1)"image"===(e=t[(i.index+a)%o]).type&&e.href&&((new Image).src=e.href)},_afterLoad:function(){var e,i,t,o,n,a=D.coming,r=D.current,l="fancybox-placeholder";if(D.hideLoading(),a&&!1!==D.isActive){if(!1===D.trigger("afterLoad",a,r))return a.wrap.stop(!0).trigger("onReset").remove(),void(D.coming=null);switch(r&&(D.trigger("beforeChange",r),r.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),D.unbindEvents(),i=(e=a).content,t=a.type,a=a.scrolling,_.extend(D,{wrap:e.wrap,skin:e.skin,outer:e.outer,inner:e.inner,current:e,previous:r}),o=e.href,t){case"inline":case"ajax":case"html":e.selector?i=_("<div>").html(i).find(e.selector):f(i)&&(i.data(l)||i.data(l,_('<div class="'+l+'"></div>').insertAfter(i).hide()),i=i.show().detach(),e.wrap.on("onReset",function(){_(this).find(i).length&&i.hide().replaceAll(i.data(l)).data(l,!1)}));break;case"image":i=e.tpl.image.replace(/\{href\}/g,o);break;case"swf":i='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+o+'"></param>',n="",_.each(e.swf,function(e,t){i+='<param name="'+e+'" value="'+t+'"></param>',n+=" "+e+'="'+t+'"'}),i+='<embed src="'+o+'" type="application/x-shockwave-flash" width="100%" height="100%"'+n+"></embed></object>"}f(i)&&i.parent().is(e.inner)||e.inner.append(i),D.trigger("beforeShow"),e.inner.css("overflow","yes"===a?"scroll":"no"===a?"hidden":a),D._setDimension(),D.reposition(),D.isOpen=!1,D.coming=null,D.bindEvents(),D.isOpened?r.prevMethod&&D.transitions[r.prevMethod]():_(".fancybox-wrap").not(e.wrap).stop(!0).trigger("onReset").remove(),D.transitions[D.isOpened?e.nextMethod:e.openMethod](),D._preloadImages()}},_setDimension:function(){var h,d,p,f,u,e,g,m,y,w,v,b,x,k,C=D.getViewport(),M=0,t=D.wrap,S=D.skin,i=D.inner,o=D.current,n=o.width,a=o.height,r=o.minWidth,l=o.minHeight,s=o.maxWidth,c=o.maxHeight,O=o.scrolling,j=o.scrollOutside?o.scrollbarWidth:0,T=o.margin,P=L(T[1]+T[3]),T=L(T[0]+T[2]);if(t.add(S).add(i).width("auto").height("auto").removeClass("fancybox-tmp"),p=P+(h=L(S.outerWidth(!0)-S.width())),f=T+(d=L(S.outerHeight(!0)-S.height())),u=E(n)?(C.w-p)*L(n)/100:n,e=E(a)?(C.h-f)*L(a)/100:a,"iframe"===o.type){if(x=o.content,o.autoHeight&&x&&1===x.data("ready"))try{x[0].contentWindow.document.location&&(i.width(u).height(9999),k=x.contents().find("body"),j&&k.css("overflow-x","hidden"),e=k.outerHeight(!0))}catch(e){}}else(o.autoWidth||o.autoHeight)&&(i.addClass("fancybox-tmp"),o.autoWidth||i.width(u),o.autoHeight||i.height(e),o.autoWidth&&(u=i.width()),o.autoHeight&&(e=i.height()),i.removeClass("fancybox-tmp"));if(n=L(u),a=L(e),m=u/e,r=L(E(r)?L(r,"w")-p:r),s=L(E(s)?L(s,"w")-p:s),l=L(E(l)?L(l,"h")-f:l),k=s,g=c=L(E(c)?L(c,"h")-f:c),o.fitToView&&(s=Math.min(C.w-p,s),c=Math.min(C.h-f,c)),v=C.w-P,b=C.h-T,o.aspectRatio?(a=(n=c<(a=s<n?L((n=s)/m):a)?L((a=c)*m):n)<r?L((n=r)/m):a)<l&&(n=L((a=l)*m)):(n=Math.max(r,Math.min(n,s)),o.autoHeight&&"iframe"!==o.type&&(i.width(n),a=i.height()),a=Math.max(l,Math.min(a,c))),o.fitToView)if(i.width(n).height(a),t.width(n+h),y=t.width(),w=t.height(),o.aspectRatio)for(;(v<y||b<w)&&r<n&&l<a&&!(19<M++);)a=Math.max(l,Math.min(c,a-10)),(n=L(a*m))<r&&(a=L((n=r)/m)),s<n&&(a=L((n=s)/m)),i.width(n).height(a),t.width(n+h),y=t.width(),w=t.height();else n=Math.max(r,Math.min(n,n-(y-v))),a=Math.max(l,Math.min(a,a-(w-b)));j&&"auto"===O&&a<e&&n+h+j<v&&(n+=j),i.width(n).height(a),t.width(n+h),y=t.width(),w=t.height(),p=(v<y||b<w)&&r<n&&l<a,f=o.aspectRatio?n<k&&a<g&&n<u&&a<e:(n<k||a<g)&&(n<u||a<e),_.extend(o,{dim:{width:W(y),height:W(w)},origWidth:u,origHeight:e,canShrink:p,canExpand:f,wPadding:h,hPadding:d,wrapSpace:w-S.outerHeight(!0),skinSpace:S.height()-a}),!x&&o.autoHeight&&l<a&&a<c&&!f&&i.height("auto")},_getPosition:function(e){var t=D.current,i=D.getViewport(),o=t.margin,n=D.wrap.width()+o[1]+o[3],a=D.wrap.height()+o[0]+o[2],o={position:"absolute",top:o[0],left:o[3]};return t.autoCenter&&t.fixed&&!e&&a<=i.h&&n<=i.w?o.position="fixed":t.locked||(o.top+=i.y,o.left+=i.x),o.top=W(Math.max(o.top,o.top+(i.h-a)*t.topRatio)),o.left=W(Math.max(o.left,o.left+(i.w-n)*t.leftRatio)),o},_afterZoomIn:function(){var t=D.current;t&&(D.isOpen=D.isOpened=!0,D.wrap.css("overflow","visible").addClass("fancybox-opened").hide().show(0),D.update(),(t.closeClick||t.nextClick&&1<D.group.length)&&D.inner.css("cursor","pointer").on("click.fb",function(e){_(e.target).is("a")||_(e.target).parent().is("a")||(e.preventDefault(),D[t.closeClick?"close":"next"]())}),t.closeBtn&&_(t.tpl.closeBtn).appendTo(D.skin).on("click.fb",function(e){e.preventDefault(),D.close()}),t.arrows&&1<D.group.length&&((t.loop||0<t.index)&&_(t.tpl.prev).appendTo(D.outer).on("click.fb",D.prev),(t.loop||t.index<D.group.length-1)&&_(t.tpl.next).appendTo(D.outer).on("click.fb",D.next)),D.trigger("afterShow"),t.loop||t.index!==t.group.length-1?D.opts.autoPlay&&!D.player.isActive&&(D.opts.autoPlay=!1,D.play(!0)):D.play(!1))},_afterZoomOut:function(e){e=e||D.current,_(".fancybox-wrap").trigger("onReset").remove(),_.extend(D,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),D.trigger("afterClose",e)}}),D.transitions={getOrigPosition:function(){var e=D.current,t=e.element,i=e.orig,o={},n=50,a=50,r=e.hPadding,l=e.wPadding,s=D.getViewport();return!i&&e.isDom&&t.is(":visible")&&((i=t.find("img:first")).length||(i=t)),f(i)?(o=i.offset(),i.is("img")&&(n=i.outerWidth(),a=i.outerHeight())):(o.top=s.y+(s.h-a)*e.topRatio,o.left=s.x+(s.w-n)*e.leftRatio),"fixed"!==D.wrap.css("position")&&!e.locked||(o.top-=s.y,o.left-=s.x),o={top:W(o.top-r*e.topRatio),left:W(o.left-l*e.leftRatio),width:W(n+l),height:W(a+r)}},step:function(e,t){var i=t.prop,o=D.current,n=o.wrapSpace,a=o.skinSpace;"width"!==i&&"height"!==i||(t=t.end===t.start?1:(e-t.start)/(t.end-t.start),D.isClosing&&(t=1-t),e=e-("width"===i?o.wPadding:o.hPadding),D.skin[i](L("width"===i?e:e-n*t)),D.inner[i](L("width"===i?e:e-n*t-a*t)))},zoomIn:function(){var e=D.current,t=e.pos,i=e.openEffect,o="elastic"===i,n=_.extend({opacity:1},t);delete n.position,o?(t=this.getOrigPosition(),e.openOpacity&&(t.opacity=.1)):"fade"===i&&(t.opacity=.1),D.wrap.css(t).animate(n,{duration:"none"===i?0:e.openSpeed,easing:e.openEasing,step:o?this.step:null,complete:D._afterZoomIn})},zoomOut:function(){var e=D.current,t=e.closeEffect,i="elastic"===t,o={opacity:.1};i&&(o=this.getOrigPosition(),e.closeOpacity&&(o.opacity=.1)),D.wrap.animate(o,{duration:"none"===t?0:e.closeSpeed,easing:e.closeEasing,step:i?this.step:null,complete:D._afterZoomOut})},changeIn:function(){var e,t=D.current,i=t.nextEffect,o=t.pos,n={opacity:1},a=D.direction;o.opacity=.1,"elastic"===i&&(e="down"===a||"up"===a?"top":"left","down"===a||"right"===a?(o[e]=W(L(o[e])-200),n[e]="+=200px"):(o[e]=W(L(o[e])+200),n[e]="-=200px")),"none"===i?D._afterZoomIn():D.wrap.css(o).animate(n,{duration:t.nextSpeed,easing:t.nextEasing,complete:D._afterZoomIn})},changeOut:function(){var e=D.previous,t=e.prevEffect,i={opacity:.1},o=D.direction;"elastic"===t&&(i["down"===o||"up"===o?"top":"left"]=("up"===o||"left"===o?"-":"+")+"=200px"),e.wrap.animate(i,{duration:"none"===t?0:e.prevSpeed,easing:e.prevEasing,complete:function(){_(this).trigger("onReset").remove()}})}},D.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!a,fixed:!0},overlay:null,fixed:!1,el:_("html"),create:function(e){var t;e=_.extend({},this.defaults,e),this.overlay&&this.close(),t=(D.coming||e).parent,this.overlay=_('<div class="fancybox-overlay"></div>').appendTo(t&&t.length?t:"body"),this.fixed=!1,e.fixed&&D.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=_.extend({},this.defaults,e),this.overlay?this.overlay.off(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(o.on("resize.overlay",_.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.on("click.overlay",function(e){if(_(e.target).hasClass("fancybox-overlay"))return(D.isActive?D:t).close(),!1}),this.overlay.css(e.css).show()},close:function(){o.off("resize.overlay"),this.el.hasClass("fancybox-lock")&&(_(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),o.scrollTop(this.scrollV).scrollLeft(this.scrollH)),_(".fancybox-overlay").remove().hide(),_.extend(this,{overlay:null,fixed:!1})},update:function(){var e,t="100%";this.overlay.width(t).height("100%"),s?(e=Math.max(r.documentElement.offsetWidth,r.body.offsetWidth),n.width()>e&&(t=n.width())):n.width()>o.width()&&(t=n.width()),this.overlay.width(t).height(n.height())},onReady:function(e,t){var i=this.overlay;_(".fancybox-overlay").stop(!0,!0),i||this.create(e),e.locked&&this.fixed&&t.fixed&&(t.locked=this.overlay.append(t.wrap),t.fixed=!1),!0===e.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){t.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&_("*:not(object)").filter(function(){return"fixed"===_(this).css("position")&&!_(this).hasClass("fancybox-overlay")&&!_(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(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!D.coming&&this.overlay.fadeOut(e.speedOut,_.proxy(this.close,this))}},D.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t,i,o=D.current,n=o.title,a=e.type;if("function"==typeof n&&(n=n.call(o.element,o)),d(n)&&""!==n.trim()){switch(t=_('<div class="fancybox-title fancybox-title-'+a+'-wrap">'+n+"</div>"),a){case"inside":i=D.skin;break;case"outside":i=D.wrap;break;case"over":i=D.inner;break;default:i=D.skin,t.appendTo("body"),s&&t.width(t.width()),t.wrapInner('<span class="child"></span>'),D.current.margin[2]+=Math.abs(L(t.css("margin-bottom")))}t["top"===e.position?"prependTo":"appendTo"](i)}}},_.fn.fancybox=function(a){function e(e){var t,i,o=_(this).trigger("blur"),n=s;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||o.is(".fancybox-wrap")||(t=a.groupAttr||"data-fancybox-group",(i=o.attr(t))||(t="rel",i=o.get(0)[t]),i&&""!==i&&"nofollow"!==i&&(n=(o=(o=l.length?_(l):r).filter("["+t+'="'+i+'"]')).index(this)),a.index=n,!1!==D.open(o,a)&&e.preventDefault())}var r=_(this),l=this.selector||"",s=(a=a||{}).index||0;return l&&!1!==a.live?n.off("click.fb-start").on("click.fb-start",l+":not('.fancybox-item, .fancybox-nav')",e):r.off("click.fb-start").on("click.fb-start",e),this.filter("[data-fancybox-start=1]").trigger("click"),this},_(function(){var e,t;_.scrollbarWidth===p&&(_.scrollbarWidth=function(){var e=_('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),t=e.children(),t=t.innerWidth()-t.height(99).innerWidth();return e.remove(),t}),_.extend(D.defaults,{scrollbarWidth:_.scrollbarWidth(),fixed:(e=_('<div style="position:fixed;top:20px;"></div>').appendTo("body"),t=20===e[0].offsetTop||15===e[0].offsetTop,e.remove(),t),parent:_("body")}),e=_(i).width(),l.addClass("fancybox-lock-test"),t=_(i).width(),l.removeClass("fancybox-lock-test"),_("<style type='text/css'>.fancybox-margin{margin-right:"+(t-e)+"px;}</style>").appendTo("head")})}(window,document,jQuery),function(o){var n=o.fancybox;n.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(e,t){if(e.skipSingle&&t.group.length<2)return t.helpers.buttons=!1,void(t.closeBtn=!0);t.margin["bottom"===e.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(e,t){var i=this.buttons;i||(this.list=o(e.tpl).addClass(e.position).appendTo("body"),i={prev:this.list.find(".btnPrev").on("click",n.prev),next:this.list.find(".btnNext").on("click",n.next),play:this.list.find(".btnPlay").on("click",n.play),toggle:this.list.find(".btnToggle").on("click",n.togge),close:this.list.find(".btnClose").on("click",n.clos)}),0<t.index||t.loop?i.prev.removeClass("btnDisabled"):i.prev.addClass("btnDisabled"),t.loop||t.index<t.group.length-1?(i.next.removeClass("btnDisabled"),i.play.removeClass("btnDisabled")):(i.next.addClass("btnDisabled"),i.play.addClass("btnDisabled")),this.buttons=i,this.onUpdate(e,t)},onUpdate:function(e,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(c){c.fancybox.helpers.thumbs={defaults:{width:50,height:50,position:"bottom",source:function(e){var t;return t=!(t=e.element?c(e.element).find("img").attr("src"):t)&&"image"===e.type&&e.href?e.href:t}},wrap:null,list:null,width:0,init:function(e,i){for(var r=this,l=e.width,s=e.height,o=e.source,t="",n=0;n<i.group.length;n++)t+='<li><a style="width:'+l+"px;height:"+s+'px;" href="javascript:jQuery.fancybox.jumpto('+n+');"></a></li>';this.wrap=c('<div id="fancybox-thumbs"></div>').addClass(e.position).appendTo("body"),this.list=c("<ul>"+t+"</ul>").appendTo(this.wrap),c.each(i.group,function(a){var e=i.group[a],t=o(e);t&&c("<img />").on("load",function(){var e,t,i,o=this.width,n=this.height;r.list&&o&&n&&(e=o/l,t=n/s,i=r.list.children().eq(a).find("a"),1<=e&&1<=t&&(n=t<e?(o=Math.floor(o/t),s):(o=l,Math.floor(n/e))),c(this).css({width:o,height:n,top:Math.floor(s/2-n/2),left:Math.floor(l/2-o/2)}),i.width(l).height(s),c(this).hide().appendTo(i).fadeIn(300))}).attr("src",t).attr("title",e.title)}),this.width=this.list.children().eq(0).outerWidth(!0),this.list.width(this.width*(i.group.length+1)).css("left",Math.floor(.5*c(window).width()-(i.index*this.width+.5*this.width)))},beforeLoad:function(e,t){t.group.length<2?t.helpers.thumbs=!1:t.margin["top"===e.position?0:2]+=e.height+15},afterShow:function(e,t){this.list?this.onUpdate(e,t):this.init(e,t),this.list.children().removeClass("active").eq(t.index).addClass("active")},onUpdate:function(e,t){this.list&&this.list.stop(!0).animate({left:Math.floor(.5*c(window).width()-(t.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(s){"use strict";var e=s.fancybox;e.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(e,t,i){return i.swf.flashVars="playerVars="+s.param(t,!0),"//www.metacafe.com/fplayer/"+e[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(e){return"//maps.google."+e[1]+"/"+e[3]+e[4]+"&output="+(0<e[4].indexOf("layer=c")?"svembed":"embed")}}},beforeLoad:function(e,t){var i,o,n,a,r=t.href||"",l=!1;for(i in e)if(e.hasOwnProperty(i)&&(o=e[i],n=r.match(o.matcher))){l=o.type,a=s.extend(!0,{},o.params,t[i]||(s.isPlainObject(e[i])?e[i].params:null)),r="function"==typeof o.url?o.url.call(this,n,a,t):function(i,e,t){return"object"===s.type(t=t||"")&&(t=s.param(t,!0)),s.each(e,function(e,t){i=i.replace("$"+e,t||"")}),t.length&&(i+=(0<i.indexOf("?")?"&":"?")+t),i}(o.url,n,a);break}l&&(t.href=r,t.type=l,t.autoHeight=!1)}}}(jQuery);