/*! * fancybx - jQuery Plugin * version: 2.1.5 (Fri, 14 Jun 2013) * @requires jQuery v1.6 or later * * Examples at http://fancyapps.com/fancybx/ * License: www.fancyapps.com/fancybx/#license * * Copyright 2012 Janis Skarnelis - janis@fancyapps.com * */ !function(a,i,M,h){"use strict";function f(e){return e&&e.hasOwnProperty&&e instanceof M}function u(e){return e&&"string"===M.type(e)}function A(e){return u(e)&&0
',image:'',iframe:'",error:'

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

',closeBtn:'',next:'',prev:'',loading:'
'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"fade",nextSpeed:250,nextEasing:"linear",nextMethod:"changeIn",prevEffect:"fade",prevSpeed:250,prevEasing:"linear",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:M.noop,beforeLoad:M.noop,afterLoad:M.noop,beforeShow:M.noop,afterShow:M.noop,beforeChange:M.noop,beforeClose:M.noop,afterClose:M.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(d,p){if(d&&(M.isPlainObject(p)||(p={}),!1!==V.close(!0)))return M.isArray(d)||(d=f(d)?M(d).get():[d]),M.each(d,function(e,t){var i,n,a,o,r,s,l,c={};"object"===M.type(t)&&(t.nodeType&&(t=M(t)),f(t)?(c={href:t.data("fancybx-href")||t.attr("href"),title:M("
").text(t.data("fancybx-title")||t.attr("title")||"").html(),isDom:!0,element:t},M.metadata&&M.extend(!0,c,t.metadata())):c=t),i=p.href||c.href||(u(t)?t:null),n=p.title!==h?p.title:c.title||"",!(o=(a=p.content||c.content)?"html":p.type||c.type)&&c.isDom&&(o=(o=t.data("fancybx-type"))||((r=t.prop("class").match(/fancybx\.(\w+)/))?r[1]:null)),u(i)&&(o||(V.isImage(i)?o="image":V.isSWF(i)?o="swf":"#"===i.charAt(0)?o="inline":u(t)&&(o="html",a=t)),"ajax"===o&&(i=(s=i.split(/\s+/,2)).shift(),l=s.shift())),a||("inline"===o?i?a=M(u(i)?i.replace(/.*(?=#[^\s]+$)/,""):i):c.isDom&&(a=t):"html"===o?a=i:o||i||!c.isDom||(o="inline",a=t)),M.extend(c,{href:i,type:o,content:a,title:n,selector:l}),d[e]=c}),V.opts=M.extend(!0,{},V.defaults,p),p.keys!==h&&(V.opts.keys=!!p.keys&&M.extend({},V.defaults.keys,p.keys)),V.group=d,V._start(V.opts.index)},cancel:function(){var e=V.coming;e&&!1===V.trigger("onCancel")||(V.hideLoading(),e&&(V.ajaxLoad&&V.ajaxLoad.abort(),V.ajaxLoad=null,V.imgPreload&&(V.imgPreload.onload=V.imgPreload.onerror=null),e.wrap&&e.wrap.stop(!0,!0).trigger("onReset").remove(),V.coming=null,V.current||V._afterZoomOut(e)))},close:function(e){V.cancel(),!1!==V.trigger("beforeClose")&&(V.unbindEvents(),V.isActive&&(V.isOpen&&!0!==e?(V.isOpen=V.isOpened=!1,V.isClosing=!0,M(".fancybx-item, .fancybx-nav").remove(),V.wrap.stop(!0,!0).removeClass("fancybx-opened"),V.transitions[V.current.closeMethod]()):(M(".fancybx-wrap").stop(!0).trigger("onReset").remove(),V._afterZoomOut())))},play:function(e){function t(){clearTimeout(V.player.timer)}function i(){t(),V.current&&V.player.isActive&&(V.player.timer=setTimeout(V.next,V.current.playSpeed))}function n(){t(),c.unbind(".player"),V.player.isActive=!1,V.trigger("onPlayEnd")}!0===e||!V.player.isActive&&!1!==e?V.current&&(V.current.loop||V.current.index=n.index?"next":"prev"],V.router=i||"jumpto",n.loop&&(e<0&&(e=n.group.length+e%n.group.length),e%=n.group.length),n.group[e]!==h&&(V.cancel(),V._start(e)))},reposition:function(e,t){var i,n=V.current,a=n?n.wrap:null;a&&(i=V._getPosition(t),e&&"scroll"===e.type?(delete i.position,a.stop(!0,!0).animate(i,200)):(a.css(i),n.pos=M.extend({},n.dim,i)))},update:function(t){var i=t&&t.originalEvent&&t.originalEvent.type,n=!i||"orientationchange"===i;n&&(clearTimeout(s),s=null),V.isOpen&&!s&&(s=setTimeout(function(){var e=V.current;e&&!V.isClosing&&(V.wrap.removeClass("fancybx-tmp"),(n||"load"===i||"resize"===i&&e.autoResize)&&V._setDimension(),"scroll"===i&&e.canShrink||V.reposition(t),V.trigger("onUpdate"),s=null)},n&&!d?0:300))},toggle:function(e){V.isOpen&&(V.current.fitToView="boolean"===M.type(e)?e:!V.current.fitToView,d&&(V.wrap.removeAttr("style").addClass("fancybx-tmp"),V.trigger("onUpdate")),V.update())},hideLoading:function(){c.unbind(".loading"),M("#fancybx-loading").remove()},showLoading:function(){var e,t;V.hideLoading(),e=M(V.opts.tpl.loading).click(V.cancel).appendTo("body"),c.bind("keydown.loading",function(e){27===(e.which||e.keyCode)&&(e.preventDefault(),V.cancel())}),V.defaults.fixed||(t=V.getViewport(),e.css({position:"absolute",top:.5*t.h+t.y,left:.5*t.w+t.x})),V.trigger("onLoading")},getViewport:function(){var e=V.current&&V.current.locked||!1,t={x:n.scrollLeft(),y:n.scrollTop()};return e&&e.length?(t.w=e[0].clientWidth,t.h=e[0].clientHeight):(t.w=d&&a.innerWidth?a.innerWidth:n.width(),t.h=d&&a.innerHeight?a.innerHeight:n.height()),t},unbindEvents:function(){V.wrap&&f(V.wrap)&&V.wrap.unbind(".fb"),c.unbind(".fb"),n.unbind(".fb")},bindEvents:function(){var t,l=V.current;l&&(n.bind("orientationchange.fb"+(d?"":" resize.fb")+(l.autoCenter&&!l.locked?" scroll.fb":""),V.update),(t=l.keys)&&c.bind("keydown.fb",function(i){var n=i.which||i.keyCode,e=i.target||i.srcElement;if(27===n&&V.coming)return!1;i.ctrlKey||i.altKey||i.shiftKey||i.metaKey||e&&(e.type||M(e).is("[contenteditable]"))||M.each(t,function(e,t){return 1a.clientWidth||a.clientHeight&&a.scrollHeight>a.clientHeight),r=M(r).parent();0===t||s||1").html(i).find(e.selector):f(i)&&(i.data(l)||i.data(l,M('
').insertAfter(i).hide()),i=i.show().detach(),e.wrap.bind("onReset",function(){M(this).find(i).length&&i.hide().replaceAll(i.data(l)).data(l,!1)}));break;case"image":i=e.tpl.image.replace(/\{href\}/g,a);break;case"swf":i='',o="",M.each(e.swf,function(e,t){i+='',o+=" "+e+'="'+t+'"'}),i+='"}f(i)&&i.parent().is(e.inner)||e.inner.append(i),V.trigger("beforeShow"),e.inner.css("overflow","yes"===n?"scroll":"no"===n?"hidden":n),V._setDimension(),V.reposition(),V.isOpen=!1,V.coming=null,V.bindEvents(),V.isOpened?s.prevMethod&&V.transitions[s.prevMethod]():M(".fancybx-wrap").not(e.wrap).stop(!0).trigger("onReset").remove(),V.transitions[V.isOpened?e.nextMethod:e.openMethod](),V._preloadImages()}},_setDimension:function(){var e,t,i,n,a,o,r,s,l,c,d,p,h,f,u,g,m,y=V.getViewport(),x=0,v=V.wrap,w=V.skin,b=V.inner,k=V.current,C=k.width,W=k.height,O=k.minWidth,S=k.minHeight,_=k.maxWidth,T=k.maxHeight,E=k.scrolling,H=k.scrollOutside?k.scrollbarWidth:0,L=k.margin,j=I(L[1]+L[3]),P=I(L[0]+L[2]);if(v.add(w).add(b).width("auto").height("auto").removeClass("fancybx-tmp"),i=I(w.outerWidth(!0)-w.width()),parseInt(i/2)!=i/2&&(i=2*(parseInt(i/2)+1)),a=j+i,o=P+(n=I(w.outerHeight(!0)-w.height())),r=A(C)?(y.w-a)*I(C)/100:C,s=A(W)?(y.h-o)*I(W)/100:W,"iframe"===k.type){if(g=k.content,k.autoHeight&&g&&1===g.data("ready"))try{g[0].contentWindow.document.location&&(b.width(r).height(9999),m=g.contents().find("body"),H&&m.css("overflow-x","hidden"),s=m.outerHeight(!0))}catch(e){}}else(k.autoWidth||k.autoHeight)&&(b.addClass("fancybx-tmp"),k.autoWidth||b.width(r),k.autoHeight||b.height(s),k.autoWidth&&(r=b.width()),k.autoHeight&&(s=b.height()),b.removeClass("fancybx-tmp"));if(C=I(r),W=I(s),d=r/s,O=I(A(O)?I(O,"w")-a:O),_=I(A(_)?I(_,"w")-a:_),S=I(A(S)?I(S,"h")-o:S),l=_,c=T=I(A(T)?I(T,"h")-o:T),k.fitToView&&(_=Math.min(y.w-a,_),T=Math.min(y.h-o,T)),f=y.w-j,u=y.h-P,k.aspectRatio?(_
').appendTo(t&&t.length?t:"body"),this.fixed=!1,e.fixed&&V.defaults.fixed&&(this.overlay.addClass("fancybx-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=M.extend({},this.defaults,e),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(n.bind("resize.overlay",M.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.bind("click.overlay",function(e){if(M(e.target).hasClass("fancybx-overlay"))return V.isActive?V.close():t.close(),!1}),this.overlay.css(e.css).show()},close:function(){n.unbind("resize.overlay"),this.el.hasClass("fancybx-lock")&&(M(".fancybx-margin").removeClass("fancybx-margin"),this.el.removeClass("fancybx-lock"),n.scrollTop(this.scrollV).scrollLeft(this.scrollH)),M(".fancybx-overlay").remove().hide(),M.extend(this,{overlay:null,fixed:!1})},update:function(){var e,t="100%";this.overlay.width(t).height("100%"),r?(e=Math.max(i.documentElement.offsetWidth,i.body.offsetWidth),c.width()>e&&(t=c.width())):c.width()>n.width()&&(t=c.width()),this.overlay.width(t).height(c.height())},onReady:function(e,t){var i=this.overlay;M(".fancybx-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("fancybx-lock")&&(!1!==this.fixPosition&&M("*:not(object)").filter(function(){return"fixed"===M(this).css("position")&&!M(this).hasClass("fancybx-overlay")&&!M(this).hasClass("fancybx-wrap")}).addClass("fancybx-margin"),this.el.addClass("fancybx-margin"),this.scrollV=n.scrollTop(),this.scrollH=n.scrollLeft(),this.el.addClass("fancybx-lock"),n.scrollTop(this.scrollV).scrollLeft(this.scrollH)),this.open(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!V.coming&&this.overlay.fadeOut(e.speedOut,M.proxy(this.close,this))}},V.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t,i,n=V.current,a=n.title,o=e.type;if(M.isFunction(a)&&(a=a.call(n.element,n)),u(a)&&""!==M.trim(a)){switch(t=M('
'+a+"
"),o){case"inside":i=V.skin;break;case"outside":i=V.wrap;break;case"over":i=V.inner;break;default:i=V.skin,t.appendTo("body"),r&&t.width(t.width()),t.wrapInner(''),V.current.margin[2]+=Math.abs(I(t.css("margin-bottom")))}t["top"===e.position?"prependTo":"appendTo"](i)}}},M.fn.fancybx=function(o){function e(e){var t,i,n=M(this).blur(),a=r;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||n.is(".fancybx-wrap")||(t=o.groupAttr||"data-fancybx-group",(i=n.attr(t))||(t="rel",i=n.get(0)[t]),i&&""!==i&&"nofollow"!==i&&(a=(n=(n=l.length?M(l):s).filter("["+t+'="'+i+'"]')).index(this)),o.index=a,!1!==V.open(n,o)&&e.preventDefault())}var r,s=M(this),l=this.selector||"";return r=(o=o||{}).index||0,l&&!1!==o.live?c.undelegate(l,"click.fb-start").delegate(l+":not('.fancybx-item, .fancybx-nav')","click.fb-start",e):s.unbind("click.fb-start").bind("click.fb-start",e),this.filter("[data-fancybx-start=1]").trigger("click"),this},c.ready(function(){var e,t,i,n;M.scrollbarWidth===h&&(M.scrollbarWidth=function(){var e=M('
').appendTo("body"),t=e.children(),i=t.innerWidth()-t.height(99).innerWidth();return e.remove(),i}),M.support.fixedPosition===h&&(M.support.fixedPosition=(i=M('
').appendTo("body"),n=20===i[0].offsetTop||15===i[0].offsetTop,i.remove(),n)),M.extend(V.defaults,{scrollbarWidth:M.scrollbarWidth(),fixed:M.support.fixedPosition,parent:M("body")}),e=M(a).width(),o.addClass("fancybx-lock-test"),t=M(a).width(),o.removeClass("fancybx-lock-test"),M("").appendTo("head")})}(window,document,jQuery); /*! * Media helper for fancybx * version: 1.0.6 (Fri, 14 Jun 2013) */ !function(e){"use strict";var a=e.fancybx,t=function(a,t,o){return o=o||"","object"===e.type(o)&&(o=e.param(o,!0)),e.each(t,function(e,t){a=a.replace("$"+e,t||"")}),o.length&&(a+=(a.indexOf("?")>0?"&":"?")+o),a};a.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(a,t,o){return o.swf.flashVars="playerVars="+e.param(t,!0),"//www.metacafe.com/fplayer/"+a[1]+"/.swf"}},dailymotion:{matcher:/dailymotion.com\/video\/(.*)\/?(.*)/,params:{autoplay:1,additionalInfos:0,autoStart:1},type:"iframe",url:"//www.dailymotion.com/embed/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="+(e[4].indexOf("layer=c")>0?"svembed":"embed")}}},beforeLoad:function(a,o){var i,r,m,l,c=o.href||"",p=!1;for(i in a)if(a.hasOwnProperty(i)&&(r=a[i],m=c.match(r.matcher))){p=r.type,l=e.extend(!0,{},r.params,o[i]||(e.isPlainObject(a[i])?a[i].params:null)),c="function"===e.type(r.url)?r.url.call(this,m,l,o):t(r.url,m,l);break}p&&(o.href=c,o.type=p,o.autoHeight=!1)}}}(jQuery); /*! * Thumbnail helper for fancybx * version: 1.0.7 (Mon, 01 Oct 2012) */ !function(t){t.fancybx.helpers.thumbs={defaults:{width:50,height:50,position:"bottom",source:function(i){var h;return i.element&&(h=t(i.element).find("img").attr("src")),!h&&"image"===i.type&&i.href&&(h=i.href),h}},wrap:null,list:null,width:0,init:function(i,h){var e,s=this,o=i.width,n=i.height,l=i.source;e="";for(var a=0;a';this.wrap=t('
').addClass(i.position).appendTo("body"),this.list=t("
    "+e+"
").appendTo(this.wrap),t.each(h.group,function(i){var e=h.group[i],a=l(e);a&&t("").on("load",function(){var h,e,l,a=this.width,r=this.height;s.list&&a&&r&&(h=a/o,e=r/n,l=s.list.children().eq(i).find("a"),h>=1&&e>=1&&(h>e?(a=Math.floor(a/e),r=n):(a=o,r=Math.floor(r/h))),t(this).css({width:a,height:r,top:Math.floor(n/2-r/2),left:Math.floor(o/2-a/2)}),l.width(o).height(n),t(this).hide().appendTo(l).fadeIn(300))}).attr("src",a).attr("title",e.title)}),this.width=this.list.children().eq(0).outerWidth(!0),this.list.width(this.width*(h.group.length+1)).css("left",Math.floor(.5*t(window).width()-(h.index*this.width+.5*this.width)))},beforeLoad:function(t,i){i.group.length<2?i.helpers.thumbs=!1:i.margin["top"===t.position?0:2]+=t.height+15},afterShow:function(t,i){this.list?this.onUpdate(t,i):this.init(t,i),this.list.children().removeClass("active").eq(i.index).addClass("active")},onUpdate:function(i,h){this.list&&this.list.stop(!0).animate({left:Math.floor(.5*t(window).width()-(h.index*this.width+.5*this.width))},150)},beforeClose:function(){this.wrap&&this.wrap.remove(),this.wrap=null,this.list=null,this.width=0}}}(jQuery);