/*! * fancyBox - jQuery Plugin * version: 2.1.5 (Fri, 14 Jun 2013) * @requires jQuery v1.6 or later * * Examples at http://fancyapps.com/fancybox/ * License: www.fancyapps.com/fancybox/#license * * Copyright 2012 Janis Skarnelis - janis@fancyapps.com * */ !function(a,b,c,d){"use strict";var e=c("html"),f=c(a),g=c(b),h=c.fancybox=function(){h.open.apply(this,arguments)},i=navigator.userAgent.match(/msie/i),j=null,k=b.createTouch!==d,l=function(a){return a&&a.hasOwnProperty&&a instanceof c},m=function(a){return a&&"string"===c.type(a)},n=function(a){return m(a)&&a.indexOf("%")>0},o=function(a){return a&&!(a.style.overflow&&"hidden"===a.style.overflow)&&(a.clientWidth&&a.scrollWidth>a.clientWidth||a.clientHeight&&a.scrollHeight>a.clientHeight)},p=function(a,b){var c=parseInt(a,10)||0;return b&&n(a)&&(c=h.getViewport()[b]/100*c),Math.ceil(c)},q=function(a,b){return p(a,b)+"px"};c.extend(h,{version:"2.1.5",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:!k,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:'
',image:'',iframe:'",error:'

The requested content cannot be loaded.
Please try again later.

',closeBtn:'',next:'',prev:''},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:c.noop,beforeLoad:c.noop,afterLoad:c.noop,beforeShow:c.noop,afterShow:c.noop,beforeChange:c.noop,beforeClose:c.noop,afterClose:c.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(a,b){if(a&&(c.isPlainObject(b)||(b={}),!1!==h.close(!0)))return c.isArray(a)||(a=l(a)?c(a).get():[a]),c.each(a,function(e,f){var i,j,k,n,o,p,q,g={};"object"===c.type(f)&&(f.nodeType&&(f=c(f)),l(f)?(g={href:f.data("fancybox-href")||f.attr("href"),title:f.data("fancybox-title")||f.attr("title"),isDom:!0,element:f},c.metadata&&c.extend(!0,g,f.metadata())):g=f),i=b.href||g.href||(m(f)?f:null),j=b.title!==d?b.title:g.title||"",k=b.content||g.content,n=k?"html":b.type||g.type,!n&&g.isDom&&((n=f.data("fancybox-type"))||(o=f.prop("class").match(/fancybox\.(\w+)/),n=o?o[1]:null)),m(i)&&(n||(h.isImage(i)?n="image":h.isSWF(i)?n="swf":"#"===i.charAt(0)?n="inline":m(f)&&(n="html",k=f)),"ajax"===n&&(p=i.split(/\s+/,2),i=p.shift(),q=p.shift())),k||("inline"===n?i?k=c(m(i)?i.replace(/.*(?=#[^\s]+$)/,""):i):g.isDom&&(k=f):"html"===n?k=i:n||i||!g.isDom||(n="inline",k=f)),c.extend(g,{href:i,type:n,content:k,title:j,selector:q}),a[e]=g}),h.opts=c.extend(!0,{},h.defaults,b),b.keys!==d&&(h.opts.keys=!!b.keys&&c.extend({},h.defaults.keys,b.keys)),h.group=a,h._start(h.opts.index)},cancel:function(){var a=h.coming;a&&!1!==h.trigger("onCancel")&&(h.hideLoading(),h.ajaxLoad&&h.ajaxLoad.abort(),h.ajaxLoad=null,h.imgPreload&&(h.imgPreload.onload=h.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),h.coming=null,h.current||h._afterZoomOut(a))},close:function(a){h.cancel(),!1!==h.trigger("beforeClose")&&(h.unbindEvents(),h.isActive&&(h.isOpen&&!0!==a?(h.isOpen=h.isOpened=!1,h.isClosing=!0,c(".fancybox-item, .fancybox-nav").remove(),h.wrap.stop(!0,!0).removeClass("fancybox-opened"),h.transitions[h.current.closeMethod]()):(c(".fancybox-wrap").stop(!0).trigger("onReset").remove(),h._afterZoomOut())))},play:function(a){var b=function(){clearTimeout(h.player.timer)},c=function(){b(),h.current&&h.player.isActive&&(h.player.timer=setTimeout(h.next,h.current.playSpeed))},d=function(){b(),g.unbind(".player"),h.player.isActive=!1,h.trigger("onPlayEnd")},e=function(){h.current&&(h.current.loop||h.current.index=e.index?"next":"prev"],h.router=c||"jumpto",e.loop&&(a<0&&(a=e.group.length+a%e.group.length),a%=e.group.length),e.group[a]!==d&&(h.cancel(),h._start(a)))},reposition:function(a,b){var f,d=h.current,e=d?d.wrap:null;e&&(f=h._getPosition(b),a&&"scroll"===a.type?(delete f.position,e.stop(!0,!0).animate(f,200)):(e.css(f),d.pos=c.extend({},d.dim,f)))},update:function(a){var b=a&&a.type,c=!b||"orientationchange"===b;c&&(clearTimeout(j),j=null),h.isOpen&&!j&&(j=setTimeout(function(){var d=h.current;d&&!h.isClosing&&(h.wrap.removeClass("fancybox-tmp"),(c||"load"===b||"resize"===b&&d.autoResize)&&h._setDimension(),"scroll"===b&&d.canShrink||h.reposition(a),h.trigger("onUpdate"),j=null)},c&&!k?0:300))},toggle:function(a){h.isOpen&&(h.current.fitToView="boolean"===c.type(a)?a:!h.current.fitToView,k&&(h.wrap.removeAttr("style").addClass("fancybox-tmp"),h.trigger("onUpdate")),h.update())},hideLoading:function(){g.unbind(".loading"),c("#fancybox-loading").remove()},showLoading:function(){var a,b;h.hideLoading(),a=c('
').click(h.cancel).appendTo("body"),g.bind("keydown.loading",function(a){27===(a.which||a.keyCode)&&(a.preventDefault(),h.cancel())}),h.defaults.fixed||(b=h.getViewport(),a.css({position:"absolute",top:.5*b.h+b.y,left:.5*b.w+b.x}))},getViewport:function(){var b=h.current&&h.current.locked||!1,c={x:f.scrollLeft(),y:f.scrollTop()};return b?(c.w=b[0].clientWidth,c.h=b[0].clientHeight):(c.w=k&&a.innerWidth?a.innerWidth:f.width(),c.h=k&&a.innerHeight?a.innerHeight:f.height()),c},unbindEvents:function(){h.wrap&&l(h.wrap)&&h.wrap.unbind(".fb"),g.unbind(".fb"),f.unbind(".fb")},bindEvents:function(){var b,a=h.current;a&&(f.bind("orientationchange.fb"+(k?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),h.update),b=a.keys,b&&g.bind("keydown.fb",function(e){var f=e.which||e.keyCode,g=e.target||e.srcElement;if(27===f&&h.coming)return!1;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||g&&(g.type||c(g).is("[contenteditable]"))||c.each(b,function(b,g){return a.group.length>1&&g[f]!==d?(h[b](g[f]),e.preventDefault(),!1):c.inArray(f,g)>-1?(h[b](),e.preventDefault(),!1):void 0})}),c.fn.mousewheel&&a.mouseWheel&&h.wrap.bind("mousewheel.fb",function(b,d,e,f){for(var g=b.target||null,i=c(g),j=!1;i.length&&!(j||i.is(".fancybox-skin")||i.is(".fancybox-wrap"));)j=o(i[0]),i=c(i).parent();0===d||j||h.group.length>1&&!a.canShrink&&(f>0||e>0?h.prev(f>0?"down":"left"):(f<0||e<0)&&h.next(f<0?"up":"right"),b.preventDefault())}))},trigger:function(a,b){var d,e=b||h.coming||h.current;if(e){if(c.isFunction(e[a])&&(d=e[a].apply(e,Array.prototype.slice.call(arguments,1))),!1===d)return!1;e.helpers&&c.each(e.helpers,function(b,d){d&&h.helpers[b]&&c.isFunction(h.helpers[b][a])&&h.helpers[b][a](c.extend(!0,{},h.helpers[b].defaults,d),e)}),g.trigger(a)}},isImage:function(a){return m(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return m(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d,e,f,g,i,b={};if(a=p(a),!(d=h.group[a]||null))return!1;if(b=c.extend(!0,{},h.opts,d),g=b.margin,i=b.padding,"number"===c.type(g)&&(b.margin=[g,g,g,g]),"number"===c.type(i)&&(b.padding=[i,i,i,i]),b.modal&&c.extend(!0,b,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),b.autoSize&&(b.autoWidth=b.autoHeight=!0),"auto"===b.width&&(b.autoWidth=!0),"auto"===b.height&&(b.autoHeight=!0),b.group=h.group,b.index=a,h.coming=b,!1===h.trigger("beforeLoad"))return void(h.coming=null);if(f=b.type,e=b.href,!f)return h.coming=null,!(!h.current||!h.router||"jumpto"===h.router)&&(h.current.index=a,h[h.router](h.direction));if(h.isActive=!0,"image"!==f&&"swf"!==f||(b.autoHeight=b.autoWidth=!1,b.scrolling="visible"),"image"===f&&(b.aspectRatio=!0),"iframe"===f&&k&&(b.scrolling="scroll"),b.wrap=c(b.tpl.wrap).addClass("fancybox-"+(k?"mobile":"desktop")+" fancybox-type-"+f+" fancybox-tmp "+b.wrapCSS).appendTo(b.parent||"body"),c.extend(b,{skin:c(".fancybox-skin",b.wrap),outer:c(".fancybox-outer",b.wrap),inner:c(".fancybox-inner",b.wrap)}),c.each(["Top","Right","Bottom","Left"],function(a,c){b.skin.css("padding"+c,q(b.padding[a]))}),h.trigger("onReady"),"inline"===f||"html"===f){if(!b.content||!b.content.length)return h._error("content")}else if(!e)return h._error("href");"image"===f?h._loadImage():"ajax"===f?h._loadAjax():"iframe"===f?h._loadIframe():h._afterLoad()},_error:function(a){c.extend(h.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:h.coming.tpl.error}),h._afterLoad()},_loadImage:function(){var a=h.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null,h.coming.width=this.width/h.opts.pixelRatio,h.coming.height=this.height/h.opts.pixelRatio,h._afterLoad()},a.onerror=function(){this.onload=this.onerror=null,h._error("image")},a.src=h.coming.href,!0!==a.complete&&h.showLoading()},_loadAjax:function(){var a=h.coming;h.showLoading(),h.ajaxLoad=c.ajax(c.extend({},a.ajax,{url:a.href,error:function(a,b){h.coming&&"abort"!==b?h._error("ajax",a):h.hideLoading()},success:function(b,c){"success"===c&&(a.content=b,h._afterLoad())}}))},_loadIframe:function(){var a=h.coming,b=c(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",k?"auto":a.iframe.scrolling).attr("src",a.href);c(a.wrap).bind("onReset",function(){try{c(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}}),a.iframe.preload&&(h.showLoading(),b.one("load",function(){c(this).data("ready",1),k||c(this).bind("load.fb",h.update),c(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),h._afterLoad()})),a.content=b.appendTo(a.inner),a.iframe.preload||h._afterLoad()},_preloadImages:function(){var e,f,a=h.group,b=h.current,c=a.length,d=b.preload?Math.min(b.preload,c-1):0;for(f=1;f<=d;f+=1)e=a[(b.index+f)%c],"image"===e.type&&e.href&&((new Image).src=e.href)},_afterLoad:function(){var e,f,g,i,j,k,a=h.coming,b=h.current,d="fancybox-placeholder";if(h.hideLoading(),a&&!1!==h.isActive){if(!1===h.trigger("afterLoad",a,b))return a.wrap.stop(!0).trigger("onReset").remove(),void(h.coming=null);switch(b&&(h.trigger("beforeChange",b),b.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),h.unbindEvents(),e=a,f=a.content,g=a.type,i=a.scrolling,c.extend(h,{wrap:e.wrap,skin:e.skin,outer:e.outer,inner:e.inner,current:e,previous:b}),j=e.href,g){case"inline":case"ajax":case"html":e.selector?f=c("
").html(f).find(e.selector):l(f)&&(f.data(d)||f.data(d,c('
').insertAfter(f).hide()),f=f.show().detach(),e.wrap.bind("onReset",function(){c(this).find(f).length&&f.hide().replaceAll(f.data(d)).data(d,!1)}));break;case"image":f=e.tpl.image.replace("{href}",j);break;case"swf":f='',k="",c.each(e.swf,function(a,b){f+='',k+=" "+a+'="'+b+'"'}),f+='"}l(f)&&f.parent().is(e.inner)||e.inner.append(f),h.trigger("beforeShow"),e.inner.css("overflow","yes"===i?"scroll":"no"===i?"hidden":i),h._setDimension(),h.reposition(),h.isOpen=!1,h.coming=null,h.bindEvents(),h.isOpened?b.prevMethod&&h.transitions[b.prevMethod]():c(".fancybox-wrap").not(e.wrap).stop(!0).trigger("onReset").remove(),h.transitions[h.isOpened?e.nextMethod:e.openMethod](),h._preloadImages()}},_setDimension:function(){var y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,a=h.getViewport(),b=0,d=!1,e=!1,f=h.wrap,g=h.skin,i=h.inner,j=h.current,k=j.width,l=j.height,m=j.minWidth,o=j.minHeight,r=j.maxWidth,s=j.maxHeight,t=j.scrolling,u=j.scrollOutside?j.scrollbarWidth:0,v=j.margin,w=p(v[1]+v[3]),x=p(v[0]+v[2]);if(f.add(g).add(i).width("auto").height("auto").removeClass("fancybox-tmp"),y=p(g.outerWidth(!0)-g.width()),z=p(g.outerHeight(!0)-g.height()),A=w+y,B=x+z,C=n(k)?(a.w-A)*p(k)/100:k,D=n(l)?(a.h-B)*p(l)/100:l,"iframe"===j.type){if(L=j.content,j.autoHeight&&1===L.data("ready"))try{L[0].contentWindow.document.location&&(i.width(C).height(9999),M=L.contents().find("body"),u&&M.css("overflow-x","hidden"),D=M.outerHeight(!0))}catch(a){}}else(j.autoWidth||j.autoHeight)&&(i.addClass("fancybox-tmp"),j.autoWidth||i.width(C),j.autoHeight||i.height(D),j.autoWidth&&(C=i.width()),j.autoHeight&&(D=i.height()),i.removeClass("fancybox-tmp"));if(k=p(C),l=p(D),G=C/D,m=p(n(m)?p(m,"w")-A:m),r=p(n(r)?p(r,"w")-A:r),o=p(n(o)?p(o,"h")-B:o),s=p(n(s)?p(s,"h")-B:s),E=r,F=s,j.fitToView&&(r=Math.min(a.w-A,r),s=Math.min(a.h-B,s)),J=a.w-w,K=a.h-x,j.aspectRatio?(k>r&&(k=r,l=p(k/G)),l>s&&(l=s,k=p(l*G)),kJ||I>K)&&k>m&&l>o&&!(b++>19);)l=Math.max(o,Math.min(s,l-10)),k=p(l*G),kr&&(k=r,l=p(k/G)),i.width(k).height(l),f.width(k+y),H=f.width(),I=f.height();else k=Math.max(m,Math.min(k,k-(H-J))),l=Math.max(o,Math.min(l,l-(I-K)));u&&"auto"===t&&lJ||I>K)&&k>m&&l>o,e=j.aspectRatio?ko&&l1)&&h.inner.css("cursor","pointer").bind("click.fb",function(b){c(b.target).is("a")||c(b.target).parent().is("a")||(b.preventDefault(),h[a.closeClick?"close":"next"]())}),a.closeBtn&&c(a.tpl.closeBtn).appendTo(h.skin).bind("click.fb",function(a){a.preventDefault(),h.close()}),a.arrows&&h.group.length>1&&((a.loop||a.index>0)&&c(a.tpl.prev).appendTo(h.outer).bind("click.fb",h.prev),(a.loop||a.index
').appendTo(h.coming?h.coming.parent:a.parent),this.fixed=!1,a.fixed&&h.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var b=this;a=c.extend({},this.defaults,a),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a),this.fixed||(f.bind("resize.overlay",c.proxy(this.update,this)),this.update()),a.closeClick&&this.overlay.bind("click.overlay",function(a){if(c(a.target).hasClass("fancybox-overlay"))return h.isActive?h.close():b.close(),!1}),this.overlay.css(a.css).show()},close:function(){var a,b;f.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(c(".fancybox-margin").removeClass("fancybox-margin"),a=f.scrollTop(),b=f.scrollLeft(),this.el.removeClass("fancybox-lock"),f.scrollTop(a).scrollLeft(b)),c(".fancybox-overlay").remove().hide(),c.extend(this,{overlay:null,fixed:!1})},update:function(){var c,a="100%";this.overlay.width(a).height("100%"),i?(c=Math.max(b.documentElement.offsetWidth,b.body.offsetWidth),g.width()>c&&(a=g.width())):g.width()>f.width()&&(a=g.width()),this.overlay.width(a).height(g.height())},onReady:function(a,b){var d=this.overlay;c(".fancybox-overlay").stop(!0,!0),d||this.create(a),a.locked&&this.fixed&&b.fixed&&(d||(this.margin=g.height()>f.height()&&c("html").css("margin-right").replace("px","")),b.locked=this.overlay.append(b.wrap),b.fixed=!1),!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var d,e;b.locked&&(!1!==this.margin&&(c("*").filter(function(){return"fixed"===c(this).css("position")&&!c(this).hasClass("fancybox-overlay")&&!c(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),d=f.scrollTop(),e=f.scrollLeft(),this.el.addClass("fancybox-lock"),f.scrollTop(d).scrollLeft(e)),this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!h.coming&&this.overlay.fadeOut(a.speedOut,c.proxy(this.close,this))}},h.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var f,g,b=h.current,d=b.title,e=a.type;if(c.isFunction(d)&&(d=d.call(b.element,b)),m(d)&&""!==c.trim(d)){switch(f=c('
'+d+"
"),e){case"inside":g=h.skin;break;case"outside":g=h.wrap;break;case"over":g=h.inner;break;default:g=h.skin,f.appendTo("body"),i&&f.width(f.width()),f.wrapInner(''),h.current.margin[2]+=Math.abs(p(f.css("margin-bottom")))}f["top"===a.position?"prependTo":"appendTo"](g)}}},c.fn.fancybox=function(a){var b,d=c(this),e=this.selector||"",f=function(f){var j,k,g=c(this).blur(),i=b;f.ctrlKey||f.altKey||f.shiftKey||f.metaKey||g.is(".fancybox-wrap")||(j=a.groupAttr||"data-fancybox-group",k=g.attr(j),k||(j="rel",k=g.get(0)[j]),k&&""!==k&&"nofollow"!==k&&(g=e.length?c(e):d,g=g.filter("["+j+'="'+k+'"]'),i=g.index(this)),a.index=i,!1!==h.open(g,a)&&f.preventDefault())};return a=a||{},b=a.index||0,e&&!1!==a.live?g.undelegate(e,"click.fb-start").delegate(e+":not('.fancybox-item, .fancybox-nav')","click.fb-start",f):d.unbind("click.fb-start").bind("click.fb-start",f),this.filter("[data-fancybox-start=1]").trigger("click"),this},g.ready(function(){var b,f;c.scrollbarWidth===d&&(c.scrollbarWidth=function(){var a=c('
').appendTo("body"),b=a.children(),d=b.innerWidth()-b.height(99).innerWidth();return a.remove(),d}),c.support.fixedPosition===d&&(c.support.fixedPosition=function(){var a=c('
').appendTo("body"),b=20===a[0].offsetTop||15===a[0].offsetTop;return a.remove(),b}()),c.extend(h.defaults,{scrollbarWidth:c.scrollbarWidth(),fixed:c.support.fixedPosition,parent:c("body")}),b=c(a).width(),e.addClass("fancybox-lock-test"),f=c(a).width(),e.removeClass("fancybox-lock-test"),c("").appendTo("head")})}(window,document,jQuery);