(function(c){var a=new Object;var o={init:function(e){a=c.extend({},this,o);a.searching=false;a.o=new Object;var t={overlaySelector:".md-overlay",closeSelector:".md-close",classAddAfterOpen:"md-show",modalAttr:"data-modal",perspectiveClass:"md-perspective",perspectiveSetClass:"md-setperspective",afterOpen:function(e,t){},afterClose:function(e,t){}};a.o=c.extend({},t,e);a.n=new Object;var r=c(a.o.overlaySelector);if(r.length<1){r=c('<div class="'+a.o.overlaySelector.replace(/^\./,"")+'"></div>');c("#"+c(this).attr(a.o.modalAttr)).parent().append(r)}c(this).click(function(){var t=c("#"+c(this).attr(a.o.modalAttr)),e=c(a.o.closeSelector,t);var o=c(this);c(t).addClass(a.o.classAddAfterOpen);c(r).off("click").on("click",function(){n();a.afterClose(o,t);c(r).off("click")});if(c(o).hasClass(a.o.perspectiveSetClass)){setTimeout(function(){c(document.documentElement).addClass(a.o.perspectiveClass)},25)}a.afterOpen(o,t);setTimeout(function(){t.css({perspective:"none"})},500);function s(e){c(t).removeClass(a.o.classAddAfterOpen);t.css({perspective:"1300px"});if(e){c(document.documentElement).removeClass(a.o.perspectiveClass)}}function n(){s(c(o).hasClass(a.o.perspectiveSetClass));c(r).off("click")}c(e).on("click",function(e){e.stopPropagation();n();a.afterClose(o,t)})})},afterOpen:function(e,t){a.o.afterOpen(e,t)},afterClose:function(e,t){a.o.afterClose(e,t)}};c.fn.modalEffects=function(e){if(o[e]){return o[e].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof e==="object"||!e){return o.init.apply(this,arguments)}else{c.error("Method "+e+" does not exist on jQuery.modalEffects")}};function e(){return!!("ontouchstart"in window)?1:0}})(jQuery);(function(r){r.fn.niftyModal=function(e){var o={overlaySelector:".md-overlay",closeSelector:".md-close",classAddAfterOpen:"md-show",modalAttr:"data-modal",perspectiveClass:"md-perspective",perspectiveSetClass:"md-setperspective",closeOnClickOverlay:true,afterOpen:function(e){},afterClose:function(e){}};var s={};var t={init:function(t){return this.each(function(){s=r.extend({},o,t);var e=r(this);n.showModal(e)})},toggle:function(t){return this.each(function(){s=r.extend({},o,t);var e=r(this);if(e.hasClass(s.classAddAfterOpen)){n.removeModal(e)}else{n.showModal(e)}})},show:function(e){s=r.extend({},o,e);return this.each(function(){n.showModal(r(this))})},hide:function(e){s=r.extend({},o,e);return this.each(function(){n.removeModal(r(this))})}};var n={removeModal:function(e){e.removeClass(s.classAddAfterOpen);e.css({perspective:"1300px"});e.trigger("hide");r(s.overlaySelector).off("click")},showModal:function(t){var e=r(s.overlaySelector);if(e.length<1){e=r('<div class="'+s.overlaySelector.replace(/^\./,"")+'"></div>');t.parent().append(e)}var o=r(s.closeSelector,t);t.addClass(s.classAddAfterOpen);if(s.closeOnClickOverlay){e.off("click").on("click",function(){n.removeModal(t);s.afterClose(t);e.off("click")})}s.afterOpen(t);setTimeout(function(){t.css({perspective:"none"})},500);o.on("click",function(e){e.stopPropagation();n.removeModal(t);s.afterClose(t)});t.trigger("show")}};if(t[e]){return t[e].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof e==="object"||!e){return t.init.apply(this,arguments)}else{r.error('Method "'+e+'" does not exist in niftyModal plugin!')}}})(jQuery);$(document).ready(function(){$(".md-trigger").modalEffects()});