(function (namespace, $) {
    "use strict";
    var defaults = {
            overlayHTML: '<div class="Overlay"></div>',
            overlayActiveClass: 'active',
            modalSelector: '.Modal',
            modalActiveClass: 'active',
            verticallyCenterModal: true,
            zIndexStart: 1000,
            depth: 1
        },
        createOverlay = function () {
            var $overlay = $(this.opts.overlayHTML);
            $('body').append($overlay);
            this.$overlays = this.$overlays.add($overlay);
        },
        openOverlay = function (num) {
            if (num === this.$overlays.length) {
                createOverlay.call(this);
            }
            if (num < this.$overlays.length) {
                this.$overlays.eq(num).css('zIndex', num * 2 + this.opts.zIndexStart)
                    .addClass(this.opts.overlayActiveClass);
            }
        },
        closeOverlay = function (num, recursive) {
            this.$overlays.eq(num).removeClass(this.opts.overlayActiveClass);
            if (recursive && num > 0) {
                closeOverlay.call(this, num - 1, recursive);
            }
        },
        closeModal = function (el) {
            var $modal = $(el);
            $modal.removeClass(this.opts.modalActiveClass);
            this.$overlays.removeClass(this.opts.overlayActiveClass);
        },
        verticallyCenter = function ($modal) {
            var wHeight = $(window).height(),
                mHeight = $modal.outerHeight();
            $modal.css('top', Math.max((wHeight - mHeight) / 2, 0));
        },
        init = function () {
            this.$overlays = $();
            for (var x = 0; x < this.opts.depth; x += 1) {
                createOverlay.call(this);
            }
            this.count = 0;
        };
    namespace.ModalHandler = function (options) {
        this.opts = $.extend({}, defaults, options);
        init.call(this);
    };
    namespace.ModalHandler.prototype.open = function (modal) {
        var $modal = $(modal);
        if (!$modal.length || $modal.hasClass(this.opts.modalActiveClass)) return;
        openOverlay.call(this, this.count);
        $modal.css('zIndex', this.count * 2 + 1 + this.opts.zIndexStart)
            .addClass(this.opts.modalActiveClass);
        this.opts.verticallyCenterModal && verticallyCenter.call(this, $modal);
        this.count += 1;
    };
    namespace.ModalHandler.prototype.close = function (modal) {
        var $modal = $(modal);
        if (!$modal.length) return;
        this.count -= 1;
        $modal.removeClass(this.opts.modalActiveClass);
        closeOverlay.call(this, this.count, false);
    };
    namespace.ModalHandler.prototype.closeAll = function () {
        $(this.opts.modalSelector).removeClass(this.opts.modalActiveClass);
        closeOverlay.call(this, this.count - 1, true);
        this.count = 0;
    };
}(this, jQuery));
@@ -4,25 +4,23 @@
 nction (
-namespace
+exports
 , $) %7B%0A 
@@ -1402,17 +1402,16 @@
 nction (
-$
 modal) %7B
@@ -1427,16 +1427,51 @@
     var 
+$modal = $(modal),%0A                
 wHeight 
@@ -1538,16 +1538,67 @@
 Height()
+,%0A                scrollTop = $(window).scrollTop()
 ;%0A      
@@ -1657,16 +1657,28 @@
  / 2, 0)
+ + scrollTop
 );%0A     
@@ -1900,33 +1900,31 @@
      %7D;%0A    
-namespace
+exports
 .ModalHandle
@@ -2033,33 +2033,31 @@
 %0A    %7D;%0A    
-namespace
+exports
 .ModalHandle
@@ -2488,33 +2488,31 @@
 %0A    %7D;%0A    
-namespace
+exports
 .ModalHandle
@@ -2765,17 +2765,15 @@
     
-namespace
+exports
 .Mod
@@ -2972,23 +2972,95 @@
 nt = 0;%0A
-
     %7D;%0A
+    exports.ModalHandler.prototype.verticallyCenter = verticallyCenter;%0A
 %7D(this, 

fix vertically center