/*
	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.wire.Wire"],["require","dojox.wire._base"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.wire.Wire"]){_4._hasResource["dojox.wire.Wire"]=true;_4.provide("dojox.wire.Wire");_4.require("dojox.wire._base");_4.declare("dojox.wire.Wire",null,{_wireClass:"dojox.wire.Wire",constructor:function(_7){_4.mixin(this,_7);if(this.converter){if(_4.isString(this.converter)){var _8=_4.getObject(this.converter);if(_4.isFunction(_8)){try{var _9=new _8();if(_9&&!_4.isFunction(_9["convert"])){this.converter={convert:_8};}else{this.converter=_9;}}catch(e){}}else{if(_4.isObject(_8)){if(_4.isFunction(_8["convert"])){this.converter=_8;}}}if(_4.isString(this.converter)){var _a=_6.wire._getClass(this.converter);if(_a){this.converter=new _a();}else{this.converter=undefined;}}}else{if(_4.isFunction(this.converter)){this.converter={convert:this.converter};}}}},getValue:function(_b){var _c=undefined;if(_6.wire.isWire(this.object)){_c=this.object.getValue(_b);}else{_c=(this.object||_b);}if(this.property){var _d=this.property.split(".");for(var i in _d){if(!_c){return _c;}_c=this._getPropertyValue(_c,_d[i]);}}var _e=undefined;if(this._getValue){_e=this._getValue(_c);}else{_e=_c;}if(_e){if(this.type){if(this.type=="string"){_e=_e.toString();}else{if(this.type=="number"){_e=parseInt(_e,10);}else{if(this.type=="boolean"){_e=(_e!="false");}else{if(this.type=="array"){if(!_4.isArray(_e)){_e=[_e];}}}}}}if(this.converter&&this.converter.convert){_e=this.converter.convert(_e,this);}}return _e;},setValue:function(_f,_10){var _11=undefined;if(_6.wire.isWire(this.object)){_11=this.object.getValue(_10);}else{_11=(this.object||_10);}var _12=undefined;var o;if(this.property){if(!_11){if(_6.wire.isWire(this.object)){_11={};this.object.setValue(_11,_10);}else{throw new Error(this._wireClass+".setValue(): invalid object");}}var _13=this.property.split(".");var _14=_13.length-1;for(var i=0;i<_14;i++){var p=_13[i];o=this._getPropertyValue(_11,p);if(!o){o={};this._setPropertyValue(_11,p,o);}_11=o;}_12=_13[_14];}if(this._setValue){if(_12){o=this._getPropertyValue(_11,_12);if(!o){o={};this._setPropertyValue(_11,_12,o);}_11=o;}var _15=this._setValue(_11,_f);if(!_11&&_15){if(_6.wire.isWire(this.object)){this.object.setValue(_15,_10);}else{throw new Error(this._wireClass+".setValue(): invalid object");}}}else{if(_12){this._setPropertyValue(_11,_12,_f);}else{if(_6.wire.isWire(this.object)){this.object.setValue(_f,_10);}else{throw new Error(this._wireClass+".setValue(): invalid property");}}}},_getPropertyValue:function(_16,_17){var _18=undefined;var i1=_17.indexOf("[");if(i1>=0){var i2=_17.indexOf("]");var _19=_17.substring(i1+1,i2);var _1a=null;if(i1===0){_1a=_16;}else{_17=_17.substring(0,i1);_1a=this._getPropertyValue(_16,_17);if(_1a&&!_4.isArray(_1a)){_1a=[_1a];}}if(_1a){_18=_1a[_19];}}else{if(_16.getPropertyValue){_18=_16.getPropertyValue(_17);}else{var _1b="get"+_17.charAt(0).toUpperCase()+_17.substring(1);if(this._useGet(_16)){_18=_16.get(_17);}else{if(this._useAttr(_16)){_18=_16.attr(_17);}else{if(_16[_1b]){_18=_16[_1b]();}else{_18=_16[_17];}}}}}return _18;},_setPropertyValue:function(_1c,_1d,_1e){var i1=_1d.indexOf("[");if(i1>=0){var i2=_1d.indexOf("]");var _1f=_1d.substring(i1+1,i2);var _20=null;if(i1===0){_20=_1c;}else{_1d=_1d.substring(0,i1);_20=this._getPropertyValue(_1c,_1d);if(!_20){_20=[];this._setPropertyValue(_1c,_1d,_20);}}_20[_1f]=_1e;}else{if(_1c.setPropertyValue){_1c.setPropertyValue(_1d,_1e);}else{var _21="set"+_1d.charAt(0).toUpperCase()+_1d.substring(1);if(this._useSet(_1c)){_1c.set(_1d,_1e);}else{if(this._useAttr(_1c)){_1c.attr(_1d,_1e);}else{if(_1c[_21]){_1c[_21](_1e);}else{_1c[_1d]=_1e;}}}}}},_useGet:function(_22){var _23=false;if(_4.isFunction(_22.get)){_23=true;}return _23;},_useSet:function(_24){var _25=false;if(_4.isFunction(_24.set)){_25=true;}return _25;},_useAttr:function(_26){var _27=false;if(_4.isFunction(_26.attr)){_27=true;}return _27;}});}}};});