//>>built
define("dojox/mdnd/Moveable","dojo/_base/kernel,dojo/_base/declare,dojo/_base/array,dojo/_base/connect,dojo/_base/event,dojo/_base/sniff,dojo/dom,dojo/dom-geometry,dojo/dom-style,dojo/_base/window".split(","),function(g,h,i,b,c,e,d,f,j){return h("dojox.mdnd.Moveable",null,{handle:null,skip:!0,dragDistance:3,constructor:function(a,k){this.node=d.byId(k);this.d=this.node.ownerDocument;a||(a={});this.handle=a.handle?d.byId(a.handle):null;if(!this.handle)this.handle=this.node;this.skip=a.skip;this.events=
[b.connect(this.handle,"onmousedown",this,"onMouseDown")];if(dojox.mdnd.autoScroll)this.autoScroll=dojox.mdnd.autoScroll},isFormElement:function(a){a=a.target;if(3==a.nodeType)a=a.parentNode;return 0<=" a button textarea input select option ".indexOf(" "+a.tagName.toLowerCase()+" ")},onMouseDown:function(a){if(!this._isDragging&&!(1!=(a.which||a.button)||this.skip&&this.isFormElement(a)))this.autoScroll&&(this.autoScroll.setAutoScrollNode(this.node),this.autoScroll.setAutoScrollMaxPage()),this.events.push(b.connect(this.d,
"onmouseup",this,"onMouseUp")),this.events.push(b.connect(this.d,"onmousemove",this,"onFirstMove")),this._selectStart=b.connect(g.body(),"onselectstart",c.stop),this._firstX=a.clientX,this._firstY=a.clientY,c.stop(a)},onFirstMove:function(a){c.stop(a);if((this._firstX-a.clientX)*(this._firstX-a.clientX)+(this._firstY-a.clientY)*(this._firstY-a.clientY)>this.dragDistance*this.dragDistance)this._isDragging=!0,b.disconnect(this.events.pop()),j.set(this.node,"width",f.getContentBox(this.node).w+"px"),
this.initOffsetDrag(a),this.events.push(b.connect(this.d,"onmousemove",this,"onMove"))},initOffsetDrag:function(a){this.offsetDrag={l:a.pageX,t:a.pageY};a=f.position(this.node,!0);this.offsetDrag.l=a.x-this.offsetDrag.l;this.offsetDrag.t=a.y-this.offsetDrag.t;var b={x:a.x,y:a.y};this.size={w:a.w,h:a.h};this.onDragStart(this.node,b,this.size)},onMove:function(a){c.stop(a);if(!(8==e("ie")&&20>new Date-this.date)){this.autoScroll&&this.autoScroll.checkAutoScroll(a);var b={x:this.offsetDrag.l+a.pageX,
y:this.offsetDrag.t+a.pageY},d=this.node.style;d.left=b.x+"px";d.top=b.y+"px";this.onDrag(this.node,b,this.size,{x:a.pageX,y:a.pageY});if(8==e("ie"))this.date=new Date}},onMouseUp:function(a){if(this._isDragging)c.stop(a),this._isDragging=!1,this.autoScroll&&this.autoScroll.stopAutoScroll(),delete this.onMove,this.onDragEnd(this.node),this.node.focus();b.disconnect(this.events.pop());b.disconnect(this.events.pop())},onDragStart:function(){},onDragEnd:function(){},onDrag:function(){},destroy:function(){i.forEach(this.events,
b.disconnect);this.events=this.node=null}})});