/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojo.dnd.Moveable"],["require","dojo.dnd.Mover"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojo.dnd.Moveable"]){_4._hasResource["dojo.dnd.Moveable"]=true;_4.provide("dojo.dnd.Moveable");_4.require("dojo.dnd.Mover");_4.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(_7,_8){this.node=_4.byId(_7);if(!_8){_8={};}this.handle=_8.handle?_4.byId(_8.handle):null;if(!this.handle){this.handle=this.node;}this.delay=_8.delay>0?_8.delay:0;this.skip=_8.skip;this.mover=_8.mover?_8.mover:_4.dnd.Mover;this.events=[_4.connect(this.handle,"onmousedown",this,"onMouseDown"),_4.connect(this.handle,"ontouchstart",this,"onMouseDown"),_4.connect(this.handle,"ondragstart",this,"onSelectStart"),_4.connect(this.handle,"onselectstart",this,"onSelectStart")];},markupFactory:function(_9,_a){return new _4.dnd.Moveable(_a,_9);},destroy:function(){_4.forEach(this.events,_4.disconnect);this.events=this.node=this.handle=null;},onMouseDown:function(e){if(this.skip&&_4.dnd.isFormElement(e)){return;}if(this.delay){this.events.push(_4.connect(this.handle,"onmousemove",this,"onMouseMove"),_4.connect(this.handle,"ontouchmove",this,"onMouseMove"),_4.connect(this.handle,"onmouseup",this,"onMouseUp"),_4.connect(this.handle,"ontouchend",this,"onMouseUp"));var _b=e.touches?e.touches[0]:e;this._lastX=_b.pageX;this._lastY=_b.pageY;}else{this.onDragDetected(e);}_4.stopEvent(e);},onMouseMove:function(e){var _c=e.touches?e.touches[0]:e;if(Math.abs(_c.pageX-this._lastX)>this.delay||Math.abs(_c.pageY-this._lastY)>this.delay){this.onMouseUp(e);this.onDragDetected(e);}_4.stopEvent(e);},onMouseUp:function(e){for(var i=0;i<2;++i){_4.disconnect(this.events.pop());}_4.stopEvent(e);},onSelectStart:function(e){if(!this.skip||!_4.dnd.isFormElement(e)){_4.stopEvent(e);}},onDragDetected:function(e){new this.mover(this.node,e,this);},onMoveStart:function(_d){_4.publish("/dnd/move/start",[_d]);_4.addClass(_4.body(),"dojoMove");_4.addClass(this.node,"dojoMoveItem");},onMoveStop:function(_e){_4.publish("/dnd/move/stop",[_e]);_4.removeClass(_4.body(),"dojoMove");_4.removeClass(this.node,"dojoMoveItem");},onFirstMove:function(_f,e){},onMove:function(_10,_11,e){this.onMoving(_10,_11);var s=_10.node.style;s.left=_11.l+"px";s.top=_11.t+"px";this.onMoved(_10,_11);},onMoving:function(_12,_13){},onMoved:function(_14,_15){}});}}};});