/*
	Copyright (c) 2004-2008, The Dojo Foundation
	All Rights Reserved.

	Licensed under the Academic Free License version 2.1 or above OR the
	modified BSD license. For more information on Dojo licensing, see:

		http://dojotoolkit.org/book/dojo-book-0-9/introduction/licensing
*/


window[(typeof (djConfig)!="undefined"&&djConfig.scopeMap&&djConfig.scopeMap[0][1])||"dojo"]._xdResourceLoaded({depends:[["provide","dojo.data.util.simpleFetch"],["require","dojo.data.util.sorter"]],defineResource:function(_1,_2,_3){if(!_1._hasResource["dojo.data.util.simpleFetch"]){_1._hasResource["dojo.data.util.simpleFetch"]=true;_1.provide("dojo.data.util.simpleFetch");_1.require("dojo.data.util.sorter");_1.data.util.simpleFetch.fetch=function(_4){_4=_4||{};if(!_4.store){_4.store=this;}var _5=this;var _6=function(_7,_8){if(_8.onError){var _9=_8.scope||_1.global;_8.onError.call(_9,_7,_8);}};var _a=function(_b,_c){var _d=_c.abort||null;var _e=false;var _f=_c.start?_c.start:0;var _10=_c.count?(_f+_c.count):_b.length;_c.abort=function(){_e=true;if(_d){_d.call(_c);}};var _11=_c.scope||_1.global;if(!_c.store){_c.store=_5;}if(_c.onBegin){_c.onBegin.call(_11,_b.length,_c);}if(_c.sort){_b.sort(_1.data.util.sorter.createSortFunction(_c.sort,_5));}if(_c.onItem){for(var i=_f;(i<_b.length)&&(i<_10);++i){var _13=_b[i];if(!_e){_c.onItem.call(_11,_13,_c);}}}if(_c.onComplete&&!_e){var _14=null;if(!_c.onItem){_14=_b.slice(_f,_10);}_c.onComplete.call(_11,_14,_c);}};this._fetchItems(_4,_a,_6);return _4;};}}});
