/*
	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.PicasaStore"],["require","dojo.io.script"],["require","dojo.data.util.simpleFetch"],["require","dojo.date.stamp"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.data.PicasaStore"]){_4._hasResource["dojox.data.PicasaStore"]=true;_4.provide("dojox.data.PicasaStore");_4.require("dojo.io.script");_4.require("dojo.data.util.simpleFetch");_4.require("dojo.date.stamp");_4.declare("dojox.data.PicasaStore",null,{constructor:function(_7){if(_7&&_7.label){this.label=_7.label;}if(_7&&"urlPreventCache" in _7){this.urlPreventCache=_7.urlPreventCache?true:false;}if(_7&&"maxResults" in _7){this.maxResults=parseInt(_7.maxResults);if(!this.maxResults){this.maxResults=20;}}},_picasaUrl:"http://picasaweb.google.com/data/feed/api/all",_storeRef:"_S",label:"title",urlPreventCache:false,maxResults:20,_assertIsItem:function(_8){if(!this.isItem(_8)){throw new Error("dojox.data.PicasaStore: a function was passed an item argument that was not an item");}},_assertIsAttribute:function(_9){if(typeof _9!=="string"){throw new Error("dojox.data.PicasaStore: a function was passed an attribute argument that was not an attribute name string");}},getFeatures:function(){return {"dojo.data.api.Read":true};},getValue:function(_a,_b,_c){var _d=this.getValues(_a,_b);if(_d&&_d.length>0){return _d[0];}return _c;},getAttributes:function(_e){return ["id","published","updated","category","title$type","title","summary$type","summary","rights$type","rights","link","author","gphoto$id","gphoto$name","location","imageUrlSmall","imageUrlMedium","imageUrl","datePublished","dateTaken","description"];},hasAttribute:function(_f,_10){if(this.getValue(_f,_10)){return true;}return false;},isItemLoaded:function(_11){return this.isItem(_11);},loadItem:function(_12){},getLabel:function(_13){return this.getValue(_13,this.label);},getLabelAttributes:function(_14){return [this.label];},containsValue:function(_15,_16,_17){var _18=this.getValues(_15,_16);for(var i=0;i<_18.length;i++){if(_18[i]===_17){return true;}}return false;},getValues:function(_19,_1a){this._assertIsItem(_19);this._assertIsAttribute(_1a);if(_1a==="title"){return [this._unescapeHtml(_19.title)];}else{if(_1a==="author"){return [this._unescapeHtml(_19.author[0].name)];}else{if(_1a==="datePublished"){return [_4.date.stamp.fromISOString(_19.published)];}else{if(_1a==="dateTaken"){return [_4.date.stamp.fromISOString(_19.published)];}else{if(_1a==="updated"){return [_4.date.stamp.fromISOString(_19.updated)];}else{if(_1a==="imageUrlSmall"){return [_19.media.thumbnail[1].url];}else{if(_1a==="imageUrl"){return [_19.content$src];}else{if(_1a==="imageUrlMedium"){return [_19.media.thumbnail[2].url];}else{if(_1a==="link"){return [_19.link[1]];}else{if(_1a==="tags"){return _19.tags.split(" ");}else{if(_1a==="description"){return [this._unescapeHtml(_19.summary)];}}}}}}}}}}}return [];},isItem:function(_1b){if(_1b&&_1b[this._storeRef]===this){return true;}return false;},close:function(_1c){},_fetchItems:function(_1d,_1e,_1f){if(!_1d.query){_1d.query={};}var _20={alt:"jsonm",pp:"1",psc:"G"};_20["start-index"]="1";if(_1d.query.start){_20["start-index"]=_1d.query.start;}if(_1d.query.tags){_20.q=_1d.query.tags;}if(_1d.query.userid){_20.uname=_1d.query.userid;}if(_1d.query.userids){_20.ids=_1d.query.userids;}if(_1d.query.lang){_20.hl=_1d.query.lang;}_20["max-results"]=this.maxResults;var _21=this;var _22=null;var _23=function(_24){if(_22!==null){_4.disconnect(_22);}_1e(_21._processPicasaData(_24),_1d);};var _25={url:this._picasaUrl,preventCache:this.urlPreventCache,content:_20,callbackParamName:"callback",handle:_23};var _26=_4.io.script.get(_25);_26.addErrback(function(_27){_4.disconnect(_22);_1f(_27,_1d);});},_processPicasaData:function(_28){var _29=[];if(_28.feed){_29=_28.feed.entry;for(var i=0;i<_29.length;i++){var _2a=_29[i];_2a[this._storeRef]=this;}}return _29;},_unescapeHtml:function(str){if(str){str=str.replace(/&amp;/gm,"&").replace(/&lt;/gm,"<").replace(/&gt;/gm,">").replace(/&quot;/gm,"\"");str=str.replace(/&#39;/gm,"'");}return str;}});_4.extend(_6.data.PicasaStore,_4.data.util.simpleFetch);}}};});