function Drag(ele, option) {
	this.ele = ele;
	this.start = new Point(0, 0);
	this.stop = new Point(0, 0);
	this.opt = option;

	this.down = function(e) {
		this.start.set(e.pageX, e.pageY);
		this.stop.set(e.pageX, e.pageY);
		var result = null;
		if ($.isFunction(this.opt.onBeforeDrag)) {
			result = this.opt.onBeforeDrag(this.start,this.stop);
			if (result === false) {
				return ;
			};
		};


		$(document).mousemove(this.move);
		$(document).mouseup(this.up);
//		e.preventDefault();
	}.bind(this);

	this.move = function(e) {
		this.stop.set(
			e.pageX,
			e.pageY
		);
		$.isFunction(this.opt.onDragging) && this.opt.onDragging(this.start, this.stop);
		e.preventDefault();
	}.bind(this);

	this.up = function(e) {
		$.isFunction(this.opt.onComplete) && this.opt.onComplete(this.start,this.stop);
		$(document).unbind('mousemove',this.move);
		$(document).unbind('mouseup',this.up);
		e.preventDefault();
	}.bind(this);

	this.ele.mousedown(this.down);
}

Drag.prototype.remove = function() {
	this.ele.unbind('mousedown', this.down)
}
