/* 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(q,n,c,m){var l=c("html"),u=c(q),t=c(n),a=c.esgbox=function(){a.open.apply(this,arguments)},v=navigator.useragent.match(/msie/i),a=null,x=n.createtouch!==m,c=function(b){return b&&b.hasownproperty&&b instanceof c},w=function(b){return b&&"string"===c.type(b)},f=function(b){return w(b)&&0
',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(b,d){if(b&&(c.isplainobject(d)||(d={}),!1!==a.close(!0)))return c.isarray(b)||(b=c(b)?c(b).get():[b]),c.each(b,function(f,e){var k={},h;"object"===c.type(e)&&(e.nodetype&&(e=c(e)),c(e)?(k={href:e.data("esgbox-href")||e.attr("href"),title:e.data("esgbox-title")||e.attr("title"),isdom:!0,element:e},c.metadata&&c.extend(!0,k,e.metadata())):k=e);var g=d.href|| k.href||(w(e)?e:null);var p=d.title!==m?d.title:k.title||"";var y=(h=d.content||k.content)?"html":d.type||k.type;!y&&k.isdom&&(y=e.data("esgbox-type"),y||(y=(y=e.prop("class").match(/esgbox\.(\w+)/))?y[1]:null));if(w(g)&&(y||(a.isimage(g)?y="image":a.isswf(g)?y="swf":"#"===g.charat(0)?y="inline":w(e)&&(y="html",h=e)),"ajax"===y)){var l=g.split(/\s+/,2);g=l.shift();l=l.shift()}h||("inline"===y?g?h=c(w(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isdom&&(h=e):"html"===y?h=g:y||g||!k.isdom||(y="inline",h= e));c.extend(k,{href:g,type:y,content:h,title:p,selector:l});b[f]=k}),a.opts=c.extend(!0,{},a.defaults,d),d.keys!==m&&(a.opts.keys=d.keys?c.extend({},a.defaults.keys,d.keys):!1),a.group=b,a._start(a.opts.index)},cancel:function(){var b=a.coming;b&&!1!==a.trigger("oncancel")&&(a.hideloading(),a.ajaxload&&a.ajaxload.abort(),a.ajaxload=null,a.imgpreload&&(a.imgpreload.onload=a.imgpreload.onerror=null),b.wrap&&b.wrap.stop(!0,!0).trigger("onreset").remove(),a.coming=null,a.current||a._afterzoomout(b))}, close:function(b){a.cancel();!1!==a.trigger("beforeclose")&&(a.unbindevents(),a.isactive&&(a.isopen&&!0!==b?(a.isopen=a.isopened=!1,a.isclosing=!0,c(".esgbox-item, .esgbox-nav").remove(),a.wrap.stop(!0,!0).removeclass("esgbox-opened"),a.transitions[a.current.closemethod]()):(c(".esgbox-wrap").stop(!0).trigger("onreset").remove(),a._afterzoomout())))},play:function(b){var d=function(){cleartimeout(a.player.timer)},c=function(){d();a.current&&a.player.isactive&&(a.player.timer=settimeout(a.next,a.current.playspeed))}, e=function(){d();t.unbind(".player");a.player.isactive=!1;a.trigger("onplayend")};!0===b||!a.player.isactive&&!1!==b?a.current&&(a.current.loop||a.current.index=e.index?"next":"prev"],a.router=c||"jumpto",e.loop&&(0>b&&(b=e.group.length+b%e.group.length),b%=e.group.length),e.group[b]!==m&&(a.cancel(),a._start(b)))},reposition:function(b,d){var f=a.current,e=f?f.wrap:null;if(e){var k=a._getposition(d);b&&"scroll"===b.type?(delete k.position,e.stop(!0,!0).animate(k,200)):(e.css(k),f.pos=c.extend({},f.dim,k))}},update:function(b){var d=b&&b.type,c=!d||"orientationchange"=== d;c&&(cleartimeout(a),a=null);a.isopen&&!a&&(a=settimeout(function(){var e=a.current;e&&!a.isclosing&&(a.wrap.removeclass("esgbox-tmp"),(c||"load"===d||"resize"===d&&e.autoresize)&&a._setdimension(),"scroll"===d&&e.canshrink||a.reposition(b),a.trigger("onupdate"),a=null)},c&&!x?0:300))},toggle:function(b){a.isopen&&(a.current.fittoview="boolean"===c.type(b)?b:!a.current.fittoview,x&&(a.wrap.removeattr("style").addclass("esgbox-tmp"),a.trigger("onupdate")),a.update())},hideloading:function(){t.unbind(".loading"); c("#esgbox-loading").remove()},showloading:function(){a.hideloading();var b=c('
').click(a.cancel).appendto("body");t.bind("keydown.loading",function(b){27===(b.which||b.keycode)&&(b.preventdefault(),a.cancel())});if(!a.defaults.fixed){var d=a.getviewport();b.css({position:"absolute",top:.5*d.h+d.y,left:.5*d.w+d.x})}},getviewport:function(){var b=a.current&&a.current.locked||!1,d={x:u.scrollleft(),y:u.scrolltop()};b?(d.w=b[0].clientwidth,d.h=b[0].clientheight): (d.w=x&&q.innerwidth?q.innerwidth:u.width(),d.h=x&&q.innerheight?q.innerheight:u.height());return d},unbindevents:function(){a.wrap&&c(a.wrap)&&a.wrap.unbind(".fb");t.unbind(".fb");u.unbind(".fb")},bindevents:function(){var b=a.current,d;b&&(u.bind("orientationchange.fb"+(x?"":" resize.fb")+(b.autocenter&&!b.locked?" scroll.fb":""),a.update),(d=b.keys)&&t.bind("keydown.fb",function(f){var e=f.which||f.keycode,k=f.target||f.srcelement;if(27===e&&a.coming)return!1;f.ctrlkey||f.altkey||f.shiftkey||f.metakey|| k&&(k.type||c(k).is("[contenteditable]"))||c.each(d,function(d,g){if(1p.clientwidth||p.clientheight&&p.scrollheight> p.clientheight),f=c(f).parent();0!==e&&!p&&1h||0>k)&&a.next(0>h?"up":"right"),d.preventdefault())}))},trigger:function(b,d){var f,e=d||a.coming||a.current;if(e){c.isfunction(e[b])&&(f=e[b].apply(e,array.prototype.slice.call(arguments,1)));if(!1===f)return!1;e.helpers&&c.each(e.helpers,function(d,f){if(f&&a.helpers[d]&&c.isfunction(a.helpers[d][b]))a.helpers[d][b](c.extend(!0,{},a.helpers[d].defaults,f),e)});t.trigger(b)}},isimage:function(b){return w(b)&& b.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isswf:function(b){return w(b)&&b.match(/\.(swf)((\?|#).*)?$/i)},_start:function(b){var d={};b=r(b);var f=a.group[b]||null;var e=jquery(f.element[0].parentnode).closest(".tp-esg-item"),e=0").html(f).find(b.selector):c(f)&&(f.data("esgbox-placeholder")||f.data("esgbox-placeholder",c('
').insertafter(f).hide()),f=f.show().detach(),b.wrap.bind("onreset",function(){c(this).find(f).length&&f.hide().replaceall(f.data("esgbox-placeholder")).data("esgbox-placeholder",!1)}));break;case "image":f=b.tpl.image.replace("{href}", h);break;case "swf":f='';var g="";c.each(b.swf,function(b,a){f+='';g+=" "+b+'="'+a+'"'});f+='"}c(f)&&f.parent().is(b.inner)||b.inner.append(f);a.trigger("beforeshow");b.inner.css("overflow","yes"===k?"scroll": "no"===k?"hidden":k);a._setdimension();a.reposition();a.isopen=!1;a.coming=null;a.bindevents();if(!a.isopened)c(".esgbox-wrap").not(b.wrap).stop(!0).trigger("onreset").remove();else if(d.prevmethod)a.transitions[d.prevmethod]();a.transitions[a.isopened?b.nextmethod:b.openmethod]();a._preloadimages()}},_setdimension:function(){var b=a.getviewport(),d=0,f=a.wrap,e=a.skin,k=a.inner,h=a.current;var g=h.width;var p=h.height,l=h.minwidth,m=h.minheight,n=h.maxwidth,q=h.maxheight,u=h.scrolling,t=h.scrolloutside? h.scrollbarwidth:0,w=h.margin,v=r(w[1]+w[3]),x=r(w[0]+w[2]);f.add(e).add(k).width("auto").height("auto").removeclass("esgbox-tmp");w=r(e.outerwidth(!0)-e.width());var c=r(e.outerheight(!0)-e.height());var d=v+w;var a=x+c;var e=f(g)?(b.w-d)*r(g)/100:g;var b=f(p)?(b.h-a)*r(p)/100:p;if("iframe"===h.type){var i=h.content;if(h.autoheight&&1===i.data("ready"))try{if(i[0].contentwindow.document.location){k.width(e).height(9999);var h=i.contents().find("body");t&&h.css("overflow-x","hidden");b=h.outerheight(!0)}}catch(k){}}else if("html5"=== h.type)e=g,b=p,jquery(".esgbox-inner").addclass("html5video");else if(h.autowidth||h.autoheight)k.addclass("esgbox-tmp"),h.autowidth||k.width(e),h.autoheight||k.height(b),h.autowidth&&(e=k.width()),h.autoheight&&(b=k.height()),k.removeclass("esgbox-tmp");g=r(e);p=r(b);var g=e/b;l=r(f(l)?r(l,"w")-d:l);n=r(f(n)?r(n,"w")-d:n);m=r(f(m)?r(m,"h")-a:m);q=r(f(q)?r(q,"h")-a:q);h=n;var j=q;h.fittoview&&(n=math.min(b.w-d,n),q=math.min(b.h-a,q));d=b.w-v;x=b.h-x;h.aspectratio?(g>n&&(g=n,p=r(g/g)),p>q&&(p=q,g= r(p*g)),gd||v>x)&&g>l&&p>m&&!(19n&&(g=n,p=r(g/g)),k.width(g).height(p),f.width(g+w),b=f.width(),v=f.height();else g=math.max(l,math.min(g,g-(b-d))),p=math.max(m,math.min(p,p-(v- x)));t&&"auto"===u&&pd||v>x)&&g>l&&p>m;g=h.aspectratio?gm&&p').appendto(a.coming?a.coming.parent:b.parent);this.fixed=!1;b.fixed&&a.defaults.fixed&&(this.overlay.addclass("esgbox-overlay-fixed"),this.fixed=!0)},open:function(b){var d=this;b=c.extend({},this.defaults,b);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(b);this.fixed||(u.bind("resize.overlay",c.proxy(this.update,this)),this.update());b.closeclick&&this.overlay.bind("click.overlay", function(b){if(c(b.target).hasclass("esgbox-overlay"))return a.isactive?a.close():d.close(),!1});this.overlay.css(b.css).show()},close:function(){u.unbind("resize.overlay");if(this.el.hasclass("esgbox-lock")){c(".esgbox-margin").removeclass("esgbox-margin");var b=u.scrolltop();var a=u.scrollleft();this.el.removeclass("esgbox-lock");u.scrolltop(b).scrollleft(a)}c(".esgbox-overlay").remove().hide();c.extend(this,{overlay:null,fixed:!1})},update:function(){var b="100%";this.overlay.width(b).height("100%"); if(v){var a=math.max(n.documentelement.offsetwidth,n.body.offsetwidth);t.width()>a&&(b=t.width())}else t.width()>u.width()&&(b=t.width());this.overlay.width(b).height(t.height())},onready:function(b,a){var d=this.overlay;c(".esgbox-overlay").stop(!0,!0);d||this.create(b);b.locked&&this.fixed&&a.fixed&&(d||(this.margin=t.height()>u.height()?c("html").css("margin-right").replace("px",""):!1),a.locked=this.overlay.append(a.wrap),a.fixed=!1);!0===b.showearly&&this.beforeshow.apply(this,arguments)},beforeshow:function(b, a){if(a.locked){!1!==this.margin&&(c("*").filter(function(){return"fixed"===c(this).css("position")&&!c(this).hasclass("esgbox-overlay")&&!c(this).hasclass("esgbox-wrap")}).addclass("esgbox-margin"),this.el.addclass("esgbox-margin"));var d=u.scrolltop();var e=u.scrollleft();this.el.addclass("esgbox-lock");u.scrolltop(d).scrollleft(e)}this.open(b)},onupdate:function(){this.fixed||this.update()},afterclose:function(b){this.overlay&&!a.coming&&this.overlay.fadeout(b.speedout,c.proxy(this.close,this))}}; a.helpers.title={defaults:{type:"float",position:"bottom"},beforeshow:function(b){var d=a.current,f=d.title,e=b.type;c.isfunction(f)&&(f=f.call(d.element,d));if(w(f)&&""!==c.trim(f)){d=c('
'+f+"
");switch(e){case "inside":e=a.skin;break;case "outside":e=a.wrap;break;case "over":e=a.inner;break;default:e=a.skin,d.appendto("body"),v&&d.width(d.width()),d.wrapinner(''),a.current.margin[2]+=math.abs(r(d.css("margin-bottom")))}d["top"=== b.position?"prependto":"appendto"](e)}}};c.fn.esgbox=function(b){var d=c(this),f=this.selector||"",e=function(e){var g=c(this).blur(),h=k;if(!(e.ctrlkey||e.altkey||e.shiftkey||e.metakey||g.is(".esgbox-wrap"))){var l=b.groupattr||"data-esgbox-group";var m=g.attr(l);m||(l="rel",m=g.get(0)[l]);m&&""!==m&&"nofollow"!==m&&(g=f.length?c(f):d,g=g.filter("["+l+'="'+m+'"]'),h=g.index(this));b.index=h;!1!==a.open(g,b)&&e.preventdefault()}};b=b||{};var k=b.index||0;f&&!1!==b.live?t.undelegate(f,"click.fb-start").delegate(f+ ":not('.esgbox-item, .esgbox-nav')","click.fb-start",e):d.unbind("click.fb-start").bind("click.fb-start",e);this.filter("[data-esgbox-start=1]").trigger("click");return this};t.ready(function(){c.scrollbarwidth===m&&(c.scrollbarwidth=function(){var a=c('
').appendto("body"),b=a.children(),b=b.innerwidth()-b.height(99).innerwidth();a.remove();return b});c.support.fixedposition===m&&(c.support.fixedposition=function(){var b=c('
').appendto("body"), a=20===b[0].offsettop||15===b[0].offsettop;b.remove();return a}());c.extend(a.defaults,{scrollbarwidth:c.scrollbarwidth(),fixed:c.support.fixedposition,parent:c("body")});var b=c(q).width();l.addclass("esgbox-lock-test");var d=c(q).width();l.removeclass("esgbox-lock-test");c("").appendto("head")})})(window,document,jquery); (function(q){var n=q.esgbox;n.helpers.buttons={defaults:{skipsingle:!1,position:"top",tpl:'
'},list:null,buttons:null, beforeload:function(c,m){c.skipsingle&&2>m.group.length?(m.helpers.buttons=!1,m.closebtn=!0):m.margin["bottom"===c.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(c,m){var l=this.buttons;l||(this.list=q(c.tpl).addclass(c.position).appendto("body"),l={prev:this.list.find(".btnprev").click(n.prev), next:this.list.find(".btnnext").click(n.next),play:this.list.find(".btnplay").click(n.play),toggle:this.list.find(".btntoggle").click(n.toggle),close:this.list.find(".btnclose").click(n.close)});0';this.wrap=q('
').addclass(n.position).appendto("body"); this.list=q("
    "+a+"
").appendto(this.wrap);q.each(c.group,function(a){var n=t(c.group[a]);n&&q("").load(function(){var c=this.width,n=this.height;if(m.list&&c&&n){var t=c/l;var r=n/u;var v=m.list.children().eq(a).find("a");1<=t&&1<=r&&(t>r?(c=math.floor(c/r),n=u):(c=l,n=math.floor(n/t)));q(this).css({width:c,height:n,top:math.floor(u/2-n/2),left:math.floor(l/2-c/2)});v.width(l).height(u);q(this).hide().appendto(v).fadein(300)}}).attr("src",n)});this.width=this.list.children().eq(0).outerwidth(!0); this.list.width(this.width*(c.group.length+1)).css("left",math.floor(.5*q(window).width()-(c.index*this.width+.5*this.width)))},beforeload:function(n,c){2>c.group.length?c.helpers.thumbs=!1:c.margin["top"===n.position?0:2]+=n.height+15},aftershow:function(n,c){if(this.list)this.onupdate(n,c);else this.init(n,c);this.list.children().removeclass("active").eq(c.index).addclass("active")},onupdate:function(n,c){this.list&&(this.width=this.list.children().eq(0).outerwidth(!0),punchgs.tweenlite.set(this.list, {width:this.width*(c.group.length+1)}),punchgs.tweenlite.to(this.list,.5,{ease:punchgs.power3.easeinout,left:math.floor(.5*q(window).width()-(c.index*this.width+.5*this.width))}))},beforeclose:function(){this.wrap&&this.wrap.remove();this.list=this.wrap=null;this.width=0}}})(jquery);