(function($){function CircleProgress(config){this.init(config)} CircleProgress.prototype={value:0.0,size:100.0,startAngle:-Math.PI,thickness:'auto',fill:{gradient:['#3aeabb','#fdd250']},emptyFill:'rgba(0, 0, 0, .1)',animation:{duration:1200,easing:'circleProgressEasing'},animationStartValue:0.0,reverse:!1,lineCap:'butt',constructor:CircleProgress,el:null,canvas:null,ctx:null,radius:0.0,arcFill:null,lastFrameValue:0.0,init:function(config){$.extend(this,config);this.radius=this.size/2;this.initWidget();this.initFill();this.draw()},initWidget:function(){var canvas=this.canvas=this.canvas||$('').prependTo(this.el)[0];canvas.width=this.size;canvas.height=this.size;this.ctx=canvas.getContext('2d')},initFill:function(){var self=this,fill=this.fill,ctx=this.ctx,size=this.size;if(!fill) throw Error("The fill is not specified!");if(fill.color) this.arcFill=fill.color;if(fill.gradient){var gr=fill.gradient;if(gr.length==1){this.arcFill=gr[0]}else if(gr.length>1){var ga=fill.gradientAngle||0,gd=fill.gradientDirection||[size/2*(1-Math.cos(ga)),size/2*(1+Math.sin(ga)),size/2*(1+Math.cos(ga)),size/2*(1-Math.sin(ga))];var lg=ctx.createLinearGradient.apply(ctx,gd);for(var i=0;i')[0];bg.width=self.size;bg.height=self.size;bg.getContext('2d').drawImage(img,0,0,size,size);self.arcFill=self.ctx.createPattern(bg,'no-repeat');self.drawFrame(self.lastFrameValue)}},draw:function(){if(this.animation) this.drawAnimated(this.value);else this.drawFrame(this.value)},drawFrame:function(v){this.lastFrameValue=v;this.ctx.clearRect(0,0,this.size,this.size);this.drawEmptyArc(v);this.drawArc(v)},drawArc:function(v){var ctx=this.ctx,r=this.radius,t=this.getThickness(),a=this.startAngle;ctx.save();ctx.beginPath();if(!this.reverse){ctx.arc(r,r,r-t/2,a,a+Math.PI*2*v)}else{ctx.arc(r,r,r-t/2,a-Math.PI*2*v,a)} ctx.lineWidth=t;ctx.lineCap=this.lineCap;ctx.strokeStyle=this.arcFill;ctx.stroke();ctx.restore()},drawEmptyArc:function(v){var ctx=this.ctx,r=this.radius,t=this.getThickness(),a=this.startAngle;if(v<1){ctx.save();ctx.beginPath();if(v<=0){ctx.arc(r,r,r-t/2,0,Math.PI*2)}else{if(!this.reverse){ctx.arc(r,r,r-t/2,a+Math.PI*2*v,a)}else{ctx.arc(r,r,r-t/2,a,a-Math.PI*2*v)}} ctx.lineWidth=t;ctx.strokeStyle=this.emptyFill;ctx.stroke();ctx.restore()}},drawAnimated:function(v){var self=this,el=this.el,canvas=$(this.canvas);canvas.stop(!0,!1);el.trigger('circle-animation-start');canvas.css({animationProgress:0}).animate({animationProgress:1},$.extend({},this.animation,{step:function(animationProgress){var stepValue=self.animationStartValue*(1-animationProgress)+v*animationProgress;self.drawFrame(stepValue);el.trigger('circle-animation-progress',[animationProgress,stepValue])}})).promise().always(function(){el.trigger('circle-animation-end')})},getThickness:function(){return $.isNumeric(this.thickness)?this.thickness:this.size/14},getValue:function(){return this.value},setValue:function(newValue){if(this.animation) this.animationStartValue=this.lastFrameValue;this.value=newValue;this.draw()}};$.circleProgress={defaults:CircleProgress.prototype};$.easing.circleProgressEasing=function(x,t,b,c,d){if((t/=d/2)<1) return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b};$.fn.circleProgress=function(configOrCommand,commandArgument){var dataName='circle-progress',firstInstance=this.data(dataName);if(configOrCommand=='widget'){if(!firstInstance) throw Error('Calling "widget" method on not initialized instance is forbidden');return firstInstance.canvas} if(configOrCommand=='value'){if(!firstInstance) throw Error('Calling "value" method on not initialized instance is forbidden');if(typeof commandArgument=='undefined'){return firstInstance.getValue()}else{var newValue=arguments[1];return this.each(function(){$(this).data(dataName).setValue(newValue)})}} return this.each(function(){var el=$(this),instance=el.data(dataName),config=$.isPlainObject(configOrCommand)?configOrCommand:{};if(instance){instance.init(config)}else{var initialConfig=$.extend({},el.data());if(typeof initialConfig.fill=='string') initialConfig.fill=JSON.parse(initialConfig.fill);if(typeof initialConfig.animation=='string') initialConfig.animation=JSON.parse(initialConfig.animation);config=$.extend(initialConfig,config);config.el=el;instance=new CircleProgress(config);el.data(dataName,instance)}})}})(jQuery);(function($,window,undefined){'$:nomunge';var str_hashchange='hashchange',doc=document,fake_onhashchange,special=$.event.special,doc_mode=doc.documentMode,supports_onhashchange='on'+str_hashchange in window&&(doc_mode===undefined||doc_mode>7);function get_fragment(url){url=url||location.href;return '#'+url.replace(/^[^#]*#?(.*)$/,'$1')};$.fn[str_hashchange]=function(fn){return fn?this.bind(str_hashchange,fn):this.trigger(str_hashchange)};$.fn[str_hashchange].delay=50;special[str_hashchange]=$.extend(special[str_hashchange],{setup:function(){if(supports_onhashchange){return!1} $(fake_onhashchange.start)},teardown:function(){if(supports_onhashchange){return!1} $(fake_onhashchange.stop)}});fake_onhashchange=(function(){var self={},timeout_id,last_hash=get_fragment(),fn_retval=function(val){return val},history_set=fn_retval,history_get=fn_retval;self.start=function(){timeout_id||poll()};self.stop=function(){timeout_id&&clearTimeout(timeout_id);timeout_id=undefined};function poll(){var hash=get_fragment(),history_hash=history_get(last_hash);if(hash!==last_hash){history_set(last_hash=hash,history_hash);$(window).trigger(str_hashchange)}else if(history_hash!==last_hash){location.href=location.href.replace(/#.*/,'')+history_hash} timeout_id=setTimeout(poll,$.fn[str_hashchange].delay)};$.browser.msie&&!supports_onhashchange&&(function(){var iframe,iframe_src;self.start=function(){if(!iframe){iframe_src=$.fn[str_hashchange].src;iframe_src=iframe_src&&iframe_src+get_fragment();iframe=$(''}else if(video.type==='vimeo'){html=''}else if(video.type==='vzaar'){html=''} $('
'+html+'
').insertAfter(item.find('.owl-video'));this._playing=item.addClass('owl-video-playing')};Video.prototype.isInFullScreen=function(){var element=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;return element&&$(element).parent().hasClass('owl-video-frame')};Video.prototype.destroy=function(){var handler,property;this._core.$element.off('click.owl.video');for(handler in this._handlers){this._core.$element.off(handler,this._handlers[handler])} for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null)}};$.fn.owlCarousel.Constructor.Plugins.Video=Video})(window.Zepto||window.jQuery,window,document);(function($,window,document,undefined){var Animate=function(scope){this.core=scope;this.core.options=$.extend({},Animate.Defaults,this.core.options);this.swapping=!0;this.previous=undefined;this.next=undefined;this.handlers={'change.owl.carousel':$.proxy(function(e){if(e.namespace&&e.property.name=='position'){this.previous=this.core.current();this.next=e.property.value}},this),'drag.owl.carousel dragged.owl.carousel translated.owl.carousel':$.proxy(function(e){if(e.namespace){this.swapping=e.type=='translated'}},this),'translate.owl.carousel':$.proxy(function(e){if(e.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)){this.swap()}},this)};this.core.$element.on(this.handlers)};Animate.Defaults={animateOut:!1,animateIn:!1};Animate.prototype.swap=function(){if(this.core.settings.items!==1){return} if(!$.support.animation||!$.support.transition){return} this.core.speed(0);var left,clear=$.proxy(this.clear,this),previous=this.core.$stage.children().eq(this.previous),next=this.core.$stage.children().eq(this.next),incoming=this.core.settings.animateIn,outgoing=this.core.settings.animateOut;if(this.core.current()===this.previous){return} if(outgoing){left=this.core.coordinates(this.previous)-this.core.coordinates(this.next);previous.one($.support.animation.end,clear).css({'left':left+'px'}).addClass('animated owl-animated-out').addClass(outgoing)} if(incoming){next.one($.support.animation.end,clear).addClass('animated owl-animated-in').addClass(incoming)}};Animate.prototype.clear=function(e){$(e.target).css({'left':''}).removeClass('animated owl-animated-out owl-animated-in').removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut);this.core.onTransitionEnd()};Animate.prototype.destroy=function(){var handler,property;for(handler in this.handlers){this.core.$element.off(handler,this.handlers[handler])} for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null)}};$.fn.owlCarousel.Constructor.Plugins.Animate=Animate})(window.Zepto||window.jQuery,window,document);(function($,window,document,undefined){var Autoplay=function(carousel){this._core=carousel;this._timeout=null;this._paused=!1;this._handlers={'changed.owl.carousel':$.proxy(function(e){if(e.namespace&&e.property.name==='settings'){if(this._core.settings.autoplay){this.play()}else{this.stop()}}else if(e.namespace&&e.property.name==='position'){if(this._core.settings.autoplay){this._setAutoPlayInterval()}}},this),'initialized.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.autoplay){this.play()}},this),'play.owl.autoplay':$.proxy(function(e,t,s){if(e.namespace){this.play(t,s)}},this),'stop.owl.autoplay':$.proxy(function(e){if(e.namespace){this.stop()}},this),'mouseover.owl.autoplay':$.proxy(function(){if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){this.pause()}},this),'mouseleave.owl.autoplay':$.proxy(function(){if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){this.play()}},this),'touchstart.owl.core':$.proxy(function(){if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){this.pause()}},this),'touchend.owl.core':$.proxy(function(){if(this._core.settings.autoplayHoverPause){this.play()}},this)};this._core.$element.on(this._handlers);this._core.options=$.extend({},Autoplay.Defaults,this._core.options)};Autoplay.Defaults={autoplay:!1,autoplayTimeout:5000,autoplayHoverPause:!1,autoplaySpeed:!1};Autoplay.prototype.play=function(timeout,speed){this._paused=!1;if(this._core.is('rotating')){return} this._core.enter('rotating');this._setAutoPlayInterval()};Autoplay.prototype._getNextTimeout=function(timeout,speed){if(this._timeout){window.clearTimeout(this._timeout)} return window.setTimeout($.proxy(function(){if(this._paused||this._core.is('busy')||this._core.is('interacting')||document.hidden){return} this._core.next(speed||this._core.settings.autoplaySpeed)},this),timeout||this._core.settings.autoplayTimeout)};Autoplay.prototype._setAutoPlayInterval=function(){this._timeout=this._getNextTimeout()};Autoplay.prototype.stop=function(){if(!this._core.is('rotating')){return} window.clearTimeout(this._timeout);this._core.leave('rotating')};Autoplay.prototype.pause=function(){if(!this._core.is('rotating')){return} this._paused=!0};Autoplay.prototype.destroy=function(){var handler,property;this.stop();for(handler in this._handlers){this._core.$element.off(handler,this._handlers[handler])} for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null)}};$.fn.owlCarousel.Constructor.Plugins.autoplay=Autoplay})(window.Zepto||window.jQuery,window,document);(function($,window,document,undefined){'use strict';var Navigation=function(carousel){this._core=carousel;this._initialized=!1;this._pages=[];this._controls={};this._templates=[];this.$element=this._core.$element;this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to};this._handlers={'prepared.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.dotsData){this._templates.push('
'+$(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot')+'
')}},this),'added.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.dotsData){this._templates.splice(e.position,0,this._templates.pop())}},this),'remove.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.dotsData){this._templates.splice(e.position,1)}},this),'changed.owl.carousel':$.proxy(function(e){if(e.namespace&&e.property.name=='position'){this.draw()}},this),'initialized.owl.carousel':$.proxy(function(e){if(e.namespace&&!this._initialized){this._core.trigger('initialize',null,'navigation');this.initialize();this.update();this.draw();this._initialized=!0;this._core.trigger('initialized',null,'navigation')}},this),'refreshed.owl.carousel':$.proxy(function(e){if(e.namespace&&this._initialized){this._core.trigger('refresh',null,'navigation');this.update();this.draw();this._core.trigger('refreshed',null,'navigation')}},this)};this._core.options=$.extend({},Navigation.Defaults,this._core.options);this.$element.on(this._handlers)};Navigation.Defaults={nav:!1,navText:['prev','next'],navSpeed:!1,navElement:'div',navContainer:!1,navContainerClass:'owl-nav',navClass:['owl-prev','owl-next'],slideBy:1,dotClass:'owl-dot',dotsClass:'owl-dots',dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1};Navigation.prototype.initialize=function(){var override,settings=this._core.settings;this._controls.$relative=(settings.navContainer?$(settings.navContainer):$('
').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled');this._controls.$previous=$('<'+settings.navElement+'>').addClass(settings.navClass[0]).html(settings.navText[0]).prependTo(this._controls.$relative).on('click',$.proxy(function(e){this.prev(settings.navSpeed)},this));this._controls.$next=$('<'+settings.navElement+'>').addClass(settings.navClass[1]).html(settings.navText[1]).appendTo(this._controls.$relative).on('click',$.proxy(function(e){this.next(settings.navSpeed)},this));if(!settings.dotsData){this._templates=[$('
').addClass(settings.dotClass).append($('')).prop('outerHTML')]} this._controls.$absolute=(settings.dotsContainer?$(settings.dotsContainer):$('
').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled');this._controls.$absolute.on('click','div',$.proxy(function(e){var index=$(e.target).parent().is(this._controls.$absolute)?$(e.target).index():$(e.target).parent().index();e.preventDefault();this.to(index,settings.dotsSpeed)},this));for(override in this._overrides){this._core[override]=$.proxy(this[override],this)}};Navigation.prototype.destroy=function(){var handler,control,property,override;for(handler in this._handlers){this.$element.off(handler,this._handlers[handler])} for(control in this._controls){this._controls[control].remove()} for(override in this.overides){this._core[override]=this._overrides[override]} for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null)}};Navigation.prototype.update=function(){var i,j,k,lower=this._core.clones().length/2,upper=lower+this._core.items().length,maximum=this._core.maximum(!0),settings=this._core.settings,size=settings.center||settings.autoWidth||settings.dotsData?1:settings.dotsEach||settings.items;if(settings.slideBy!=='page'){settings.slideBy=Math.min(settings.slideBy,settings.items)} if(settings.dots||settings.slideBy=='page'){this._pages=[];for(i=lower,j=0,k=0;i=size||j===0){this._pages.push({start:Math.min(maximum,i-lower),end:i-lower+size-1});if(Math.min(maximum,i-lower)===maximum){break} j=0,++k} j+=this._core.mergers(this._core.relative(i))}}};Navigation.prototype.draw=function(){var difference,settings=this._core.settings,disabled=this._core.items().length<=settings.items,index=this._core.relative(this._core.current()),loop=settings.loop||settings.rewind;this._controls.$relative.toggleClass('disabled',!settings.nav||disabled);if(settings.nav){this._controls.$previous.toggleClass('disabled',!loop&&index<=this._core.minimum(!0));this._controls.$next.toggleClass('disabled',!loop&&index>=this._core.maximum(!0))} this._controls.$absolute.toggleClass('disabled',!settings.dots||disabled);if(settings.dots){difference=this._pages.length-this._controls.$absolute.children().length;if(settings.dotsData&&difference!==0){this._controls.$absolute.html(this._templates.join(''))}else if(difference>0){this._controls.$absolute.append(new Array(difference+1).join(this._templates[0]))}else if(difference<0){this._controls.$absolute.children().slice(difference).remove()} this._controls.$absolute.find('.active').removeClass('active');this._controls.$absolute.children().eq($.inArray(this.current(),this._pages)).addClass('active')}};Navigation.prototype.onTrigger=function(event){var settings=this._core.settings;event.page={index:$.inArray(this.current(),this._pages),count:this._pages.length,size:settings&&(settings.center||settings.autoWidth||settings.dotsData?1:settings.dotsEach||settings.items)}};Navigation.prototype.current=function(){var current=this._core.relative(this._core.current());return $.grep(this._pages,$.proxy(function(page,index){return page.start<=current&&page.end>=current},this)).pop()};Navigation.prototype.getPosition=function(successor){var position,length,settings=this._core.settings;if(settings.slideBy=='page'){position=$.inArray(this.current(),this._pages);length=this._pages.length;successor?++position:--position;position=this._pages[((position%length)+length)%length].start}else{position=this._core.relative(this._core.current());length=this._core.items().length;successor?position+=settings.slideBy:position-=settings.slideBy} return position};Navigation.prototype.next=function(speed){$.proxy(this._overrides.to,this._core)(this.getPosition(!0),speed)};Navigation.prototype.prev=function(speed){$.proxy(this._overrides.to,this._core)(this.getPosition(!1),speed)};Navigation.prototype.to=function(position,speed,standard){var length;if(!standard&&this._pages.length){length=this._pages.length;$.proxy(this._overrides.to,this._core)(this._pages[((position%length)+length)%length].start,speed)}else{$.proxy(this._overrides.to,this._core)(position,speed)}};$.fn.owlCarousel.Constructor.Plugins.Navigation=Navigation})(window.Zepto||window.jQuery,window,document);(function($,window,document,undefined){'use strict';var Hash=function(carousel){this._core=carousel;this._hashes={};this.$element=this._core.$element;this._handlers={'initialized.owl.carousel':$.proxy(function(e){if(e.namespace&&this._core.settings.startPosition==='URLHash'){$(window).trigger('hashchange.owl.navigation')}},this),'prepared.owl.carousel':$.proxy(function(e){if(e.namespace){var hash=$(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash');if(!hash){return} this._hashes[hash]=e.content}},this),'changed.owl.carousel':$.proxy(function(e){if(e.namespace&&e.property.name==='position'){var current=this._core.items(this._core.relative(this._core.current())),hash=$.map(this._hashes,function(item,hash){return item===current?hash:null}).join();if(!hash||window.location.hash.slice(1)===hash){return} window.location.hash=hash}},this)};this._core.options=$.extend({},Hash.Defaults,this._core.options);this.$element.on(this._handlers);$(window).on('hashchange.owl.navigation',$.proxy(function(e){var hash=window.location.hash.substring(1),items=this._core.$stage.children(),position=this._hashes[hash]&&items.index(this._hashes[hash]);if(position===undefined||position===this._core.current()){return} this._core.to(this._core.relative(position),!1,!0)},this))};Hash.Defaults={URLhashListener:!1};Hash.prototype.destroy=function(){var handler,property;$(window).off('hashchange.owl.navigation');for(handler in this._handlers){this._core.$element.off(handler,this._handlers[handler])} for(property in Object.getOwnPropertyNames(this)){typeof this[property]!='function'&&(this[property]=null)}};$.fn.owlCarousel.Constructor.Plugins.Hash=Hash})(window.Zepto||window.jQuery,window,document);(function($,window,document,undefined){var style=$('').get(0).style,prefixes='Webkit Moz O ms'.split(' '),events={transition:{end:{WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd',transition:'transitionend'}},animation:{end:{WebkitAnimation:'webkitAnimationEnd',MozAnimation:'animationend',OAnimation:'oAnimationEnd',animation:'animationend'}}},tests={csstransforms:function(){return!!test('transform')},csstransforms3d:function(){return!!test('perspective')},csstransitions:function(){return!!test('transition')},cssanimations:function(){return!!test('animation')}};function test(property,prefixed){var result=!1,upper=property.charAt(0).toUpperCase()+property.slice(1);$.each((property+' '+prefixes.join(upper+' ')+upper).split(' '),function(i,property){if(style[property]!==undefined){result=prefixed?property:!0;return!1}});return result} function prefixed(property){return test(property,!0)} if(tests.csstransitions()){$.support.transition=new String(prefixed('transition')) $.support.transition.end=events.transition.end[$.support.transition]} if(tests.cssanimations()){$.support.animation=new String(prefixed('animation')) $.support.animation.end=events.animation.end[$.support.animation]} if(tests.csstransforms()){$.support.transform=new String(prefixed('transform'));$.support.transform3d=tests.csstransforms3d()}})(window.Zepto||window.jQuery,window,document);if(!('GOOGLETAID' in window))GOOGLETAID=!1;if(GOOGLETAID)$(window).load(function(){(function(i,s,o,g,r,a,m){i.GoogleAnalyticsObject=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');if(GOOGLETAID){ga('create',GOOGLETAID,'auto');ga('send','pageview')}});!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&ha(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==ka?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=na(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=ma(j.x)>ma(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===Aa||f.eventType===Ca)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Da&&(i>za||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=ma(l.x)>ma(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:la(c/b),y:la(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ea:ma(a)>=ma(b)?0>a?Fa:Ga:0>b?Ha:Ia}function H(a,b,c){c||(c=Ma);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Ma);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Na)+I(a[1],a[0],Na)}function K(a,b){return H(b[0],b[1],Na)/H(a[0],a[1],Na)}function L(){this.evEl=Pa,this.evWin=Qa,this.allow=!0,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Ta,this.evWin=Ua,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=Wa,this.evWin=Xa,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ca|Da)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=Za,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Aa|Ba)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Aa)for(e=0;eh&&(b.push(a),h=b.length-1):e&(Ca|Da)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Va={touchstart:Aa,touchmove:Ba,touchend:Ca,touchcancel:Da},Wa="touchstart",Xa="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Va[a.type];if(b===Aa&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ca|Da)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:va,srcEvent:a})}}});var Ya={touchstart:Aa,touchmove:Ba,touchend:Ca,touchcancel:Da},Za="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=Ya[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:va,srcEvent:a})}}),i(R,x,{handler:function(a,b,c){var d=c.pointerType==va,e=c.pointerType==xa;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Ca|Da)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var $a=u(ja.style,"touchAction"),_a=$a!==d,ab="compute",bb="auto",cb="manipulation",db="none",eb="pan-x",fb="pan-y";S.prototype={set:function(a){a==ab&&(a=this.compute()),_a&&this.manager.element.style&&(this.manager.element.style[$a]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),T(a.join(" "))},preventDefaults:function(a){if(!_a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,db),f=p(d,fb),g=p(d,eb);if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}if(!g||!f)return e||f&&c&Ja||g&&c&Ka?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var gb=1,hb=2,ib=4,jb=8,kb=jb,lb=16,mb=32;U.prototype={defaults:{},set:function(a){return ha(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=X(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=X(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=X(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=X(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;jb>d&&b(c.options.event+V(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=jb&&b(c.options.event+V(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=mb)},canEmit:function(){for(var a=0;af?Fa:Ga,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ea:0>g?Ha:Ia,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Y.prototype.attrTest.call(this,a)&&(this.state&hb||!(this.state&hb)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=W(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i($,Y,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[db]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&hb)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(_,U,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Ca|Da)&&!f)this.reset();else if(a.eventType&Aa)this.reset(),this._timer=e(function(){this.state=kb,this.tryEmit()},b.time,this);else if(a.eventType&Ca)return kb;return mb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===kb&&(a&&a.eventType&Ca?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=na(),this.manager.emit(this.options.event,this._input)))}}),i(aa,Y,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[db]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&hb)}}),i(ba,Y,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ja|Ka,pointers:1},getTouchAction:function(){return Z.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Ja|Ka)?b=a.overallVelocity:c&Ja?b=a.overallVelocityX:c&Ka&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&ma(b)>this.options.velocity&&a.eventType&Ca},emit:function(a){var b=W(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ca,U,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[cb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);(function(a){typeof define=="function"&&define.amd?define(["jquery"],a):typeof exports=="object"?a(require("jquery")):a(window.jQuery||window.Zepto)})(function(a){var b="Close",c="BeforeClose",d="AfterClose",e="BeforeAppend",f="MarkupParse",g="Open",h="Change",i="mfp",j="."+i,k="mfp-ready",l="mfp-removing",m="mfp-prevent-close",n,o=function(){},p=!!window.jQuery,q,r=a(window),s,t,u,v,w=function(a,b){n.ev.on(i+a+j,b)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(b,c){n.ev.triggerHandler(i+b,c),n.st.callbacks&&(b=b.charAt(0).toLowerCase()+b.slice(1),n.st.callbacks[b]&&n.st.callbacks[b].apply(n,a.isArray(c)?c:[c]))},z=function(b){if(b!==v||!n.currTemplate.closeBtn)n.currTemplate.closeBtn=a(n.st.closeMarkup.replace("%title%",n.st.tClose)),v=b;return n.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(n=new o,n.init(),a.magnificPopup.instance=n)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(a.transition!==undefined)return!0;while(b.length)if(b.pop()+"Transition"in a)return!0;return!1};o.prototype={constructor:o,init:function(){var b=navigator.appVersion;n.isLowIE=n.isIE8=document.all&&!document.addEventListener,n.isAndroid=/android/gi.test(b),n.isIOS=/iphone|ipad|ipod/gi.test(b),n.supportsTransition=B(),n.probablyMobile=n.isAndroid||n.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),s=a(document),n.popupsCache={}},open:function(b){var c;if(b.isObj===!1){n.items=b.items.toArray(),n.index=0;var d=b.items,e;for(c=0;c(a||r.height())},_setFocus:function(){(n.st.focus?n.content.find(n.st.focus).eq(0):n.wrap).focus()},_onFocusIn:function(b){if(b.target!==n.wrap[0]&&!a.contains(n.wrap[0],b.target))return n._setFocus(),!1},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(f,[b,c,d]),a.each(c,function(c,d){if(d===undefined||d===!1)return!0;e=c.split("_");if(e.length>1){var f=b.find(j+"-"+e[0]);if(f.length>0){var g=e[1];g==="replaceWith"?f[0]!==d[0]&&f.replaceWith(d):g==="img"?f.is("img")?f.attr("src",d):f.replaceWith(a("").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(j+"-"+c).html(d)})},_getScrollbarSize:function(){if(n.scrollbarSize===undefined){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),n.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return n.scrollbarSize}},a.magnificPopup={instance:null,proto:o.prototype,modules:[],open:function(b,c){return A(),b?b=a.extend(!0,{},b):b={},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(b){A();var c=a(this);if(typeof b=="string")if(b==="open"){var d,e=p?c.data("magnificPopup"):c[0].magnificPopup,f=parseInt(arguments[1],10)||0;e.items?d=e.items[f]:(d=c,e.delegate&&(d=d.find(e.delegate)),d=d.eq(f)),n._openClick({mfpEl:d},c,e)}else n.isOpen&&n[b].apply(n,Array.prototype.slice.call(arguments,1));else b=a.extend(!0,{},b),p?c.data("magnificPopup",b):c[0].magnificPopup=b,n.addGroup(c,b);return c};var C="inline",D,E,F,G=function(){F&&(E.after(F.addClass(D)).detach(),F=null)};a.magnificPopup.registerModule(C,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){n.types.push(C),w(b+"."+C,function(){G()})},getInline:function(b,c){G();if(b.src){var d=n.st.inline,e=a(b.src);if(e.length){var f=e[0].parentNode;f&&f.tagName&&(E||(D=d.hiddenClass,E=x(D),D="mfp-"+D),F=e.after(E).detach().removeClass(D)),n.updateStatus("ready")}else n.updateStatus("error",d.tNotFound),e=a("
");return b.inlineElement=e,e}return n.updateStatus("ready"),n._parseMarkup(c,{},b),c}}});var H="ajax",I,J=function(){I&&a(document.body).removeClass(I)},K=function(){J(),n.req&&n.req.abort()};a.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){n.types.push(H),I=n.st.ajax.cursor,w(b+"."+H,K),w("BeforeChange."+H,K)},getAjax:function(b){I&&a(document.body).addClass(I),n.updateStatus("loading");var c=a.extend({url:b.src,success:function(c,d,e){var f={data:c,xhr:e};y("ParseAjax",f),n.appendContent(a(f.data),H),b.finished=!0,J(),n._setFocus(),setTimeout(function(){n.wrap.addClass(k)},16),n.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),b.finished=b.loadError=!0,n.updateStatus("error",n.st.ajax.tError.replace("%url%",b.src))}},n.st.ajax.settings);return n.req=a.ajax(c),""}}});var L,M=function(b){if(b.data&&b.data.title!==undefined)return b.data.title;var c=n.st.image.titleSrc;if(c){if(a.isFunction(c))return c.call(n,b);if(b.el)return b.el.attr(c)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var c=n.st.image,d=".image";n.types.push("image"),w(g+d,function(){n.currItem.type==="image"&&c.cursor&&a(document.body).addClass(c.cursor)}),w(b+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),r.off("resize"+j)}),w("Resize"+d,n.resizeImage),n.isLowIE&&w("AfterChange",n.resizeImage)},resizeImage:function(){var a=n.currItem;if(!a||!a.img)return;if(n.st.image.verticalFit){var b=0;n.isLowIE&&(b=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",n.wH-b)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(n.content&&n.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var b=0,c=a.img[0],d=function(e){L&&clearInterval(L),L=setInterval(function(){if(c.naturalWidth>0){n._onImageHasSize(a);return}b>200&&clearInterval(L),b++,b===3?d(10):b===40?d(50):b===100&&d(500)},e)};d(1)},getImage:function(b,c){var d=0,e=function(){b&&(b.img[0].complete?(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("ready")),b.hasSize=!0,b.loaded=!0,y("ImageLoadComplete")):(d++,d<200?setTimeout(e,100):f()))},f=function(){b&&(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("error",g.tError.replace("%url%",b.src))),b.hasSize=!0,b.loaded=!0,b.loadError=!0)},g=n.st.image,h=c.find(".mfp-img");if(h.length){var i=document.createElement("img");i.className="mfp-img",b.el&&b.el.find("img").length&&(i.alt=b.el.find("img").attr("alt")),b.img=a(i).on("load.mfploader",e).on("error.mfploader",f),i.src=b.src,h.is("img")&&(b.img=b.img.clone()),i=b.img[0],i.naturalWidth>0?b.hasSize=!0:i.width||(b.hasSize=!1)}return n._parseMarkup(c,{title:M(b),img_replaceWith:b.img},b),n.resizeImage(),b.hasSize?(L&&clearInterval(L),b.loadError?(c.addClass("mfp-loading"),n.updateStatus("error",g.tError.replace("%url%",b.src))):(c.removeClass("mfp-loading"),n.updateStatus("ready")),c):(n.updateStatus("loading"),b.loading=!0,b.hasSize||(b.imgHidden=!0,c.addClass("mfp-loading"),n.findImageSize(b)),c)}}});var N,O=function(){return N===undefined&&(N=document.createElement("p").style.MozTransform!==undefined),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a=n.st.zoom,d=".zoom",e;if(!a.enabled||!n.supportsTransition)return;var f=a.duration,g=function(b){var c=b.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+a.duration/1e3+"s "+a.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,c.css(e),c},h=function(){n.content.css("visibility","visible")},i,j;w("BuildControls"+d,function(){if(n._allowZoom()){clearTimeout(i),n.content.css("visibility","hidden"),e=n._getItemToZoom();if(!e){h();return}j=g(e),j.css(n._getOffset()),n.wrap.append(j),i=setTimeout(function(){j.css(n._getOffset(!0)),i=setTimeout(function(){h(),setTimeout(function(){j.remove(),e=j=null,y("ZoomAnimationEnded")},16)},f)},16)}}),w(c+d,function(){if(n._allowZoom()){clearTimeout(i),n.st.removalDelay=f;if(!e){e=n._getItemToZoom();if(!e)return;j=g(e)}j.css(n._getOffset(!0)),n.wrap.append(j),n.content.css("visibility","hidden"),setTimeout(function(){j.css(n._getOffset())},16)}}),w(b+d,function(){n._allowZoom()&&(h(),j&&j.remove(),e=null)})},_allowZoom:function(){return n.currItem.type==="image"},_getItemToZoom:function(){return n.currItem.hasSize?n.currItem.img:!1},_getOffset:function(b){var c;b?c=n.currItem.img:c=n.st.zoom.opener(n.currItem.el||n.currItem);var d=c.offset(),e=parseInt(c.css("padding-top"),10),f=parseInt(c.css("padding-bottom"),10);d.top-=a(window).scrollTop()-e;var g={width:c.width(),height:(p?c.innerHeight():c[0].offsetHeight)-f-e};return O()?g["-moz-transform"]=g.transform="translate("+d.left+"px,"+d.top+"px)":(g.left=d.left,g.top=d.top),g}}});var P="iframe",Q="//about:blank",R=function(a){if(n.currTemplate[P]){var b=n.currTemplate[P].find("iframe");b.length&&(a||(b[0].src=Q),n.isIE8&&b.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){n.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(b+"."+P,function(){R()})},getIframe:function(b,c){var d=b.src,e=n.st.iframe;a.each(e.patterns,function(){if(d.indexOf(this.index)>-1)return this.id&&(typeof this.id=="string"?d=d.substr(d.lastIndexOf(this.id)+this.id.length,d.length):d=this.id.call(this,d)),d=this.src.replace("%id%",d),!1});var f={};return e.srcAction&&(f[e.srcAction]=d),n._parseMarkup(c,f,b),n.updateStatus("ready"),c}}});var S=function(a){var b=n.items.length;return a>b-1?a-b:a<0?b+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=n.st.gallery,d=".mfp-gallery";n.direction=!0;if(!c||!c.enabled)return!1;u+=" mfp-gallery",w(g+d,function(){c.navigateByImgClick&&n.wrap.on("click"+d,".mfp-img",function(){if(n.items.length>1)return n.next(),!1}),s.on("keydown"+d,function(a){a.keyCode===37?n.prev():a.keyCode===39&&n.next()})}),w("UpdateStatus"+d,function(a,b){b.text&&(b.text=T(b.text,n.currItem.index,n.items.length))}),w(f+d,function(a,b,d,e){var f=n.items.length;d.counter=f>1?T(c.tCounter,e.index,f):""}),w("BuildControls"+d,function(){if(n.items.length>1&&c.arrows&&!n.arrowLeft){var b=c.arrowMarkup,d=n.arrowLeft=a(b.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(m),e=n.arrowRight=a(b.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(m);d.click(function(){n.prev()}),e.click(function(){n.next()}),n.container.append(d.add(e))}}),w(h+d,function(){n._preloadTimeout&&clearTimeout(n._preloadTimeout),n._preloadTimeout=setTimeout(function(){n.preloadNearbyImages(),n._preloadTimeout=null},16)}),w(b+d,function(){s.off(d),n.wrap.off("click"+d),n.arrowRight=n.arrowLeft=null})},next:function(){n.direction=!0,n.index=S(n.index+1),n.updateItemHTML()},prev:function(){n.direction=!1,n.index=S(n.index-1),n.updateItemHTML()},goTo:function(a){n.direction=a>=n.index,n.index=a,n.updateItemHTML()},preloadNearbyImages:function(){var a=n.st.gallery.preload,b=Math.min(a[0],n.items.length),c=Math.min(a[1],n.items.length),d;for(d=1;d<=(n.direction?c:b);d++)n._preloadItem(n.index+d);for(d=1;d<=(n.direction?b:c);d++)n._preloadItem(n.index-d)},_preloadItem:function(b){b=S(b);if(n.items[b].preloaded)return;var c=n.items[b];c.parsed||(c=n.parseEl(b)),y("LazyLoad",c),c.type==="image"&&(c.img=a('').on("load.mfploader",function(){c.hasSize=!0}).on("error.mfploader",function(){c.hasSize=!0,c.loadError=!0,y("LazyLoadError",c)}).attr("src",c.src)),c.preloaded=!0}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=n.st.retina,b=a.ratio;b=isNaN(b)?b():b,b>1&&(w("ImageHasSize."+U,function(a,c){c.img.css({"max-width":c.img[0].naturalWidth/b,width:"100%"})}),w("ElementParse."+U,function(c,d){d.src=a.replaceSrc(d,b)}))}}}}),A()});function DevObjTools(map){var self=$(map).data('mapplic');this.checkObject=function(selector,center){if($(selector).length){$(self.container).find(".mapplic-layer").show();var obj=self.container.find(selector);var width=$(obj).get(0).getBoundingClientRect().width;var height=$(obj).get(0).getBoundingClientRect().height;var x=($(obj).offset().left+(center?width/2:0)-self.map.offset().left)/self.map.width(),y=($(obj).offset().top+(center?height/2:0)-self.map.offset().top)/self.map.height();return{x:parseFloat(x).toFixed(4),y:parseFloat(y).toFixed(4),}}else{return{x:0,y:0}}};return this};(function($){"use strict";var Mapplic=function(element){var self=this;self.o={source:'locations.json',selector:'[id^=landmark] > *',landmark:!1,mapfill:!1,height:420,markers:!0,minimap:!0,sidebar:!0,search:!0,deeplinking:!0,clearbutton:!0,zoombuttons:!0,action:'tooltip',lightbox:!1,hovertip:{desc:!1},tooltip:{thumb:!0,desc:!0,link:!0},smartip:!0,fillcolor:'#4d5e6d',fullscreen:!0,developer:!1,mousewheel:!0,maxscale:4,skin:'',zoom:!0};self.el=element;self.init=function(options){self.o=$.extend(self.o,options);self.x=0;self.y=0;self.scale=1;self.el.addClass('mapplic-element mapplic-loading').addClass(self.o.skin).height(self.o.height);if(self.o.landmark){self.o.sidebar=!1;self.o.zoombuttons=!1;self.o.deeplinking=!1} if(typeof self.o.source==='string'){$.getJSON(self.o.source,function(data){processData(data);self.el.removeClass('mapplic-loading')}).fail(function(){console.error('Couldn\'t load map data. (Make sure to run the script through a web server and not just open the html file in a browser directly)');self.el.removeClass('mapplic-loading').addClass('mapplic-error');alert('Data file missing or invalid!\nMake sure to run the script through web server.')})} else{processData(self.o.source);self.el.removeClass('mapplic-loading')} return self} function Tooltip(){this.el=null;this.pin=null;this.shift=6;this.drop=0;this.location=null;this.init=function(){var s=this;this.el=$('
').addClass('mapplic-tooltip');this.close=$('').addClass('mapplic-tooltip-close').attr('href','#').appendTo(this.el);this.close.on('click touchend',function(e){e.preventDefault();self.hideLocation();if(!self.o.zoom)self.moveTo(0.5,0.5,1,600,'easeInOutCubic')});if(self.o.tooltip.thumb)this.thumbnail=$('').addClass('mapplic-tooltip-thumbnail').hide().appendTo(this.el);this.content=$('
').addClass('mapplic-tooltip-content').appendTo(this.el);this.title=$('

').addClass('mapplic-tooltip-title').appendTo(this.content);if(self.o.tooltip.desc)this.desc=$('
').addClass('mapplic-tooltip-description').appendTo(this.content);if(self.o.tooltip.link)this.link=$('More').addClass('mapplic-popup-link').attr('href','#').hide().appendTo(this.el);this.triangle=$('
').addClass('mapplic-tooltip-triangle').prependTo(this.el);self.map.append(this.el)} this.show=function(location){if(location){var s=this;this.location=location;if(self.hovertip)self.hovertip.hide();if(self.o.tooltip.thumb){if(location.thumbnail)this.thumbnail.attr('src',location.thumbnail).show();else this.thumbnail.hide()} if(self.o.tooltip.link){if(location.link)this.link.attr('href',location.link).show();else this.link.hide()} this.title.html(location.title);if(self.o.tooltip.desc)this.desc.html(location.description);this.content[0].scrollTop=0;this.pin=$('.mapplic-pin[data-location="'+location.id+'"]');if(this.pin.length==0){this.shift=20} else this.shift=Math.abs(parseFloat(this.pin.css('margin-top')))+20;$('img',this.el).off('load').load(function(){s.position();s.zoom(location)});this.position();this.el.stop().show();this.zoom(location)}} this.position=function(){if(this.location){var cx=self.map.offset().left+self.map.width()*this.location.x-self.container.offset().left,cy=self.map.offset().top+self.map.height()*this.location.y-self.container.offset().top;var x=this.location.x*100,y=this.location.y*100,mt=-this.el.outerHeight()-this.shift,ml=-this.el.outerWidth()/2;if(self.o.smartip){var verticalPos=0.5;if(Math.abs(mt)>cy){mt=8+2;if(this.pin&&this.pin.length)mt=this.pin.height()+parseFloat(this.pin.css('margin-top'))+20;this.el.addClass('mapplic-bottom')} else this.el.removeClass('mapplic-bottom');if(this.el.outerWidth()/2>cx) verticalPos=0.5-(this.el.outerWidth()/2-cx)/this.el.outerWidth();else if((self.container.width()-cx-this.el.outerWidth()/2)<0) verticalPos=0.5+(cx+this.el.outerWidth()/2-self.container.width())/this.el.outerWidth();verticalPos=Math.max(0,Math.min(1,verticalPos));ml=-this.el.outerWidth()*verticalPos;this.triangle.css('left',Math.max(5,Math.min(95,verticalPos*100))+'%')} this.el.css({left:x+'%',top:y+'%',marginTop:mt,marginLeft:ml});this.drop=this.el.outerHeight()+this.shift}} this.zoom=function(location){var ry=0.5,zoom=location.zoom?parseFloat(location.zoom):self.o.maxscale;ry=((self.container.height()-this.drop)/2+this.drop)/self.container.height();self.moveTo(location.x,location.y,zoom,600,'easeInOutCubic',ry)} this.hide=function(){var s=this;this.location=null;this.el.stop().fadeOut(300,function(){if(s.desc)s.desc.empty()})}} function Lightbox(){this.el=null;this.init=function(){this.el=$('
').addClass('mapplic-lightbox mfp-hide');this.title=$('

').addClass('mapplic-lightbox-title').appendTo(this.el);this.desc=$('
').addClass('mapplic-lightbox-description').appendTo(this.el);this.link=$('More').addClass('mapplic-popup-link').attr('href','#').hide().appendTo(this.el);$('body').magnificPopup({delegate:'.mapplic-popup-image',type:'image',removalDelay:300,mainClass:'mfp-fade'});self.el.append(this.el)} this.show=function(location){this.location=location;this.title.html(location.title);this.desc.html(location.description);if(location.link)this.link.attr('href',location.link).show();else this.link.hide();var s=this;$.magnificPopup.open({items:{src:this.el},type:'inline',removalDelay:300,mainClass:'mfp-fade',callbacks:{beforeClose:function(){s.hide()}}});var zoom=location.zoom?location.zoom:self.o.maxscale;self.moveTo(location.x,location.y,zoom,600,'easeInOutCubic');if(self.tooltip)self.tooltip.hide()} this.hide=function(){this.location=null;self.hideLocation()}} function HoverTooltip(){this.el=null;this.pin=null;this.shift=6;this.init=function(){var s=this;this.el=$('
').addClass('mapplic-tooltip mapplic-hovertip');this.title=$('

').addClass('mapplic-tooltip-title').appendTo(this.el);if(self.o.hovertip.desc)this.desc=$('
').addClass('mapplic-tooltip-description').appendTo(this.el);this.triangle=$('
').addClass('mapplic-tooltip-triangle').appendTo(this.el);$(self.map).on('mouseover','.mapplic-layer a',function(){var id='';if($(this).hasClass('mapplic-pin')){id=$(this).data('location');s.pin=$('.mapplic-pin[data-location="'+id+'"]');s.shift=Math.abs(parseFloat(s.pin.css('margin-top')))+20} else{id=$(this).attr('xlink:href').slice(1);s.shift=20} var location=self.getLocationData(id);if(location)s.show(location)}).on('mouseout',function(){s.hide()});if(self.o.selector){$(self.map).on('mouseover',self.o.selector,function(){var location=self.getLocationData($(this).attr('id'));s.shift=20;if(location)s.show(location)}).on('mouseout',function(){s.hide()})} self.map.append(this.el)} this.show=function(location){if(self.tooltip.location!=location){this.title.html(location.title);if(self.o.hovertip.desc)this.desc.html(location.description);this.position(location);this.el.stop(!0).fadeIn(0)}} this.position=function(location){var cx=self.map.offset().left+self.map.width()*location.x-self.container.offset().left,cy=self.map.offset().top+self.map.height()*location.y-self.container.offset().top;var x=location.x*100,y=location.y*100,mt=-this.el.outerHeight()-this.shift,ml=0;var verticalPos=0.5;if(Math.abs(mt)>cy){mt=8+2;if(this.pin&&this.pin.length)mt=this.pin.height()+parseFloat(this.pin.css('margin-top'))+20;this.el.addClass('mapplic-bottom')} else this.el.removeClass('mapplic-bottom');if(this.el.outerWidth()/2>cx) verticalPos=0.5-(this.el.outerWidth()/2-cx)/this.el.outerWidth();else if((self.container.width()-cx-this.el.outerWidth()/2)<0) verticalPos=0.5+(cx+this.el.outerWidth()/2-self.container.width())/this.el.outerWidth();ml=-this.el.outerWidth()*verticalPos;this.triangle.css('left',Math.max(10,Math.min(90,verticalPos*100))+'%');this.el.css({left:x+'%',top:y+'%',marginTop:mt,marginLeft:ml})} this.hide=function(){this.el.stop(!0).fadeOut(0)}} function Deeplinking(){this.param='location';this.init=function(){var s=this;this.check(0);window.onpopstate=function(e){if(e.state){s.check(600)} return!1}} this.check=function(easing){var id=this.getUrlParam(this.param);self.showLocation(id,easing,!0)} this.getUrlParam=function(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return results===null?"":decodeURIComponent(results[1].replace(/\+/g," "))} this.update=function(id){var url=window.location.protocol+"//"+window.location.host+window.location.pathname+'?'+this.param+'='+id} this.clear=function(){}} function DeeplinkingHash(){this.param='location';this.init=function(){var s=this;this.check(0);$(window).on('hashchange',function(){s.check(600)})} this.check=function(easing){var id=location.hash.slice(this.param.length+2);self.showLocation(id,easing,!0)} this.update=function(id){window.location.hash=this.param+'-'+id} this.clear=function(){window.location.hash=this.param}} function Minimap(){this.el=null;this.opacity=null;this.init=function(){this.el=$('
').addClass('mapplic-minimap').appendTo(self.container);this.el.click(function(e){e.preventDefault();var x=(e.pageX-$(this).offset().left)/$(this).width(),y=(e.pageY-$(this).offset().top)/$(this).height();self.moveTo(x,y,self.scale/self.fitscale,100)})} this.addLayer=function(data){var layer=$('
').addClass('mapplic-minimap-layer').addClass(data.id).appendTo(this.el),s=this;$('').attr('src',data.minimap).addClass('mapplic-minimap-background').appendTo(layer);$('
').addClass('mapplic-minimap-overlay').appendTo(layer);$('').attr('src',data.minimap).addClass('mapplic-minimap-active').load(function(){s.update();$(this).addClass('mapplic-clip-transition')}).appendTo(layer)} this.show=function(target){$('.mapplic-minimap-layer',this.el).hide();$('.mapplic-minimap-layer.'+target,this.el).show()} this.update=function(x,y){var active=$('.mapplic-minimap-active',this.el);if(x===undefined)x=self.x;if(y===undefined)y=self.y;var width=Math.round(self.container.width()/self.contentWidth/self.scale*this.el.width()),height=Math.round(self.container.height()/self.contentHeight/self.scale*this.el.height()),top=Math.round(-y/self.contentHeight/self.scale*this.el.height()),left=Math.round(-x/self.contentWidth/self.scale*this.el.width()),right=left+width,bottom=top+height;active.each(function(){$(this)[0].style.clip='rect('+top+'px, '+right+'px, '+bottom+'px, '+left+'px)'});var s=this;this.el.show();this.el.css('opacity',1.0);clearTimeout(this.opacity);this.opacity=setTimeout(function(){s.el.css('opacity',0);setTimeout(function(){s.el.hide()},600)},2000)}} function Sidebar(){this.el=null;this.list=null;this.init=function(){var s=this;this.el=$('
').addClass('mapplic-sidebar').appendTo(self.el);if(self.o.search){var form=$('
').addClass('mapplic-search-form').submit(function(){return!1}).appendTo(this.el);self.clear=$('').attr('type','button').addClass('mapplic-search-clear').click(function(){input.val('');input.keyup()}).appendTo(form);var input=$('').attr({'type':'text','spellcheck':'false','placeholder':'Search...'}).addClass('mapplic-search-input').keyup(function(){var keyword=$(this).val();s.search(keyword)}).prependTo(form)} var listContainer=$('
').addClass('mapplic-list-container').appendTo(this.el);this.list=$('
    ').addClass('mapplic-list').appendTo(listContainer);this.notfound=$('

    ').addClass('mapplic-not-found').text('Nothing found. Please try a different search.').appendTo(listContainer);if(!self.o.search)listContainer.css('padding-top','0')} this.addCategories=function(categories){var list=this.list;if(categories){$.each(categories,function(index,category){var item=$('
  1. ').addClass('mapplic-list-category').attr('data-category',category.id);var ol=$('
      ').css('border-color',category.color).appendTo(item);if(category.show=='false')ol.hide();else item.addClass('mapplic-opened');var link=$('').attr('href','#').attr('title',category.title).css('background-color',category.color).text(category.title).prependTo(item);link.on('click',function(e){e.preventDefault();item.toggleClass('mapplic-opened');ol.slideToggle(200)});if(category.icon)$('').attr('src',category.icon).addClass('mapplic-list-thumbnail').prependTo(link);$('').text('0').addClass('mapplic-list-count').prependTo(link);list.append(item)})}} this.addLocation=function(data){var item=$('
    1. ').addClass('mapplic-list-location').addClass('mapplic-list-shown').attr('data-location',data.id);var link=$('').attr('href','#').click(function(e){e.preventDefault();self.showLocation(data.id,600);if($(window).width()<668){$('html, body').animate({scrollTop:self.container.offset().top},400)}}).appendTo(item);if(data.thumbnail)$('').attr('src',data.thumbnail).addClass('mapplic-list-thumbnail').appendTo(link);$('

      ').html(data.title).appendTo(link) $('').html(data.about).appendTo(link);var category=$('.mapplic-list-category[data-category="'+data.category+'"]');if(category.length)$('ol',category).append(item);else this.list.append(item);$('.mapplic-list-count',category).text($('.mapplic-list-shown',category).length)} this.search=function(keyword){if(keyword)self.clear.fadeIn(100);else self.clear.fadeOut(100);$('.mapplic-list li',self.el).each(function(){if($(this).text().search(new RegExp(keyword,"i"))<0){$(this).removeClass('mapplic-list-shown');$(this).slideUp(200)}else{$(this).addClass('mapplic-list-shown');$(this).show()}});$('.mapplic-list > li',self.el).each(function(){var count=$('.mapplic-list-shown',this).length;$('.mapplic-list-count',this).text(count)});if($('.mapplic-list > li.mapplic-list-shown').length>0)this.notfound.fadeOut(200);else this.notfound.fadeIn(200)}} function DevTools(){this.el=null;this.init=function(){this.el=$('
      ').addClass('mapplic-coordinates').appendTo(self.container);this.el.append('x: ');$('').addClass('mapplic-coordinates-x').appendTo(this.el);this.el.append(' y: ');$('').addClass('mapplic-coordinates-y').appendTo(this.el);$('.mapplic-layer',self.map).on('mousemove',function(e){var x=(e.pageX-self.map.offset().left)/self.map.width(),y=(e.pageY-self.map.offset().top)/self.map.height();$('.mapplic-coordinates-x').text(parseFloat(x).toFixed(4));$('.mapplic-coordinates-y').text(parseFloat(y).toFixed(4))})}} function ClearButton(){this.el=null;this.init=function(){this.el=$('').attr('href','#').addClass('mapplic-clear-button').appendTo(self.container);this.el.on('click touchstart',function(e){e.preventDefault();self.hideLocation();self.moveTo(0.5,0.5,1,400,'easeInOutCubic')})}} function ZoomButtons(){this.el=null;this.init=function(){this.el=$('
      ').addClass('mapplic-zoom-buttons').appendTo(self.container);this.zoomin=$('').attr('href','#').addClass('mapplic-zoomin-button').appendTo(this.el);this.zoomin.on('click touchstart',function(e){e.preventDefault();var scale=self.scale;self.scale=normalizeScale(scale+scale*0.8);self.x=normalizeX(self.x-(self.container.width()/2-self.x)*(self.scale/scale-1));self.y=normalizeY(self.y-(self.container.height()/2-self.y)*(self.scale/scale-1));zoomTo(self.x,self.y,self.scale,400,'easeInOutCubic')});this.zoomout=$('').attr('href','#').addClass('mapplic-zoomout-button').appendTo(this.el);this.zoomout.on('click touchstart',function(e){e.preventDefault();var scale=self.scale;self.scale=normalizeScale(scale-scale*0.4);self.x=normalizeX(self.x-(self.container.width()/2-self.x)*(self.scale/scale-1));self.y=normalizeY(self.y-(self.container.height()/2-self.y)*(self.scale/scale-1));zoomTo(self.x,self.y,self.scale,400,'easeInOutCubic')})} this.update=function(scale){this.zoomin.removeClass('mapplic-disabled');this.zoomout.removeClass('mapplic-disabled');if(scale==self.fitscale)this.zoomout.addClass('mapplic-disabled');else if(scale==self.o.maxscale)this.zoomin.addClass('mapplic-disabled')}} function FullScreen(){this.el=null;this.init=function(){var s=this;this.element=self.el[0];$('').attr('href','#').attr('href','#').addClass('mapplic-fullscreen-button').click(function(e){e.preventDefault();if(s.isFull())s.exitFull();else s.goFull()}).appendTo(self.container)} this.goFull=function(){if(this.element.requestFullscreen)this.element.requestFullscreen();else if(this.element.mozRequestFullScreen)this.element.mozRequestFullScreen();else if(this.element.webkitRequestFullscreen)this.element.webkitRequestFullscreen();else if(this.element.msRequestFullscreen)this.element.msRequestFullscreen()} this.exitFull=function(){if(document.exitFullscreen)document.exitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen()} this.isFull=function(){if(window.innerHeight==screen.height)return!0;else return!1}} var processData=function(data){self.data=data;var shownLevel=null;self.container=$('
      ').addClass('mapplic-container').appendTo(self.el);self.map=$('
      ').addClass('mapplic-map').appendTo(self.container);if(self.o.zoom)self.map.addClass('mapplic-zoomable');self.levelselect=$('').addClass('mapplic-levels-select');self.contentWidth=parseFloat(data.mapwidth);self.contentHeight=parseFloat(data.mapheight);if(self.o.minimap){self.minimap=new Minimap();self.minimap.init()} if(self.o.sidebar){self.sidebar=new Sidebar();self.sidebar.init();self.sidebar.addCategories(data.categories)} else self.container.css('width','100%');var nrlevels=0;if(data.levels){var totalMaps=data.levels.length;var loadedMaps=0;var callbackOnAllMapsLoaded=function(){loadedMaps++;if(totalMaps==loadedMaps){self.el.trigger('maploaded',self)}};$.each(data.levels,function(index,level){var source=level.map,extension=source.substr((source.lastIndexOf('.')+1)).toLowerCase();var layer=$('
      ').addClass('mapplic-layer').attr('data-floor',level.id).hide().appendTo(self.map);switch(extension){case 'jpg':case 'jpeg':case 'png':case 'gif':$('').attr('src',source).addClass('mapplic-map-image').appendTo(layer);break;case 'svg':$('
      ').addClass('mapplic-map-image').load(source,function(){$(self.o.selector,this).each(function(){var location=self.getLocationData($(this).attr('id'));if(location){$(this).attr('class','mapplic-clickable');location.el=$(this);var fill=null;if(location.fill)fill=location.fill;else if(self.o.fillcolor)fill=self.o.fillcolor if(fill){$(this).css('fill',fill);$('> *',this).css('fill',fill)} if(self.o.landmark===location.id)$(this).attr('class','mapplic-active')}});$(self.o.selector,this).on('click touchend',function(){if(!self.dragging)self.showLocation($(this).attr('id'),600)});$('svg a',this).each(function(){var location=self.getLocationData($(this).attr('xlink:href').substr(1));if(location){$(this).attr('class','mapplic-clickable');location.el=$(this)}});$('svg a',this).click(function(e){var id=$(this).attr('xlink:href').substr(1);self.showLocation(id,600);e.preventDefault()});callbackOnAllMapsLoaded()}).appendTo(layer);break;default:alert('File type '+extension+' is not supported!')} if(self.minimap)self.minimap.addLayer(level);self.levelselect.prepend($('').attr('value',level.id).text(level.title));if(!shownLevel||level.show)shownLevel=level.id;$.each(level.locations,function(index,location){if(location.lat&&location.lng){var pos=latlngToPos(location.lat,location.lng);location.x=pos.x;location.y=pos.y} var top=location.y*100,left=location.x*100;if(!location.pin)location.pin='default';if(location.pin.indexOf('hidden')==-1){if(self.o.markers){var pin=$('').attr('href','#').addClass('mapplic-pin').css({'top':top+'%','left':left+'%'}).appendTo(layer);pin.on('click touchend',function(e){e.preventDefault();self.showLocation(location.id,600)});if(location.label)pin.html(location.label);if(location.fill)pin.css('background-color',location.fill);pin.attr('data-location',location.id);pin.addClass(location.pin);location.el=pin}} if(self.sidebar)self.sidebar.addLocation(location)});nrlevels++})} self.tooltip=new Tooltip();self.tooltip.init();if(self.o.lightbox){self.lightbox=new Lightbox();self.lightbox.init()} if(self.o.hovertip){self.hovertip=new HoverTooltip();self.hovertip.init()} if(self.o.developer)self.devtools=new DevTools().init();if(self.o.clearbutton)self.clearbutton=new ClearButton().init();if(self.o.zoombuttons){self.zoombuttons=new ZoomButtons();self.zoombuttons.init();if(!self.o.clearbutton)self.zoombuttons.el.css('bottom','0')} if(self.o.fullscreen)self.fullscreen=new FullScreen().init();if(nrlevels>1){self.levels=$('
      ').addClass('mapplic-levels');var up=$('').addClass('mapplic-levels-up').appendTo(self.levels);self.levelselect.appendTo(self.levels);var down=$('').addClass('mapplic-levels-down').appendTo(self.levels);self.container.append(self.levels);self.levelselect.change(function(){var value=$(this).val();self.switchLevel(value)});up.click(function(e){e.preventDefault();if(!$(this).hasClass('mapplic-disabled'))self.switchLevel('+')});down.click(function(e){e.preventDefault();if(!$(this).hasClass('mapplic-disabled'))self.switchLevel('-')})} self.switchLevel(shownLevel);$(window).resize(function(){if($(window).width()<668){var height=Math.min(Math.max(self.container.width()*self.contentHeight/self.contentWidth,$(window).height()*2/3),$(window).height()-66);self.container.height(height)} else self.container.height('100%');var wr=self.container.width()/self.contentWidth,hr=self.container.height()/self.contentHeight;if(self.o.mapfill){if(wr>hr)self.fitscale=wr;else self.fitscale=hr} else{if(wr-1)} var normalizeX=function(x){var minX=self.container.width()-self.contentWidth*self.scale;if(minX<0){if(x>0)x=0;else if(x=0)y=0;else if(yself.o.maxscale)scale=self.o.maxscale;if(self.zoombuttons)self.zoombuttons.update(scale);return scale} var zoomTo=function(x,y,scale,d,easing){if(scale!==undefined){self.map.stop().animate({'left':x,'top':y,'width':self.contentWidth*scale,'height':self.contentHeight*scale},d,easing,function(){if(self.tooltip)self.tooltip.position()})} else{self.map.css({'left':x,'top':y})} if(self.tooltip)self.tooltip.position();if(self.minimap)self.minimap.update(x,y);self.el.trigger('positionchanged',self)} self.switchLevel=function(target){switch(target){case '+':target=$('option:selected',self.levelselect).removeAttr('selected').prev().prop('selected','selected').val();break;case '-':target=$('option:selected',self.levelselect).removeAttr('selected').next().prop('selected','selected').val();break;default:$('option[value="'+target+'"]',self.levelselect).prop('selected','selected')} if(!target)return;var layer=$('.mapplic-layer[data-floor="'+target+'"]',self.el);if(layer.is(':visible'))return;if(self.tooltip)self.tooltip.hide();$('.mapplic-layer:visible',self.map).hide();layer.show();if(self.minimap)self.minimap.show(target);var index=self.levelselect.get(0).selectedIndex,up=$('.mapplic-levels-up',self.el),down=$('.mapplic-levels-down',self.el);up.removeClass('mapplic-disabled');down.removeClass('mapplic-disabled');if(index==0)up.addClass('mapplic-disabled');else if(index==self.levelselect.get(0).length-1)down.addClass('mapplic-disabled');self.el.trigger('levelswitched',target)} self.moveTo=function(x,y,s,duration,easing,ry){duration=typeof duration!=='undefined'?duration:400;ry=typeof ry!=='undefined'?ry:0.5;s=typeof s!=='undefined'?s:self.scale/self.fitscale;self.scale=normalizeScale(self.fitscale*s);self.x=normalizeX(self.container.width()*0.5-self.scale*self.contentWidth*x);self.y=normalizeY(self.container.height()*ry-self.scale*self.contentHeight*y);zoomTo(self.x,self.y,self.scale,duration,easing)} self.getLocationData=function(id){var data=null;$.each(self.data.levels,function(index,level){$.each(level.locations,function(index,location){if(location.id==id){data=location}})});return data} self.showLocation=function(id,duration,check){$.each(self.data.levels,function(index,level){if(level.id==id){self.switchLevel(level.id);return!1} $.each(level.locations,function(index,location){if(location.id==id){var action=(location.action&&location.action!='default')?location.action:self.o.action;switch(action){case 'open-link':window.location.href=location.link;return!1;case 'open-link-new-tab':window.open(location.link);return!1;case 'select':if(location.el){if(hasClass(location.el,'mapplic-active'))removeClass(location.el,'mapplic-active');else addClass(location.el,'mapplic-active')} return!1;case 'none':var zoom=location.zoom?location.zoom:self.o.maxscale;self.moveTo(location.x,location.y,zoom,600,'easeInOutCubic');break;case 'lightbox':self.switchLevel(level.id);self.lightbox.show(location);break;default:self.switchLevel(level.id);self.tooltip.show(location)} removeClass($('.mapplic-active',self.el),'mapplic-active');if(location.el)addClass(location.el,'mapplic-active');if((self.o.deeplinking)&&(!check))self.deeplinking.update(id);self.el.trigger('locationopened',location)}})})} self.hideLocation=function(){removeClass($('.mapplic-active',self.el),'mapplic-active');if(self.deeplinking)self.deeplinking.clear();if(self.tooltip)self.tooltip.hide();self.el.trigger('locationclosed')} self.updateLocation=function(id){var location=self.getLocationData(id);if((location.id==id)&&(location.el.is('a'))){if(location.lat&&location.lng){var pos=latlngToPos(location.lat,location.lng);location.x=pos.x;location.y=pos.y} var top=location.y*100,left=location.x*100;location.el.css({'top':top+'%','left':left+'%'})}}};$.extend($.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b}});$.fn.mapplic=function(options){return this.each(function(){var element=$(this);if(element.data('mapplic'))return;var instance=(new Mapplic(element)).init(options);element.data('mapplic',instance)})}})(jQuery)