/*
	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","dijit._KeyNavContainer"],["require","dijit._Container"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dijit._KeyNavContainer"]){_4._hasResource["dijit._KeyNavContainer"]=true;_4.provide("dijit._KeyNavContainer");_4.require("dijit._Container");_4.declare("dijit._KeyNavContainer",_5._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(_7,_8){var _9=(this._keyNavCodes={});var _a=_4.hitch(this,this.focusPrev);var _b=_4.hitch(this,this.focusNext);_4.forEach(_7,function(_c){_9[_c]=_a;});_4.forEach(_8,function(_d){_9[_d]=_b;});_9[_4.keys.HOME]=_4.hitch(this,"focusFirstChild");_9[_4.keys.END]=_4.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");this.connect(this.domNode,"onfocus","_onContainerFocus");},startupKeyNavChildren:function(){_4.forEach(this.getChildren(),_4.hitch(this,"_startupChild"));},addChild:function(_e,_f){_5._KeyNavContainer.superclass.addChild.apply(this,arguments);this._startupChild(_e);},focus:function(){this.focusFirstChild();},focusFirstChild:function(){var _10=this._getFirstFocusableChild();if(_10){this.focusChild(_10);}},focusLastChild:function(){var _11=this._getLastFocusableChild();if(_11){this.focusChild(_11);}},focusNext:function(){var _12=this._getNextFocusableChild(this.focusedChild,1);this.focusChild(_12);},focusPrev:function(){var _13=this._getNextFocusableChild(this.focusedChild,-1);this.focusChild(_13,true);},focusChild:function(_14,_15){if(this.focusedChild&&_14!==this.focusedChild){this._onChildBlur(this.focusedChild);}_14.set("tabIndex",this.tabIndex);_14.focus(_15?"end":"start");this._set("focusedChild",_14);},_startupChild:function(_16){_16.set("tabIndex","-1");this.connect(_16,"_onFocus",function(){_16.set("tabIndex",this.tabIndex);});this.connect(_16,"_onBlur",function(){_16.set("tabIndex","-1");});},_onContainerFocus:function(evt){if(evt.target!==this.domNode){return;}this.focusFirstChild();_4.attr(this.domNode,"tabIndex","-1");},_onBlur:function(evt){if(this.tabIndex){_4.attr(this.domNode,"tabIndex",this.tabIndex);}this.inherited(arguments);},_onContainerKeypress:function(evt){if(evt.ctrlKey||evt.altKey){return;}var _17=this._keyNavCodes[evt.charOrCode];if(_17){_17();_4.stopEvent(evt);}},_onChildBlur:function(_18){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1);},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1);},_getNextFocusableChild:function(_19,dir){if(_19){_19=this._getSiblingOfChild(_19,dir);}var _1a=this.getChildren();for(var i=0;i<_1a.length;i++){if(!_19){_19=_1a[(dir>0)?0:(_1a.length-1)];}if(_19.isFocusable()){return _19;}_19=this._getSiblingOfChild(_19,dir);}return null;}});}}};});