/*
 * resizehandle.js (c) Fil 2007, plugin pour jQuery ecrit
 * a partir du fichier resize.js du projet DotClear
 * (c) 2005 Nicolas Martin & Olivier Meunier and contributors
 */
jQuery.fn.resizehandle = function() {
	return this.each(function() {
		var me = jQuery(this);
		me.after(jQuery('<div class="resizehandle"></div>').bind('mousedown', function(e) {
			var h = me.height();
			var y = e.clientY;
			var moveHandler = function(e) {
				me.height(Math.max(32, e.clientY + h - y));
			};
			var upHandler = function(e) {
				jQuery('html').unbind('mousemove',moveHandler).unbind('mouseup',upHandler);
			};
			jQuery('html').bind('mousemove',moveHandler).bind('mouseup',upHandler);
		}));
  });
};

