(function(d){function e(a,b){if(this instanceof e)this.id=e.id++,this.setup(a,b),this.chainCallbacks(e._callbackChain);else{var c=new e(a,b);c.open();return c}}if("undefined"===typeof d)"console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery.");else{var g=function(a){if(!a.isDefaultPrevented()){var b=e.current();if(b)b.onKeyDown(a)}};e.prototype={constructor:e,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",
closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",otherClose:null,beforeOpen:d.noop,beforeContent:d.noop,beforeClose:d.noop,afterOpen:d.noop,afterContent:d.noop,afterClose:d.noop,onKeyDown:d.noop,type:null,contentFilters:["jquery","image","html","ajax","text"],setup:function(a,b){"object"!==typeof a||!1!==a instanceof d||b||(b=a,a=void 0);var c=d.extend(this,b,{target:a}),f=c.resetCss?c.namespace+"-reset":c.namespace,
f=d(c.background||['<div class="'+f+'">','<div class="'+f+'-content">','<span class="'+f+"-close-icon "+c.namespace+'-close">',c.closeIcon,"</span>",'<div class="'+c.namespace+'-inner"></div>',"</div></div>"].join("")),e="."+c.namespace+"-close"+(c.otherClose?","+c.otherClose:"");c.$instance=f.clone().addClass(c.variant);c.$instance.on(c.closeTrigger+"."+c.namespace,function(a){var b=d(a.target);if("background"===c.closeOnClick&&b.is("."+c.namespace)||"anywhere"===c.closeOnClick||b.closest(e).length)a.preventDefault(),
c.close()});return this},getContent:function(){var a=this.constructor.contentFilters,b=this.$currentTarget&&this.$currentTarget.attr(this.targetAttr),c=this.target||b||"",f=a[this.type];!f&&c in a&&(f=a[c],c=this.target&&b);c=c||this.$currentTarget&&this.$currentTarget.attr("href")||"";if(!f)for(var e in a)this[e]&&(f=a[e],c=this[e]);if(!f){var h=c,c=null;d.each(this.contentFilters,function(){f=a[this];f.test&&(c=f.test(h));!c&&f.regex&&h.match&&h.match(f.regex)&&(c=h);return!c});if(!c)return"console"in
window&&window.console.error("Featherlight: no content filter found "+(h?' for "'+h+'"':" (no target specified)")),!1}return f.process.call(this,c)},setContent:function(a){(a.is("iframe")||0<d("iframe",a).length)&&this.$instance.addClass(this.namespace+"-iframe");this.$content=a.addClass(this.namespace+"-inner");this.$instance.find("."+this.namespace+"-inner").slice(1).remove().end().replaceWith(this.$content);return this},open:function(a){var b=this;if(!(a&&a.isDefaultPrevented()||!1===b.beforeOpen(a))){a&&
a.preventDefault();var c=b.getContent();if(c)return b.constructor._opened.add(b._openedCallback=function(a,c){b instanceof a&&0<b.$instance.closest("body").length&&(c.currentFeatherlight=b)}),e._keyHandlerInstalled||(d(document).on("keyup."+e.prototype.namespace,g),e._keyHandlerInstalled=!0),b.$instance.appendTo(b.root).fadeIn(b.openSpeed),b.beforeContent(a),d.when(c).done(function(c){b.setContent(c);b.afterContent(a);d.when(b.$instance.promise()).done(function(){b.afterOpen(a)})}),b}return!1},close:function(a){var b=
this;if(!1===b.beforeClose(a))return!1;b.constructor._opened.remove(b._openedCallback);e.current()||(d(document).off("keyup."+e.namespace,g),b.constructor._keyHandlerInstalled=!1);b.$instance.fadeOut(b.closeSpeed,function(){b.$instance.detach();b.afterClose(a)})},chainCallbacks:function(a){for(var b in a)this[b]=d.proxy(a[b],this,d.proxy(this[b],this))}};d.extend(e,{id:0,autoBind:"[data-featherlight]",defaults:e.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(a){return a instanceof
d&&a},process:function(a){return d(a).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp)(\?\S*)?$/i,process:function(a){var b=this,c=d.Deferred(),f=new Image;f.onload=function(){c.resolve(d('<img src="'+a+'" alt="" class="'+b.namespace+'-image" />'))};f.onerror=function(){c.reject()};f.src=a;return c.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(a){return d(a)}},ajax:{regex:/./,process:function(a){var b=d.Deferred(),c=d("<div></div>").load(a,function(a,d){"error"!==d&&b.resolve(c.contents());
b.fail()});return b.promise()}},text:{process:function(a){return d("<div>",{text:a})}}},functionAttributes:"beforeOpen afterOpen beforeContent afterContent beforeClose afterClose".split(" "),readElementConfig:function(a){var b=this,c={};a&&a.attributes&&d.each(a.attributes,function(){var a=this.name.match(/^data-featherlight-(.*)/);if(a){var e=this.value,a=d.camelCase(a[1]);if(0<=d.inArray(a,b.functionAttributes))e=new Function(e);else try{e=d.parseJSON(e)}catch(h){}c[a]=e}});return c},extend:function(a,
b){var c=function(){this.constructor=a};c.prototype=this.prototype;a.prototype=new c;a.__super__=this.prototype;d.extend(a,this,b);a.defaults=a.prototype;return a},attach:function(a,b,c){var e=this;"object"!==typeof b||!1!==b instanceof d||c||(c=b,b=void 0);c=d.extend({},c);var g=d.extend({},e.defaults,e.readElementConfig(a[0]),c);a.on(g.openTrigger+"."+g.namespace,g.filter,function(g){var k=d.extend({$source:a,$currentTarget:d(this)},e.readElementConfig(a[0]),e.readElementConfig(this),c);(new e(b,
k)).open(g)});return a},current:function(){var a={};this._opened.fire(this,a);return a.currentFeatherlight},close:function(){var a=this.current();a&&a.close()},_onReady:function(){var a=this;a.autoBind&&(a.attach(d(document),{filter:a.autoBind}),d(a.autoBind).filter("[data-featherlight-filter]").each(function(){a.attach(d(this))}))},_callbackChain:{onKeyDown:function(a,b){if(27===b.keyCode&&this.closeOnEsc)this.$instance.find("."+this.namespace+"-close:first").click(),b.preventDefault();else return console.log("pass"),
a(b)}},_opened:d.Callbacks()});d.featherlight=e;d.fn.featherlight=function(a,b){return e.attach(this,a,b)};d(document).ready(function(){e._onReady()})}})(jQuery);
var isMobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/BB10; Touch/)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows()}},
vrDeviceAvailable=!1,vrDeviceTest=function(){var d=function(d){for(var g=0;g<d.length;++g)if(d[g]instanceof HMDVRDevice){vrDeviceAvailable=!0;break}};return{check:function(){navigator.getVRDevices&&navigator.getVRDevices().then(d)}}}();vrDeviceTest.check();$.featherlight.contentFilters.iframe={process:function(d){return $('<iframe id="lbIframe" marginheight="0" marginwidth="0" frameborder="0" allowfullscreen allowTransparency="true" src="'+d+'"/>')}};
$("document").ready(function(){$("a.dm_tourLink").featherlight("iframe",{beforeOpen:function(d){document.cookie="diginetTour_startXML=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/";document.cookie="diginetTour_backXML=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/";if(isMobile.any()||vrDeviceAvailable)return d.preventDefault(),window.open(this.$currentTarget.attr("href"),"_blank"),!1}})});
