/*
	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","dojox.dnd.Selector"],["require","dojo.dnd.Selector"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.dnd.Selector"]){_4._hasResource["dojox.dnd.Selector"]=true;_4.provide("dojox.dnd.Selector");_4.require("dojo.dnd.Selector");_4.declare("dojox.dnd.Selector",_4.dnd.Selector,{isSelected:function(_7){var id=_4.isString(_7)?_7:_7.id,_8=this.getItem(id);return _8&&this.selected[id];},selectNode:function(_9,_a){if(!_a){this.selectNone();}var id=_4.isString(_9)?_9:_9.id,_b=this.getItem(id);if(_b){this._removeAnchor();this.anchor=_4.byId(_9);this._addItemClass(this.anchor,"Anchor");this.selection[id]=1;this._addItemClass(this.anchor,"Selected");}return this;},deselectNode:function(_c){var id=_4.isString(_c)?_c:_c.id,_d=this.getItem(id);if(_d&&this.selection[id]){if(this.anchor===_4.byId(_c)){this._removeAnchor();}delete this.selection[id];this._removeItemClass(this.anchor,"Selected");}return this;},selectByBBox:function(_e,_f,_10,_11,add){if(!add){this.selectNone();}this.forInItems(function(_12,id){var _13=_4.byId(id);if(_13&&this._isBoundedByBox(_13,_e,_f,_10,_11)){this.selectNode(id,true);}},this);return this;},_isBoundedByBox:function(_14,_15,top,_16,_17){var c=_4.coords(_14),t;if(_15>_16){t=_15;_15=_16;_16=t;}if(top>_17){t=top;top=_17;_17=t;}return c.x>=_15&&c.x+c.w<=_16&&c.y>=top&&c.y+c.h<=_17;},shift:function(_18,add){var _19=this.getSelectedNodes();if(_19&&_19.length){this.selectNode(this._getNodeId(_19[_19.length-1].id,_18),add);}},_getNodeId:function(_1a,_1b){var _1c=this.getAllNodes(),_1d=_1a;for(var i=0,l=_1c.length;i<l;++i){if(_1c[i].id==_1a){var j=Math.min(l-1,Math.max(0,i+(_1b?1:-1)));if(i!=j){_1d=_1c[j].id;}break;}}return _1d;}});}}};});