jQuery.fn.resizer = function(opts) {
	if (opts == undefined) opts = {};
	opts.resizeHandler = opts.resizeHandler == undefined ? false : $('#' + opts.resizeHandler);
	opts.img = opts.img == undefined ? false : opts.img;
	opts.min = opts.min == undefined ? false : opts.min;
	opts.max = opts.max == undefined ? false : opts.max;
	opts.endCallback = opts.endCallback == undefined ? false : opts.endCallback;
	
    return this.each(function() {
        if (opts.resizeHandler && opts.resizeHandler.get(0)) {
		    var me = jQuery(this);
		      jQuery(opts.resizeHandler).bind('mousedown', function(e) {
		        var h = me.height();
		        opts.currHeight = h;
		        var y = e.clientY;
		        var moveHandler = function(e) {
		            var newHeight = Math.max(20, e.clientY + h - y);
		            var currHeight = me.height();
		            var currDirection = opts.currHeight - newHeight;
		
		            if (opts.min && currHeight <= opts.min && currDirection > 0) { setMapSize(_maps['basicMap'], opts.min); return; }
		            if (opts.max && currHeight >= opts.max && currDirection < 0) { setMapSize(_maps['basicMap'], opts.max); return; }
		            
		        	//me.height(newHeight);
		        	setMapSize(_maps['basicMap'], newHeight);
		        	opts.currHeight = newHeight;
		        };
		        // функци прекращает обработку событий
		        var upHandler = function(e) {
		        	opts.endCallback.apply();
		        	jQuery('html').unbind('mousemove',moveHandler).unbind('mouseup',upHandler);
		        };
		        // своего рода, инициализация, выше приведённых, функций
		        jQuery('html').bind('mousemove', moveHandler).bind('mouseup', upHandler);
		      })
		  }
    });
}