/*
	Copyright (c) 2004-2010, 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
*/

/*
	This is an optimized version of Dojo, built for deployment and not for
	development. To get sources and documentation, please visit:

		http://dojotoolkit.org
*/

dojo.provide("pw.layers.autocomplete");if(!dojo._hasResource["dojox.storage.Provider"]){dojo._hasResource["dojox.storage.Provider"]=true;dojo.provide("dojox.storage.Provider");dojo.declare("dojox.storage.Provider",null,{constructor:function(){},SUCCESS:"success",FAILED:"failed",PENDING:"pending",SIZE_NOT_AVAILABLE:"Size not available",SIZE_NO_LIMIT:"No size limit",DEFAULT_NAMESPACE:"default",onHideSettingsUI:null,initialize:function(){},isAvailable:function(){},put:function(_1,_2,_3,_4){},get:function(_5,_6){},hasKey:function(_7,_8){return !!this.get(_7,_8);},getKeys:function(_9){},clear:function(_a){},remove:function(_b,_c){},getNamespaces:function(){},isPermanent:function(){},getMaximumSize:function(){},putMultiple:function(_d,_e,_f,_10){for(var i=0;i<_d.length;i++){dojox.storage.put(_d[i],_e[i],_f,_10);}},getMultiple:function(_11,_12){var _13=[];for(var i=0;i<_11.length;i++){_13.push(dojox.storage.get(_11[i],_12));}return _13;},removeMultiple:function(_14,_15){for(var i=0;i<_14.length;i++){dojox.storage.remove(_14[i],_15);}},isValidKeyArray:function(_16){if(_16===null||_16===undefined||!dojo.isArray(_16)){return false;}return !dojo.some(_16,function(key){return !this.isValidKey(key);},this);},hasSettingsUI:function(){return false;},showSettingsUI:function(){},hideSettingsUI:function(){},isValidKey:function(_17){if(_17===null||_17===undefined){return false;}return /^[0-9A-Za-z_]*$/.test(_17);},getResourceList:function(){return [];}});}if(!dojo._hasResource["dojox.storage.manager"]){dojo._hasResource["dojox.storage.manager"]=true;dojo.provide("dojox.storage.manager");dojox.storage.manager=new function(){this.currentProvider=null;this.available=false;this.providers=[];this._initialized=false;this._onLoadListeners=[];this.initialize=function(){this.autodetect();};this.register=function(_18,_19){this.providers.push(_19);this.providers[_18]=_19;};this.setProvider=function(_1a){};this.autodetect=function(){if(this._initialized){return;}var _1b=dojo.config["forceStorageProvider"]||false;var _1c;for(var i=0;i<this.providers.length;i++){_1c=this.providers[i];if(_1b&&_1b==_1c.declaredClass){_1c.isAvailable();break;}else{if(!_1b&&_1c.isAvailable()){break;}}}if(!_1c){this._initialized=true;this.available=false;this.currentProvider=null;this.loaded();return;}this.currentProvider=_1c;dojo.mixin(dojox.storage,this.currentProvider);dojox.storage.initialize();this._initialized=true;this.available=true;};this.isAvailable=function(){return this.available;};this.addOnLoad=function(_1d){this._onLoadListeners.push(_1d);if(this.isInitialized()){this._fireLoaded();}};this.removeOnLoad=function(_1e){for(var i=0;i<this._onLoadListeners.length;i++){if(_1e==this._onLoadListeners[i]){this._onLoadListeners=this._onLoadListeners.splice(i,1);break;}}};this.isInitialized=function(){if(this.currentProvider!=null&&this.currentProvider.declaredClass=="dojox.storage.FlashStorageProvider"&&dojox.flash.ready==false){return false;}else{return this._initialized;}};this.supportsProvider=function(_1f){try{var _20=eval("new "+_1f+"()");var _21=_20.isAvailable();if(!_21){return false;}return _21;}catch(e){return false;}};this.getProvider=function(){return this.currentProvider;};this.loaded=function(){this._fireLoaded();};this._fireLoaded=function(){dojo.forEach(this._onLoadListeners,function(i){try{i();}catch(e){}});};this.getResourceList=function(){var _22=[];dojo.forEach(dojox.storage.manager.providers,function(_23){_22=_22.concat(_23.getResourceList());});return _22;};};}if(!dojo._hasResource["dojo.gears"]){dojo._hasResource["dojo.gears"]=true;dojo.provide("dojo.gears");dojo.gears._gearsObject=function(){var _24;var _25;var _26=dojo.getObject("google.gears");if(_26){return _26;}if(typeof GearsFactory!="undefined"){_24=new GearsFactory();}else{if(dojo.isIE){try{_24=new ActiveXObject("Gears.Factory");}catch(e){}}else{if(navigator.mimeTypes["application/x-googlegears"]){_24=document.createElement("object");_24.setAttribute("type","application/x-googlegears");_24.setAttribute("width",0);_24.setAttribute("height",0);_24.style.display="none";document.documentElement.appendChild(_24);}}}if(!_24){return null;}dojo.setObject("google.gears.factory",_24);return dojo.getObject("google.gears");};dojo.gears.available=(!!dojo.gears._gearsObject())||0;}if(!dojo._hasResource["dojox.sql._crypto"]){dojo._hasResource["dojox.sql._crypto"]=true;dojo.provide("dojox.sql._crypto");dojo.mixin(dojox.sql._crypto,{_POOL_SIZE:100,encrypt:function(_27,_28,_29){this._initWorkerPool();var msg={plaintext:_27,password:_28};msg=dojo.toJson(msg);msg="encr:"+String(msg);this._assignWork(msg,_29);},decrypt:function(_2a,_2b,_2c){this._initWorkerPool();var msg={ciphertext:_2a,password:_2b};msg=dojo.toJson(msg);msg="decr:"+String(msg);this._assignWork(msg,_2c);},_initWorkerPool:function(){if(!this._manager){try{this._manager=google.gears.factory.create("beta.workerpool","1.0");this._unemployed=[];this._employed={};this._handleMessage=[];var _2d=this;this._manager.onmessage=function(msg,_2e){var _2f=_2d._employed["_"+_2e];_2d._employed["_"+_2e]=undefined;_2d._unemployed.push("_"+_2e);if(_2d._handleMessage.length){var _30=_2d._handleMessage.shift();_2d._assignWork(_30.msg,_30.callback);}_2f(msg);};var _31="function _workerInit(){"+"gearsWorkerPool.onmessage = "+String(this._workerHandler)+";"+"}";var _32=_31+" _workerInit();";for(var i=0;i<this._POOL_SIZE;i++){this._unemployed.push("_"+this._manager.createWorker(_32));}}catch(exp){throw exp.message||exp;}}},_assignWork:function(msg,_33){if(!this._handleMessage.length&&this._unemployed.length){var _34=this._unemployed.shift().substring(1);this._employed["_"+_34]=_33;this._manager.sendMessage(msg,parseInt(_34,10));}else{this._handleMessage={msg:msg,callback:_33};}},_workerHandler:function(msg,_35){var _36=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];var _37=[[0,0,0,0],[1,0,0,0],[2,0,0,0],[4,0,0,0],[8,0,0,0],[16,0,0,0],[32,0,0,0],[64,0,0,0],[128,0,0,0],[27,0,0,0],[54,0,0,0]];function _38(_39,w){var Nb=4;var Nr=w.length/Nb-1;var _3a=[[],[],[],[]];for(var i=0;i<4*Nb;i++){_3a[i%4][Math.floor(i/4)]=_39[i];}_3a=_3b(_3a,w,0,Nb);for(var _3c=1;_3c<Nr;_3c++){_3a=_3d(_3a,Nb);_3a=_3e(_3a,Nb);_3a=_3f(_3a,Nb);_3a=_3b(_3a,w,_3c,Nb);}_3a=_3d(_3a,Nb);_3a=_3e(_3a,Nb);_3a=_3b(_3a,w,Nr,Nb);var _40=new Array(4*Nb);for(var i=0;i<4*Nb;i++){_40[i]=_3a[i%4][Math.floor(i/4)];}return _40;};function _3d(s,Nb){for(var r=0;r<4;r++){for(var c=0;c<Nb;c++){s[r][c]=_36[s[r][c]];}}return s;};function _3e(s,Nb){var t=new Array(4);for(var r=1;r<4;r++){for(var c=0;c<4;c++){t[c]=s[r][(c+r)%Nb];}for(var c=0;c<4;c++){s[r][c]=t[c];}}return s;};function _3f(s,Nb){for(var c=0;c<4;c++){var a=new Array(4);var b=new Array(4);for(var i=0;i<4;i++){a[i]=s[i][c];b[i]=s[i][c]&128?s[i][c]<<1^283:s[i][c]<<1;}s[0][c]=b[0]^a[1]^b[1]^a[2]^a[3];s[1][c]=a[0]^b[1]^a[2]^b[2]^a[3];s[2][c]=a[0]^a[1]^b[2]^a[3]^b[3];s[3][c]=a[0]^b[0]^a[1]^a[2]^b[3];}return s;};function _3b(_41,w,rnd,Nb){for(var r=0;r<4;r++){for(var c=0;c<Nb;c++){_41[r][c]^=w[rnd*4+c][r];}}return _41;};function _42(key){var Nb=4;var Nk=key.length/4;var Nr=Nk+6;var w=new Array(Nb*(Nr+1));var _43=new Array(4);for(var i=0;i<Nk;i++){var r=[key[4*i],key[4*i+1],key[4*i+2],key[4*i+3]];w[i]=r;}for(var i=Nk;i<(Nb*(Nr+1));i++){w[i]=new Array(4);for(var t=0;t<4;t++){_43[t]=w[i-1][t];}if(i%Nk==0){_43=_44(_45(_43));for(var t=0;t<4;t++){_43[t]^=_37[i/Nk][t];}}else{if(Nk>6&&i%Nk==4){_43=_44(_43);}}for(var t=0;t<4;t++){w[i][t]=w[i-Nk][t]^_43[t];}}return w;};function _44(w){for(var i=0;i<4;i++){w[i]=_36[w[i]];}return w;};function _45(w){w[4]=w[0];for(var i=0;i<4;i++){w[i]=w[i+1];}return w;};function _46(_47,_48,_49){if(!(_49==128||_49==192||_49==256)){return "";}var _4a=_49/8;var _4b=new Array(_4a);for(var i=0;i<_4a;i++){_4b[i]=_48.charCodeAt(i)&255;}var key=_38(_4b,_42(_4b));key=key.concat(key.slice(0,_4a-16));var _4c=16;var _4d=new Array(_4c);var _4e=(new Date()).getTime();for(var i=0;i<4;i++){_4d[i]=(_4e>>>i*8)&255;}for(var i=0;i<4;i++){_4d[i+4]=(_4e/4294967296>>>i*8)&255;}var _4f=_42(key);var _50=Math.ceil(_47.length/_4c);var _51=new Array(_50);for(var b=0;b<_50;b++){for(var c=0;c<4;c++){_4d[15-c]=(b>>>c*8)&255;}for(var c=0;c<4;c++){_4d[15-c-4]=(b/4294967296>>>c*8);}var _52=_38(_4d,_4f);var _53=b<_50-1?_4c:(_47.length-1)%_4c+1;var ct="";for(var i=0;i<_53;i++){var _54=_47.charCodeAt(b*_4c+i);var _55=_54^_52[i];ct+=String.fromCharCode(_55);}_51[b]=_56(ct);}var _57="";for(var i=0;i<8;i++){_57+=String.fromCharCode(_4d[i]);}_57=_56(_57);return _57+"-"+_51.join("-");};function _58(_59,_5a,_5b){if(!(_5b==128||_5b==192||_5b==256)){return "";}var _5c=_5b/8;var _5d=new Array(_5c);for(var i=0;i<_5c;i++){_5d[i]=_5a.charCodeAt(i)&255;}var _5e=_42(_5d);var key=_38(_5d,_5e);key=key.concat(key.slice(0,_5c-16));var _5f=_42(key);_59=_59.split("-");var _60=16;var _61=new Array(_60);var _62=_63(_59[0]);for(var i=0;i<8;i++){_61[i]=_62.charCodeAt(i);}var _64=new Array(_59.length-1);for(var b=1;b<_59.length;b++){for(var c=0;c<4;c++){_61[15-c]=((b-1)>>>c*8)&255;}for(var c=0;c<4;c++){_61[15-c-4]=((b/4294967296-1)>>>c*8)&255;}var _65=_38(_61,_5f);_59[b]=_63(_59[b]);var pt="";for(var i=0;i<_59[b].length;i++){var _66=_59[b].charCodeAt(i);var _67=_66^_65[i];pt+=String.fromCharCode(_67);}_64[b-1]=pt;}return _64.join("");};function _56(str){return str.replace(/[\0\t\n\v\f\r\xa0!-]/g,function(c){return "!"+c.charCodeAt(0)+"!";});};function _63(str){return str.replace(/!\d\d?\d?!/g,function(c){return String.fromCharCode(c.slice(1,-1));});};function _68(_69,_6a){return _46(_69,_6a,256);};function _6b(_6c,_6d){return _58(_6c,_6d,256);};var cmd=msg.substr(0,4);var arg=msg.substr(5);if(cmd=="encr"){arg=eval("("+arg+")");var _6e=arg.plaintext;var _6f=arg.password;var _70=_68(_6e,_6f);gearsWorkerPool.sendMessage(String(_70),_35);}else{if(cmd=="decr"){arg=eval("("+arg+")");var _71=arg.ciphertext;var _6f=arg.password;var _70=_6b(_71,_6f);gearsWorkerPool.sendMessage(String(_70),_35);}}}});}if(!dojo._hasResource["dojox.sql._base"]){dojo._hasResource["dojox.sql._base"]=true;dojo.provide("dojox.sql._base");dojo.mixin(dojox.sql,{dbName:null,debug:(dojo.exists("dojox.sql.debug")?dojox.sql.debug:false),open:function(_72){if(this._dbOpen&&(!_72||_72==this.dbName)){return;}if(!this.dbName){this.dbName="dot_store_"+window.location.href.replace(/[^0-9A-Za-z_]/g,"_");if(this.dbName.length>63){this.dbName=this.dbName.substring(0,63);}}if(!_72){_72=this.dbName;}try{this._initDb();this.db.open(_72);this._dbOpen=true;}catch(exp){throw exp.message||exp;}},close:function(_73){if(dojo.isIE){return;}if(!this._dbOpen&&(!_73||_73==this.dbName)){return;}if(!_73){_73=this.dbName;}try{this.db.close(_73);this._dbOpen=false;}catch(exp){throw exp.message||exp;}},_exec:function(_74){try{this._initDb();if(!this._dbOpen){this.open();this._autoClose=true;}var sql=null;var _75=null;var _76=null;var _77=dojo._toArray(_74);sql=_77.splice(0,1)[0];if(this._needsEncrypt(sql)||this._needsDecrypt(sql)){_75=_77.splice(_77.length-1,1)[0];_76=_77.splice(_77.length-1,1)[0];}if(this.debug){this._printDebugSQL(sql,_77);}var _78;if(this._needsEncrypt(sql)){_78=new dojox.sql._SQLCrypto("encrypt",sql,_76,_77,_75);return null;}else{if(this._needsDecrypt(sql)){_78=new dojox.sql._SQLCrypto("decrypt",sql,_76,_77,_75);return null;}}var rs=this.db.execute(sql,_77);rs=this._normalizeResults(rs);if(this._autoClose){this.close();}return rs;}catch(exp){exp=exp.message||exp;if(this._autoClose){try{this.close();}catch(e){}}throw exp;}return null;},_initDb:function(){if(!this.db){try{this.db=google.gears.factory.create("beta.database","1.0");}catch(exp){dojo.setObject("google.gears.denied",true);if(dojox.off){dojox.off.onFrameworkEvent("coreOperationFailed");}throw "Google Gears must be allowed to run";}}},_printDebugSQL:function(sql,_79){var msg="dojox.sql(\""+sql+"\"";for(var i=0;i<_79.length;i++){if(typeof _79[i]=="string"){msg+=", \""+_79[i]+"\"";}else{msg+=", "+_79[i];}}msg+=")";},_normalizeResults:function(rs){var _7a=[];if(!rs){return [];}while(rs.isValidRow()){var row={};for(var i=0;i<rs.fieldCount();i++){var _7b=rs.fieldName(i);var _7c=rs.field(i);row[_7b]=_7c;}_7a.push(row);rs.next();}rs.close();return _7a;},_needsEncrypt:function(sql){return /encrypt\([^\)]*\)/i.test(sql);},_needsDecrypt:function(sql){return /decrypt\([^\)]*\)/i.test(sql);}});dojo.declare("dojox.sql._SQLCrypto",null,{constructor:function(_7d,sql,_7e,_7f,_80){if(_7d=="encrypt"){this._execEncryptSQL(sql,_7e,_7f,_80);}else{this._execDecryptSQL(sql,_7e,_7f,_80);}},_execEncryptSQL:function(sql,_81,_82,_83){var _84=this._stripCryptoSQL(sql);var _85=this._flagEncryptedArgs(sql,_82);var _86=this;this._encrypt(_84,_81,_82,_85,function(_87){var _88=false;var _89=[];var exp=null;try{_89=dojox.sql.db.execute(_84,_87);}catch(execError){_88=true;exp=execError.message||execError;}if(exp!=null){if(dojox.sql._autoClose){try{dojox.sql.close();}catch(e){}}_83(null,true,exp.toString());return;}_89=dojox.sql._normalizeResults(_89);if(dojox.sql._autoClose){dojox.sql.close();}if(dojox.sql._needsDecrypt(sql)){var _8a=_86._determineDecryptedColumns(sql);_86._decrypt(_89,_8a,_81,function(_8b){_83(_8b,false,null);});}else{_83(_89,false,null);}});},_execDecryptSQL:function(sql,_8c,_8d,_8e){var _8f=this._stripCryptoSQL(sql);var _90=this._determineDecryptedColumns(sql);var _91=false;var _92=[];var exp=null;try{_92=dojox.sql.db.execute(_8f,_8d);}catch(execError){_91=true;exp=execError.message||execError;}if(exp!=null){if(dojox.sql._autoClose){try{dojox.sql.close();}catch(e){}}_8e(_92,true,exp.toString());return;}_92=dojox.sql._normalizeResults(_92);if(dojox.sql._autoClose){dojox.sql.close();}this._decrypt(_92,_90,_8c,function(_93){_8e(_93,false,null);});},_encrypt:function(sql,_94,_95,_96,_97){this._totalCrypto=0;this._finishedCrypto=0;this._finishedSpawningCrypto=false;this._finalArgs=_95;for(var i=0;i<_95.length;i++){if(_96[i]){var _98=_95[i];var _99=i;this._totalCrypto++;dojox.sql._crypto.encrypt(_98,_94,dojo.hitch(this,function(_9a){this._finalArgs[_99]=_9a;this._finishedCrypto++;if(this._finishedCrypto>=this._totalCrypto&&this._finishedSpawningCrypto){_97(this._finalArgs);}}));}}this._finishedSpawningCrypto=true;},_decrypt:function(_9b,_9c,_9d,_9e){this._totalCrypto=0;this._finishedCrypto=0;this._finishedSpawningCrypto=false;this._finalResultSet=_9b;for(var i=0;i<_9b.length;i++){var row=_9b[i];for(var _9f in row){if(_9c=="*"||_9c[_9f]){this._totalCrypto++;var _a0=row[_9f];this._decryptSingleColumn(_9f,_a0,_9d,i,function(_a1){_9e(_a1);});}}}this._finishedSpawningCrypto=true;},_stripCryptoSQL:function(sql){sql=sql.replace(/DECRYPT\(\*\)/ig,"*");var _a2=sql.match(/ENCRYPT\([^\)]*\)/ig);if(_a2!=null){for(var i=0;i<_a2.length;i++){var _a3=_a2[i];var _a4=_a3.match(/ENCRYPT\(([^\)]*)\)/i)[1];sql=sql.replace(_a3,_a4);}}_a2=sql.match(/DECRYPT\([^\)]*\)/ig);if(_a2!=null){for(i=0;i<_a2.length;i++){var _a5=_a2[i];var _a6=_a5.match(/DECRYPT\(([^\)]*)\)/i)[1];sql=sql.replace(_a5,_a6);}}return sql;},_flagEncryptedArgs:function(sql,_a7){var _a8=new RegExp(/([\"][^\"]*\?[^\"]*[\"])|([\'][^\']*\?[^\']*[\'])|(\?)/ig);var _a9;var _aa=0;var _ab=[];while((_a9=_a8.exec(sql))!=null){var _ac=RegExp.lastMatch+"";if(/^[\"\']/.test(_ac)){continue;}var _ad=false;if(/ENCRYPT\([^\)]*$/i.test(RegExp.leftContext)){_ad=true;}_ab[_aa]=_ad;_aa++;}return _ab;},_determineDecryptedColumns:function(sql){var _ae={};if(/DECRYPT\(\*\)/i.test(sql)){_ae="*";}else{var _af=/DECRYPT\((?:\s*\w*\s*\,?)*\)/ig;var _b0=_af.exec(sql);while(_b0){var _b1=new String(RegExp.lastMatch);var _b2=_b1.replace(/DECRYPT\(/i,"");_b2=_b2.replace(/\)/,"");_b2=_b2.split(/\s*,\s*/);dojo.forEach(_b2,function(_b3){if(/\s*\w* AS (\w*)/i.test(_b3)){_b3=_b3.match(/\s*\w* AS (\w*)/i)[1];}_ae[_b3]=true;});_b0=_af.exec(sql);}}return _ae;},_decryptSingleColumn:function(_b4,_b5,_b6,_b7,_b8){dojox.sql._crypto.decrypt(_b5,_b6,dojo.hitch(this,function(_b9){this._finalResultSet[_b7][_b4]=_b9;this._finishedCrypto++;if(this._finishedCrypto>=this._totalCrypto&&this._finishedSpawningCrypto){_b8(this._finalResultSet);}}));}});(function(){var _ba=dojox.sql;dojox.sql=new Function("return dojox.sql._exec(arguments);");dojo.mixin(dojox.sql,_ba);})();}if(!dojo._hasResource["dojox.sql"]){dojo._hasResource["dojox.sql"]=true;dojo.provide("dojox.sql");}if(!dojo._hasResource["dojox.storage.GearsStorageProvider"]){dojo._hasResource["dojox.storage.GearsStorageProvider"]=true;dojo.provide("dojox.storage.GearsStorageProvider");if(dojo.gears.available){(function(){dojo.declare("dojox.storage.GearsStorageProvider",dojox.storage.Provider,{constructor:function(){},TABLE_NAME:"__DOJO_STORAGE",initialized:false,_available:null,_storageReady:false,initialize:function(){if(dojo.config["disableGearsStorage"]==true){return;}this.TABLE_NAME="__DOJO_STORAGE";this.initialized=true;dojox.storage.manager.loaded();},isAvailable:function(){return this._available=dojo.gears.available;},put:function(key,_bb,_bc,_bd){this._initStorage();if(!this.isValidKey(key)){throw new Error("Invalid key given: "+key);}_bd=_bd||this.DEFAULT_NAMESPACE;if(!this.isValidKey(_bd)){throw new Error("Invalid namespace given: "+key);}if(dojo.isString(_bb)){_bb="string:"+_bb;}else{_bb=dojo.toJson(_bb);}try{dojox.sql("DELETE FROM "+this.TABLE_NAME+" WHERE namespace = ? AND key = ?",_bd,key);dojox.sql("INSERT INTO "+this.TABLE_NAME+" VALUES (?, ?, ?)",_bd,key,_bb);}catch(e){_bc(this.FAILED,key,e.toString(),_bd);return;}if(_bc){_bc(dojox.storage.SUCCESS,key,null,_bd);}},get:function(key,_be){this._initStorage();if(!this.isValidKey(key)){throw new Error("Invalid key given: "+key);}_be=_be||this.DEFAULT_NAMESPACE;if(!this.isValidKey(_be)){throw new Error("Invalid namespace given: "+key);}var _bf=dojox.sql("SELECT * FROM "+this.TABLE_NAME+" WHERE namespace = ? AND "+" key = ?",_be,key);if(!_bf.length){return null;}else{_bf=_bf[0].value;}if(dojo.isString(_bf)&&(/^string:/.test(_bf))){_bf=_bf.substring("string:".length);}else{_bf=dojo.fromJson(_bf);}return _bf;},getNamespaces:function(){this._initStorage();var _c0=[dojox.storage.DEFAULT_NAMESPACE];var rs=dojox.sql("SELECT namespace FROM "+this.TABLE_NAME+" DESC GROUP BY namespace");for(var i=0;i<rs.length;i++){if(rs[i].namespace!=dojox.storage.DEFAULT_NAMESPACE){_c0.push(rs[i].namespace);}}return _c0;},getKeys:function(_c1){this._initStorage();_c1=_c1||this.DEFAULT_NAMESPACE;if(!this.isValidKey(_c1)){throw new Error("Invalid namespace given: "+_c1);}var rs=dojox.sql("SELECT key FROM "+this.TABLE_NAME+" WHERE namespace = ?",_c1);var _c2=[];for(var i=0;i<rs.length;i++){_c2.push(rs[i].key);}return _c2;},clear:function(_c3){this._initStorage();_c3=_c3||this.DEFAULT_NAMESPACE;if(!this.isValidKey(_c3)){throw new Error("Invalid namespace given: "+_c3);}dojox.sql("DELETE FROM "+this.TABLE_NAME+" WHERE namespace = ?",_c3);},remove:function(key,_c4){this._initStorage();if(!this.isValidKey(key)){throw new Error("Invalid key given: "+key);}_c4=_c4||this.DEFAULT_NAMESPACE;if(!this.isValidKey(_c4)){throw new Error("Invalid namespace given: "+key);}dojox.sql("DELETE FROM "+this.TABLE_NAME+" WHERE namespace = ? AND"+" key = ?",_c4,key);},putMultiple:function(_c5,_c6,_c7,_c8){this._initStorage();if(!this.isValidKeyArray(_c5)||!_c6 instanceof Array||_c5.length!=_c6.length){throw new Error("Invalid arguments: keys = ["+_c5+"], values = ["+_c6+"]");}if(_c8==null||typeof _c8=="undefined"){_c8=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_c8)){throw new Error("Invalid namespace given: "+_c8);}this._statusHandler=_c7;try{dojox.sql.open();dojox.sql.db.execute("BEGIN TRANSACTION");var _c9="REPLACE INTO "+this.TABLE_NAME+" VALUES (?, ?, ?)";for(var i=0;i<_c5.length;i++){var _ca=_c6[i];if(dojo.isString(_ca)){_ca="string:"+_ca;}else{_ca=dojo.toJson(_ca);}dojox.sql.db.execute(_c9,[_c8,_c5[i],_ca]);}dojox.sql.db.execute("COMMIT TRANSACTION");dojox.sql.close();}catch(e){if(_c7){_c7(this.FAILED,_c5,e.toString(),_c8);}return;}if(_c7){_c7(dojox.storage.SUCCESS,_c5,null,_c8);}},getMultiple:function(_cb,_cc){this._initStorage();if(!this.isValidKeyArray(_cb)){throw new ("Invalid key array given: "+_cb);}if(_cc==null||typeof _cc=="undefined"){_cc=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_cc)){throw new Error("Invalid namespace given: "+_cc);}var _cd="SELECT * FROM "+this.TABLE_NAME+" WHERE namespace = ? AND "+" key = ?";var _ce=[];for(var i=0;i<_cb.length;i++){var _cf=dojox.sql(_cd,_cc,_cb[i]);if(!_cf.length){_ce[i]=null;}else{_cf=_cf[0].value;if(dojo.isString(_cf)&&(/^string:/.test(_cf))){_ce[i]=_cf.substring("string:".length);}else{_ce[i]=dojo.fromJson(_cf);}}}return _ce;},removeMultiple:function(_d0,_d1){this._initStorage();if(!this.isValidKeyArray(_d0)){throw new Error("Invalid arguments: keys = ["+_d0+"]");}if(_d1==null||typeof _d1=="undefined"){_d1=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_d1)){throw new Error("Invalid namespace given: "+_d1);}dojox.sql.open();dojox.sql.db.execute("BEGIN TRANSACTION");var _d2="DELETE FROM "+this.TABLE_NAME+" WHERE namespace = ? AND key = ?";for(var i=0;i<_d0.length;i++){dojox.sql.db.execute(_d2,[_d1,_d0[i]]);}dojox.sql.db.execute("COMMIT TRANSACTION");dojox.sql.close();},isPermanent:function(){return true;},getMaximumSize:function(){return this.SIZE_NO_LIMIT;},hasSettingsUI:function(){return false;},showSettingsUI:function(){throw new Error(this.declaredClass+" does not support a storage settings user-interface");},hideSettingsUI:function(){throw new Error(this.declaredClass+" does not support a storage settings user-interface");},_initStorage:function(){if(this._storageReady){return;}if(!google.gears.factory.hasPermission){var _d3=null;var _d4=null;var msg="This site would like to use Google Gears to enable "+"enhanced functionality.";var _d5=google.gears.factory.getPermission(_d3,_d4,msg);if(!_d5){throw new Error("You must give permission to use Gears in order to "+"store data");}}try{dojox.sql("CREATE TABLE IF NOT EXISTS "+this.TABLE_NAME+"( "+" namespace TEXT, "+" key TEXT, "+" value TEXT "+")");dojox.sql("CREATE UNIQUE INDEX IF NOT EXISTS namespace_key_index"+" ON "+this.TABLE_NAME+" (namespace, key)");}catch(e){throw new Error("Unable to create storage tables for Gears in "+"Dojo Storage");}this._storageReady=true;}});dojox.storage.manager.register("dojox.storage.GearsStorageProvider",new dojox.storage.GearsStorageProvider());})();}}if(!dojo._hasResource["dojox.storage.WhatWGStorageProvider"]){dojo._hasResource["dojox.storage.WhatWGStorageProvider"]=true;dojo.provide("dojox.storage.WhatWGStorageProvider");dojo.declare("dojox.storage.WhatWGStorageProvider",[dojox.storage.Provider],{initialized:false,_domain:null,_available:null,_statusHandler:null,_allNamespaces:null,_storageEventListener:null,initialize:function(){if(dojo.config["disableWhatWGStorage"]==true){return;}this._domain=location.hostname;this.initialized=true;dojox.storage.manager.loaded();},isAvailable:function(){if(typeof localStorage=="undefined"){this._available=false;return this._available;}this._available=true;return this._available;},put:function(key,_d6,_d7,_d8){if(this.isValidKey(key)==false){throw new Error("Invalid key given: "+key);}_d8=_d8||this.DEFAULT_NAMESPACE;key=this.getFullKey(key,_d8);this._statusHandler=_d7;if(dojo.isString(_d6)){_d6="string:"+_d6;}else{_d6=dojo.toJson(_d6);}var _d9=dojo.hitch(this,function(evt){if(window.detachEvent){window.detachEvent("onstorage",_d9);}else{window.removeEventListener("storage",_d9,false);}if(_d7){_d7.call(null,this.SUCCESS,key,null,_d8);}});if(window.attachEvent){window.attachEvent("onstorage",_d9);}else{if(window.addEventListener){window.addEventListener("storage",_d9,false);}}try{var _da=localStorage;_da.setItem(key,_d6);}catch(e){this._statusHandler.call(null,this.FAILED,key,e.toString(),_d8);}},get:function(key,_db){if(this.isValidKey(key)==false){throw new Error("Invalid key given: "+key);}_db=_db||this.DEFAULT_NAMESPACE;key=this.getFullKey(key,_db);var _dc=localStorage;var _dd=_dc.getItem(key);if(_dd==null||_dd==""){return null;}if(dojo.isString(_dd)&&(/^string:/.test(_dd))){_dd=_dd.substring("string:".length);}else{_dd=dojo.fromJson(_dd);}return _dd;},getNamespaces:function(){var _de=[this.DEFAULT_NAMESPACE];var _df={};var _e0=localStorage;var _e1=/^__([^_]*)_/;for(var i=0;i<_e0.length;i++){var _e2=_e0.key(i);if(_e1.test(_e2)==true){var _e3=_e2.match(_e1)[1];if(typeof _df[_e3]=="undefined"){_df[_e3]=true;_de.push(_e3);}}}return _de;},getKeys:function(_e4){_e4=_e4||this.DEFAULT_NAMESPACE;if(this.isValidKey(_e4)==false){throw new Error("Invalid namespace given: "+_e4);}var _e5;if(_e4==this.DEFAULT_NAMESPACE){_e5=new RegExp("^([^_]{2}.*)$");}else{_e5=new RegExp("^__"+_e4+"_(.*)$");}var _e6=localStorage;var _e7=[];for(var i=0;i<_e6.length;i++){var _e8=_e6.key(i);if(_e5.test(_e8)==true){_e8=_e8.match(_e5)[1];_e7.push(_e8);}}return _e7;},clear:function(_e9){_e9=_e9||this.DEFAULT_NAMESPACE;if(this.isValidKey(_e9)==false){throw new Error("Invalid namespace given: "+_e9);}var _ea;if(_e9==this.DEFAULT_NAMESPACE){_ea=new RegExp("^[^_]{2}");}else{_ea=new RegExp("^__"+_e9+"_");}var _eb=localStorage;var _ec=[];for(var i=0;i<_eb.length;i++){if(_ea.test(_eb.key(i))==true){_ec[_ec.length]=_eb.key(i);}}dojo.forEach(_ec,dojo.hitch(_eb,"removeItem"));},remove:function(key,_ed){key=this.getFullKey(key,_ed);var _ee=localStorage;_ee.removeItem(key);},isPermanent:function(){return true;},getMaximumSize:function(){return this.SIZE_NO_LIMIT;},hasSettingsUI:function(){return false;},showSettingsUI:function(){throw new Error(this.declaredClass+" does not support a storage settings user-interface");},hideSettingsUI:function(){throw new Error(this.declaredClass+" does not support a storage settings user-interface");},getFullKey:function(key,_ef){_ef=_ef||this.DEFAULT_NAMESPACE;if(this.isValidKey(_ef)==false){throw new Error("Invalid namespace given: "+_ef);}if(_ef==this.DEFAULT_NAMESPACE){return key;}else{return "__"+_ef+"_"+key;}}});dojox.storage.manager.register("dojox.storage.WhatWGStorageProvider",new dojox.storage.WhatWGStorageProvider());}if(!dojo._hasResource["dojox.flash._base"]){dojo._hasResource["dojox.flash._base"]=true;dojo.provide("dojox.flash._base");dojo.experimental("dojox.flash");dojox.flash=function(){};dojox.flash={ready:false,url:null,_visible:true,_loadedListeners:[],_installingListeners:[],setSwf:function(url,_f0){this.url=url;this._visible=true;if(_f0!==null&&_f0!==undefined){this._visible=_f0;}this._initialize();},addLoadedListener:function(_f1){this._loadedListeners.push(_f1);},addInstallingListener:function(_f2){this._installingListeners.push(_f2);},loaded:function(){dojox.flash.ready=true;if(dojox.flash._loadedListeners.length){for(var i=0;i<dojox.flash._loadedListeners.length;i++){dojox.flash._loadedListeners[i].call(null);}}},installing:function(){if(dojox.flash._installingListeners.length){for(var i=0;i<dojox.flash._installingListeners.length;i++){dojox.flash._installingListeners[i].call(null);}}},_initialize:function(){var _f3=new dojox.flash.Install();dojox.flash.installer=_f3;if(_f3.needed()){_f3.install();}else{dojox.flash.obj=new dojox.flash.Embed(this._visible);dojox.flash.obj.write();dojox.flash.comm=new dojox.flash.Communicator();}}};dojox.flash.Info=function(){this._detectVersion();};dojox.flash.Info.prototype={version:-1,versionMajor:-1,versionMinor:-1,versionRevision:-1,capable:false,installing:false,isVersionOrAbove:function(_f4,_f5,_f6){_f6=parseFloat("."+_f6);if(this.versionMajor>=_f4&&this.versionMinor>=_f5&&this.versionRevision>=_f6){return true;}else{return false;}},_detectVersion:function(){var _f7;for(var _f8=25;_f8>0;_f8--){if(dojo.isIE){var axo;try{if(_f8>6){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_f8);}else{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}if(typeof axo=="object"){if(_f8==6){axo.AllowScriptAccess="always";}_f7=axo.GetVariable("$version");}}catch(e){continue;}}else{_f7=this._JSFlashInfo(_f8);}if(_f7==-1){this.capable=false;return;}else{if(_f7!=0){var _f9;if(dojo.isIE){var _fa=_f7.split(" ");var _fb=_fa[1];_f9=_fb.split(",");}else{_f9=_f7.split(".");}this.versionMajor=_f9[0];this.versionMinor=_f9[1];this.versionRevision=_f9[2];var _fc=this.versionMajor+"."+this.versionRevision;this.version=parseFloat(_fc);this.capable=true;break;}}}},_JSFlashInfo:function(_fd){if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var _fe=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var _ff=navigator.plugins["Shockwave Flash"+_fe].description;var _100=_ff.split(" ");var _101=_100[2].split(".");var _102=_101[0];var _103=_101[1];var _104=(_100[3]||_100[4]).split("r");var _105=_104[1]>0?_104[1]:0;var _106=_102+"."+_103+"."+_105;return _106;}}return -1;}};dojox.flash.Embed=function(_107){this._visible=_107;};dojox.flash.Embed.prototype={width:215,height:138,id:"flashObject",_visible:true,protocol:function(){switch(window.location.protocol){case "https:":return "https";break;default:return "http";break;}},write:function(_108){var _109;var _10a=dojox.flash.url;var _10b=_10a;var _10c=_10a;var _10d=dojo.baseUrl;var _10e=document.location.protocol+"//"+document.location.host;if(_108){var _10f=escape(window.location);document.title=document.title.slice(0,47)+" - Flash Player Installation";var _110=escape(document.title);_10b+="?MMredirectURL="+_10f+"&MMplayerType=ActiveX"+"&MMdoctitle="+_110+"&baseUrl="+escape(_10d)+"&xdomain="+escape(_10e);_10c+="?MMredirectURL="+_10f+"&MMplayerType=PlugIn"+"&baseUrl="+escape(_10d)+"&xdomain="+escape(_10e);}else{_10b+="?cachebust="+new Date().getTime();_10b+="&baseUrl="+escape(_10d);_10b+="&xdomain="+escape(_10e);}if(_10c.indexOf("?")==-1){_10c+="?baseUrl="+escape(_10d);}else{_10c+="&baseUrl="+escape(_10d);}_10c+="&xdomain="+escape(_10e);_109="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" "+"codebase=\""+this.protocol()+"://fpdownload.macromedia.com/pub/shockwave/cabs/flash/"+"swflash.cab#version=8,0,0,0\"\n "+"width=\""+this.width+"\"\n "+"height=\""+this.height+"\"\n "+"id=\""+this.id+"\"\n "+"name=\""+this.id+"\"\n "+"align=\"middle\">\n "+"<param name=\"allowScriptAccess\" value=\"always\"></param>\n "+"<param name=\"movie\" value=\""+_10b+"\"></param>\n "+"<param name=\"quality\" value=\"high\"></param>\n "+"<param name=\"bgcolor\" value=\"#ffffff\"></param>\n "+"<embed src=\""+_10c+"\" "+"quality=\"high\" "+"bgcolor=\"#ffffff\" "+"width=\""+this.width+"\" "+"height=\""+this.height+"\" "+"id=\""+this.id+"Embed"+"\" "+"name=\""+this.id+"\" "+"swLiveConnect=\"true\" "+"align=\"middle\" "+"allowScriptAccess=\"always\" "+"type=\"application/x-shockwave-flash\" "+"pluginspage=\""+this.protocol()+"://www.macromedia.com/go/getflashplayer\" "+"></embed>\n"+"</object>\n";dojo.connect(dojo,"loaded",dojo.hitch(this,function(){var _111=this.id+"Container";if(dojo.byId(_111)){return;}var div=document.createElement("div");div.id=this.id+"Container";div.style.width=this.width+"px";div.style.height=this.height+"px";if(!this._visible){div.style.position="absolute";div.style.zIndex="10000";div.style.top="-1000px";}div.innerHTML=_109;var body=document.getElementsByTagName("body");if(!body||!body.length){throw new Error("No body tag for this page");}body=body[0];body.appendChild(div);}));},get:function(){if(dojo.isIE||dojo.isWebKit){return dojo.byId(this.id);}else{return document[this.id+"Embed"];}},setVisible:function(_112){var _113=dojo.byId(this.id+"Container");if(_112){_113.style.position="absolute";_113.style.visibility="visible";}else{_113.style.position="absolute";_113.style.y="-1000px";_113.style.visibility="hidden";}},center:function(){var _114=this.width;var _115=this.height;var _116=dojo.window.getBox();var x=_116.l+(_116.w-_114)/2;var y=_116.t+(_116.h-_115)/2;var _117=dojo.byId(this.id+"Container");_117.style.top=y+"px";_117.style.left=x+"px";}};dojox.flash.Communicator=function(){};dojox.flash.Communicator.prototype={_addExternalInterfaceCallback:function(_118){var _119=dojo.hitch(this,function(){var _11a=new Array(arguments.length);for(var i=0;i<arguments.length;i++){_11a[i]=this._encodeData(arguments[i]);}var _11b=this._execFlash(_118,_11a);_11b=this._decodeData(_11b);return _11b;});this[_118]=_119;},_encodeData:function(data){if(!data||typeof data!="string"){return data;}data=data.replace("\\","&custom_backslash;");data=data.replace(/\0/g,"&custom_null;");return data;},_decodeData:function(data){if(data&&data.length&&typeof data!="string"){data=data[0];}if(!data||typeof data!="string"){return data;}data=data.replace(/\&custom_null\;/g,"\x00");data=data.replace(/\&custom_lt\;/g,"<").replace(/\&custom_gt\;/g,">").replace(/\&custom_backslash\;/g,"\\");return data;},_execFlash:function(_11c,_11d){var _11e=dojox.flash.obj.get();_11d=(_11d)?_11d:[];for(var i=0;i<_11d;i++){if(typeof _11d[i]=="string"){_11d[i]=this._encodeData(_11d[i]);}}var _11f=function(){return eval(_11e.CallFunction("<invoke name=\""+_11c+"\" returntype=\"javascript\">"+__flash__argumentsToXML(_11d,0)+"</invoke>"));};var _120=_11f.call(_11d);if(typeof _120=="string"){_120=this._decodeData(_120);}return _120;}};dojox.flash.Install=function(){};dojox.flash.Install.prototype={needed:function(){if(!dojox.flash.info.capable){return true;}if(!dojox.flash.info.isVersionOrAbove(8,0,0)){return true;}return false;},install:function(){var _121;dojox.flash.info.installing=true;dojox.flash.installing();if(dojox.flash.info.capable==false){_121=new dojox.flash.Embed(false);_121.write();}else{if(dojox.flash.info.isVersionOrAbove(6,0,65)){_121=new dojox.flash.Embed(false);_121.write(true);_121.setVisible(true);_121.center();}else{alert("This content requires a more recent version of the Macromedia "+" Flash Player.");window.location.href=+dojox.flash.Embed.protocol()+"://www.macromedia.com/go/getflashplayer";}}},_onInstallStatus:function(msg){if(msg=="Download.Complete"){dojox.flash._initialize();}else{if(msg=="Download.Cancelled"){alert("This content requires a more recent version of the Macromedia "+" Flash Player.");window.location.href=dojox.flash.Embed.protocol()+"://www.macromedia.com/go/getflashplayer";}else{if(msg=="Download.Failed"){alert("There was an error downloading the Flash Player update. "+"Please try again later, or visit macromedia.com to download "+"the latest version of the Flash plugin.");}}}}};dojox.flash.info=new dojox.flash.Info();}if(!dojo._hasResource["dojox.flash"]){dojo._hasResource["dojox.flash"]=true;dojo.provide("dojox.flash");}if(!dojo._hasResource["dojox.storage.FlashStorageProvider"]){dojo._hasResource["dojox.storage.FlashStorageProvider"]=true;dojo.provide("dojox.storage.FlashStorageProvider");dojo.declare("dojox.storage.FlashStorageProvider",dojox.storage.Provider,{initialized:false,_available:null,_statusHandler:null,_flashReady:false,_pageReady:false,initialize:function(){if(dojo.config["disableFlashStorage"]==true){return;}dojox.flash.addLoadedListener(dojo.hitch(this,function(){this._flashReady=true;if(this._flashReady&&this._pageReady){this._loaded();}}));var _122=dojo.moduleUrl("dojox","storage/Storage.swf").toString();dojox.flash.setSwf(_122,false);dojo.connect(dojo,"loaded",this,function(){this._pageReady=true;if(this._flashReady&&this._pageReady){this._loaded();}});},setFlushDelay:function(_123){if(_123===null||typeof _123==="undefined"||isNaN(_123)){throw new Error("Invalid argunment: "+_123);}dojox.flash.comm.setFlushDelay(String(_123));},getFlushDelay:function(){return Number(dojox.flash.comm.getFlushDelay());},flush:function(_124){if(_124==null||typeof _124=="undefined"){_124=dojox.storage.DEFAULT_NAMESPACE;}dojox.flash.comm.flush(_124);},isAvailable:function(){return (this._available=!dojo.config["disableFlashStorage"]);},put:function(key,_125,_126,_127){if(!this.isValidKey(key)){throw new Error("Invalid key given: "+key);}if(!_127){_127=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_127)){throw new Error("Invalid namespace given: "+_127);}this._statusHandler=_126;if(dojo.isString(_125)){_125="string:"+_125;}else{_125=dojo.toJson(_125);}dojox.flash.comm.put(key,_125,_127);},putMultiple:function(keys,_128,_129,_12a){if(!this.isValidKeyArray(keys)||!_128 instanceof Array||keys.length!=_128.length){throw new Error("Invalid arguments: keys = ["+keys+"], values = ["+_128+"]");}if(!_12a){_12a=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_12a)){throw new Error("Invalid namespace given: "+_12a);}this._statusHandler=_129;var _12b=keys.join(",");var _12c=[];for(var i=0;i<_128.length;i++){if(dojo.isString(_128[i])){_128[i]="string:"+_128[i];}else{_128[i]=dojo.toJson(_128[i]);}_12c[i]=_128[i].length;}var _12d=_128.join("");var _12e=_12c.join(",");dojox.flash.comm.putMultiple(_12b,_12d,_12e,_12a);},get:function(key,_12f){if(!this.isValidKey(key)){throw new Error("Invalid key given: "+key);}if(!_12f){_12f=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_12f)){throw new Error("Invalid namespace given: "+_12f);}var _130=dojox.flash.comm.get(key,_12f);if(_130==""){return null;}return this._destringify(_130);},getMultiple:function(keys,_131){if(!this.isValidKeyArray(keys)){throw new ("Invalid key array given: "+keys);}if(!_131){_131=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_131)){throw new Error("Invalid namespace given: "+_131);}var _132=keys.join(",");var _133=dojox.flash.comm.getMultiple(_132,_131);var _134=eval("("+_133+")");for(var i=0;i<_134.length;i++){_134[i]=(_134[i]=="")?null:this._destringify(_134[i]);}return _134;},_destringify:function(_135){if(dojo.isString(_135)&&(/^string:/.test(_135))){_135=_135.substring("string:".length);}else{_135=dojo.fromJson(_135);}return _135;},getKeys:function(_136){if(!_136){_136=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_136)){throw new Error("Invalid namespace given: "+_136);}var _137=dojox.flash.comm.getKeys(_136);if(_137==null||_137=="null"){_137="";}_137=_137.split(",");_137.sort();return _137;},getNamespaces:function(){var _138=dojox.flash.comm.getNamespaces();if(_138==null||_138=="null"){_138=dojox.storage.DEFAULT_NAMESPACE;}_138=_138.split(",");_138.sort();return _138;},clear:function(_139){if(!_139){_139=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_139)){throw new Error("Invalid namespace given: "+_139);}dojox.flash.comm.clear(_139);},remove:function(key,_13a){if(!_13a){_13a=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_13a)){throw new Error("Invalid namespace given: "+_13a);}dojox.flash.comm.remove(key,_13a);},removeMultiple:function(keys,_13b){if(!this.isValidKeyArray(keys)){dojo.raise("Invalid key array given: "+keys);}if(!_13b){_13b=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_13b)){throw new Error("Invalid namespace given: "+_13b);}var _13c=keys.join(",");dojox.flash.comm.removeMultiple(_13c,_13b);},isPermanent:function(){return true;},getMaximumSize:function(){return dojox.storage.SIZE_NO_LIMIT;},hasSettingsUI:function(){return true;},showSettingsUI:function(){dojox.flash.comm.showSettings();dojox.flash.obj.setVisible(true);dojox.flash.obj.center();},hideSettingsUI:function(){dojox.flash.obj.setVisible(false);if(dojo.isFunction(dojox.storage.onHideSettingsUI)){dojox.storage.onHideSettingsUI.call(null);}},getResourceList:function(){return [];},_loaded:function(){this._allNamespaces=this.getNamespaces();this.initialized=true;dojox.storage.manager.loaded();},_onStatus:function(_13d,key,_13e){var ds=dojox.storage;var dfo=dojox.flash.obj;if(_13d==ds.PENDING){dfo.center();dfo.setVisible(true);}else{dfo.setVisible(false);}if(ds._statusHandler){ds._statusHandler.call(null,_13d,key,null,_13e);}}});dojox.storage.manager.register("dojox.storage.FlashStorageProvider",new dojox.storage.FlashStorageProvider());}if(!dojo._hasResource["dojox.storage._common"]){dojo._hasResource["dojox.storage._common"]=true;dojo.provide("dojox.storage._common");dojox.storage.manager.initialize();}if(!dojo._hasResource["dojox.storage"]){dojo._hasResource["dojox.storage"]=true;dojo.provide("dojox.storage");}if(!dojo._hasResource["agi.storage._base"]){dojo._hasResource["agi.storage._base"]=true;dojo.provide("agi.storage._base");dojo.provide("agi.storage.Storage");agi.storage._getCurrentTimeStamp=function(){return new Date().getTime();};dojo.declare("agi.storage.Storage",[agi.classes.Identified],{force_reload:false,initialized:false,data:null,sid:null,constructor:function(_13f){this.data={};this.force_reload=_13f;this.sid=this._getSid();if(!dojox.storage.manager.isInitialized()){dojo.connect(dojox.storage.manager,"loaded",this,this.initialize);}else{this.initialize();}},_getSid:function(){return agi.cookie.MagicCookie.getCookieValue("psid");},initialize:function(){this.data=dojox.storage.get(this.sid);if(!this.data||this.force_reload){var _140="";for(var i=0;i<2048;i++){_140+="0123456789";}this.data={"filler":_140};this.save();}this.initialized=true;dojo.publish("agi/storage/initialized");},get:function(key){return this.data[key]||null;},set:function(key,_141){this.data["filler"]=null;this.data[key]=_141;this.save();},remove:function(key){delete this.data[key];this.save();},save:function(){dojox.storage.put(this.sid,this.data,this.onsuccess);},clear:function(){this.data={};this.save();},onsuccess:function(_142,key,_143){}});}if(!dojo._hasResource["agi.storage"]){dojo._hasResource["agi.storage"]=true;dojo.provide("agi.storage");}if(!dojo._hasResource["pw.controllers.StoragePage"]){dojo._hasResource["pw.controllers.StoragePage"]=true;dojo.provide("pw.controllers.StoragePage");dojo.declare("pw.controllers.StoragePage",[agi.classes.Identified],{storage:null,constructor:function(){this.storage=new agi.storage.Storage();}});}if(!dojo._hasResource["agi.storage.Wombat"]){dojo._hasResource["agi.storage.Wombat"]=true;dojo.provide("agi.storage.Wombat");dojo.provide("agi.storage.WombatData");agi.storage.CONTACTS="contacts_";agi.storage.GROUPS="groups_";dojo.declare("agi.storage.WombatData",[agi.classes.Identified],{items:null,last_updated:null,constructor:function(_144){if(typeof _144!="object"){this.items={};}else{this.items=_144;}this.last_updated=agi.storage._getCurrentTimeStamp();},insert:function(item){this.items[item.id]=item;},remove:function(item){delete this.items[item.id];}});dojo.declare("agi.storage.Wombat",[agi.classes.Identified],{storage:null,data:null,key:null,url:null,window:200,offset:0,loaded:false,type:agi.storage.CONTACTS,constructor:function(type,url,_145,_146){this.storage=_145;this.url=url;this.type=type;var wid=agi.cookie.AGICookie.getCookieValue("customer","wid");if(wid!=null){this.key=type+wid;this.data=this.storage.get(this.key);if(this.data==null||this.is_expired()||_146||this.check_cookie()){this.data=new agi.storage.WombatData();this.load();}else{this.data=new agi.storage.WombatData(this.data.items);this.loaded=true;}}else{this.data=new agi.storage.WombatData();this.loaded=true;}},load:function(){if(!this.loaded){var _147=this.window+1;var _148={q:"",o:this.offset,w:_147};var _149={url:this.url,handleAs:"json",load:dojo.hitch(this,this.process),content:_148,preventCache:true};var _14a=dojo.xhrGet(_149);}this.offset=this.offset+this.window;},process:function(data,_14b){dojo.forEach(data,dojo.hitch(this.data,this.data.insert));if(data.length>this.window){this.load();}else{this.loaded=true;this.save();}},insert:function(item){this.data.insert(item);this.save();},remove:function(item){this.data.remove(item);this.save();},save:function(){this.storage.set(this.key,this.data);dojo.publish("agi/storage/wombat/"+this.type+"/saved");},is_expired:function(){return agi.storage._getCurrentTimeStamp()>this.data.last_updated+86400000;},check_cookie:function(){var _14c=agi.cookie.MagicCookie.getCookieValue("reload_storage");agi.cookie.MagicCookie.delCookieValue("reload_storage");return (_14c=="1");}});}if(!dojo._hasResource["pw.controllers.AutoCompletePage"]){dojo._hasResource["pw.controllers.AutoCompletePage"]=true;dojo.provide("pw.controllers.AutoCompletePage");dojo.declare("pw.controllers.AutoCompletePage",[pw.controllers.StandardPage,pw.controllers.StoragePage],{contacts:null,groups:null,constructor:function(){if(!this.storage.initialized){dojo.subscribe("agi/storage/initialized",this,this.load_storage_data);}else{this.load_storage_data();}},load_storage_data:function(){this.contacts=new agi.storage.Wombat(agi.storage.CONTACTS,"/contacts/search-contacts/",this.storage,false);agx.currentPage.contacts=this.contacts.data.items;this.groups=new agi.storage.Wombat(agi.storage.GROUPS,"/contacts/search-groups/",this.storage,false);agx.currentPage.groups=this.groups.data.items;},reload_storage_data:function(){this.contacts=new agi.storage.Wombat(agi.storage.CONTACTS,"/contacts/search-contacts/",this.storage,true);agx.currentPage.contacts=this.contacts.data.items;}});}dojo.publish("/pw.layers.autocomplete/loaded/");

