(function($) {
  $.fn.vCenter = function(options) {
    var pos = {
      sTop : function() {
        return window.pageYOffset
        || document.documentElement && document.documentElement.scrollTop ||  document.body.scrollTop;
      },
      wHeight : function() {
        return window.innerHeight
        || document.documentElement && document.documentElement.clientHeight || document.body.clientHeight;
      },
      sLeft : function() {
        return document.body.offsetWidth
        || document.documentElement && document.documentElement.scrollLeft ||  document.body.scrollLeft;
      },
      wWidth : function() {
        return window.innerHeight
        || document.documentElement && document.documentElement.clientWidth || document.body.clientWidth;
      }
    };
    return this.each(function(index) {
      if (index == 0) {
        var $this = $(this);
        var elHeight = $this.height();
        var elWidth = $this.width();
        var Lleft = (document.body.offsetWidth/2)-(elWidth/2);
        var elTop = pos.sTop() + (pos.wHeight() / 2) - (elHeight / 2);
        var elLeft = pos.sLeft() + (pos.wWidth() / 2) - (elWidth / 2);
        $this.css({
          position: 'absolute',
          marginTop: '0',
          top: elTop,
          left:Lleft
        });
        $('#gbx_overlay').css({
                display:"block",
                'z-index':56,
                height:document.body.clientHeight
                })
      }
    });
  };
   $.fn.vCenter2 = function(options) {
    var pos = {
      sTop : function() {
        return window.pageYOffset
        || document.documentElement && document.documentElement.scrollTop ||  document.body.scrollTop;
      },
      wHeight : function() {
        return window.innerHeight
        || document.documentElement && document.documentElement.clientHeight || document.body.clientHeight;
      },
      sLeft : function() {
        return document.body.offsetWidth
        || document.documentElement && document.documentElement.scrollLeft ||  document.body.scrollLeft;
      },
      wWidth : function() {
        return window.innerHeight
        || document.documentElement && document.documentElement.clientWidth || document.body.clientWidth;
      }
    };
    return this.each(function(index) {
      if (index == 0) {
        var $this = $(this);
        var elHeight = $this.height();
        var elWidth = $this.width();
        var Lleft = (document.body.offsetWidth/2)-(elWidth/2);
        var elTop = pos.sTop() + (pos.wHeight() / 2) - (elHeight / 2) +100;
        var elLeft = pos.sLeft() + (pos.wWidth() / 2) - (elWidth / 2);
        $this.css({
          position: 'absolute',
          marginTop: '0',
          top: '50px',
          left:Lleft
        });
        $('#gbx_overlay').css({
                display:"block",
                'z-index':56,
                height:document.body.clientHeight
                })
      }
    });
  };

})(jQuery); // end plugin