/*
	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.form.CheckedMultiSelect"],["require","dijit.form.CheckBox"],["require","dijit.Tooltip"],["require","dijit.form._FormSelectWidget"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.form.CheckedMultiSelect"]){_4._hasResource["dojox.form.CheckedMultiSelect"]=true;_4.provide("dojox.form.CheckedMultiSelect");_4.require("dijit.form.CheckBox");_4.require("dijit.Tooltip");_4.require("dijit.form._FormSelectWidget");_4.declare("dojox.form._CheckedMultiSelectItem",[_5._Widget,_5._Templated],{widgetsInTemplate:true,templateString:_4.cache("dojox.form","resources/_CheckedMultiSelectItem.html","<div class=\"dijitReset ${baseClass}\"\r\n\t><input class=\"${baseClass}Box\" dojoType=\"dijit.form.CheckBox\" dojoAttachPoint=\"checkBox\" \r\n\t\tdojoAttachEvent=\"_onClick:_changeBox\" type=\"${_type.type}\" baseClass=\"${_type.baseClass}\"\r\n\t/><div class=\"dijitInline ${baseClass}Label\" dojoAttachPoint=\"labelNode\" dojoAttachEvent=\"onclick:_onClick\"></div\r\n></div>\r\n"),baseClass:"dojoxMultiSelectItem",option:null,parent:null,disabled:false,readOnly:false,postMixInProperties:function(){if(this.parent.multiple){this._type={type:"checkbox",baseClass:"dijitCheckBox"};}else{this._type={type:"radio",baseClass:"dijitRadio"};}this.disabled=this.option.disabled=this.option.disabled||false;this.inherited(arguments);},postCreate:function(){this.inherited(arguments);this.labelNode.innerHTML=this.option.label;},_changeBox:function(){if(this.get("disabled")||this.get("readOnly")){return;}if(this.parent.multiple){this.option.selected=this.checkBox.get("value")&&true;}else{this.parent.set("value",this.option.value);}this.parent._updateSelection();this.parent.focus();},_onClick:function(e){if(this.get("disabled")||this.get("readOnly")){_4.stopEvent(e);}else{this.checkBox._onClick(e);}},_updateBox:function(){this.checkBox.set("value",this.option.selected);},_setDisabledAttr:function(_7){this.disabled=_7||this.option.disabled;this.checkBox.set("disabled",this.disabled);_4.toggleClass(this.domNode,"dojoxMultiSelectDisabled",this.disabled);},_setReadOnlyAttr:function(_8){this.checkBox.set("readOnly",_8);this.readOnly=_8;}});_4.declare("dojox.form.CheckedMultiSelect",_5.form._FormSelectWidget,{templateString:_4.cache("dojox.form","resources/CheckedMultiSelect.html","<div class=\"dijit dijitReset dijitInline\" dojoAttachEvent=\"onmousedown:_onMouseDown,onclick:focus\"\r\n\t><select class=\"${baseClass}Select\" multiple=\"true\" dojoAttachPoint=\"containerNode,focusNode\"></select\r\n\t><div dojoAttachPoint=\"wrapperDiv\"></div\r\n></div>\r\n"),baseClass:"dojoxMultiSelect",required:false,invalidMessage:"At least one item must be selected.",_message:"",tooltipPosition:[],_onMouseDown:function(e){_4.stopEvent(e);},validator:function(){if(!this.required){return true;}return _4.some(this.getOptions(),function(_9){return _9.selected&&_9.value!=null&&_9.value.toString().length!=0;});},validate:function(_a){_5.hideTooltip(this.domNode);var _b=this.isValid(_a);if(!_b){this.displayMessage(this.invalidMessage);}return _b;},isValid:function(_c){return this.validator();},getErrorMessage:function(_d){return this.invalidMessage;},displayMessage:function(_e){_5.hideTooltip(this.domNode);if(_e){_5.showTooltip(_e,this.domNode,this.tooltipPosition);}},onAfterAddOptionItem:function(_f,_10){},_addOptionItem:function(_11){var _12=new _6.form._CheckedMultiSelectItem({option:_11,parent:this});this.wrapperDiv.appendChild(_12.domNode);this.onAfterAddOptionItem(_12,_11);},_refreshState:function(){this.validate(this._focused);},onChange:function(_13){this._refreshState();},reset:function(){this.inherited(arguments);_5.hideTooltip(this.domNode);},_updateSelection:function(){this.inherited(arguments);this._handleOnChange(this.value);_4.forEach(this._getChildren(),function(c){c._updateBox();});},_getChildren:function(){return _4.map(this.wrapperDiv.childNodes,function(n){return _5.byNode(n);});},invertSelection:function(_14){_4.forEach(this.options,function(i){i.selected=!i.selected;});this._updateSelection();},_setDisabledAttr:function(_15){this.inherited(arguments);_4.forEach(this._getChildren(),function(_16){if(_16&&_16.set){_16.set("disabled",_15);}});},_setReadOnlyAttr:function(_17){if("readOnly" in this.attributeMap){this._attrToDom("readOnly",_17);}this.readOnly=_17;_4.forEach(this._getChildren(),function(_18){if(_18&&_18.set){_18.set("readOnly",_17);}});},uninitialize:function(){_5.hideTooltip(this.domNode);_4.forEach(this._getChildren(),function(_19){_19.destroyRecursive();});this.inherited(arguments);}});}}};});