/*
	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.data.util.JsonQuery"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.data.util.JsonQuery"]){_4._hasResource["dojox.data.util.JsonQuery"]=true;_4.provide("dojox.data.util.JsonQuery");_4.declare("dojox.data.util.JsonQuery",null,{useFullIdInQueries:false,_toJsonQuery:function(_7,_8){var _9=true;var _a=this;function _b(_c,_d){var _e=_d.__id;if(_e){var _f={};_f[_a.idAttribute]=_a.useFullIdInQueries?_d.__id:_d[_a.idAttribute];_d=_f;}for(var i in _d){var _10=_d[i];var _11=_c+(/^[a-zA-Z_][\w_]*$/.test(i)?"."+i:"["+_4._escapeString(i)+"]");if(_10&&typeof _10=="object"){_b(_11,_10);}else{if(_10!="*"){_12+=(_9?"":"&")+_11+((!_e&&typeof _10=="string"&&_7.queryOptions&&_7.queryOptions.ignoreCase)?"~":"=")+(_a.simplifiedQuery?encodeURIComponent(_10):_4.toJson(_10));_9=false;}}}};if(_7.query&&typeof _7.query=="object"){var _12="[?(";_b("@",_7.query);if(!_9){_12+=")]";}else{_12="";}_7.queryStr=_12.replace(/\\"|"/g,function(t){return t=="\""?"'":t;});}else{if(!_7.query||_7.query=="*"){_7.query="";}}var _13=_7.sort;if(_13){_7.queryStr=_7.queryStr||(typeof _7.query=="string"?_7.query:"");_9=true;for(i=0;i<_13.length;i++){_7.queryStr+=(_9?"[":",")+(_13[i].descending?"\\":"/")+"@["+_4._escapeString(_13[i].attribute)+"]";_9=false;}_7.queryStr+="]";}if(_8&&(_7.start||_7.count)){_7.queryStr=(_7.queryStr||(typeof _7.query=="string"?_7.query:""))+"["+(_7.start||"")+":"+(_7.count?(_7.start||0)+_7.count:"")+"]";}if(typeof _7.queryStr=="string"){_7.queryStr=_7.queryStr.replace(/\\"|"/g,function(t){return t=="\""?"'":t;});return _7.queryStr;}return _7.query;},jsonQueryPagination:true,fetch:function(_14){this._toJsonQuery(_14,this.jsonQueryPagination);return this.inherited(arguments);},isUpdateable:function(){return true;},matchesQuery:function(_15,_16){_16._jsonQuery=_16._jsonQuery||_6.json.query(this._toJsonQuery(_16));return _16._jsonQuery([_15]).length;},clientSideFetch:function(_17,_18){_17._jsonQuery=_17._jsonQuery||_6.json.query(this._toJsonQuery(_17));return this.clientSidePaging(_17,_17._jsonQuery(_18));},querySuperSet:function(_19,_1a){if(!_19.query){return _1a.query;}return this.inherited(arguments);}});}}};});