/*Copyright(c)2008 AG Interactive,All Rights Reserved;Copyright(c)2004-2008 The Dojo Foundation,All Rights Reserved*/
/*This is a compiled version of Dojo built for AG Interactive.*/
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(_12,_13){var _14=[];for(var i=0;i<_12.length;i++){_14.push(dojox.storage.get(_12[i],_13));}return _14;},removeMultiple:function(_16,_17){for(var i=0;i<_16.length;i++){dojox.storage.remove(_16[i],_17);}},isValidKeyArray:function(_19){if(_19===null||_19===undefined||!dojo.isArray(_19)){return false;}return !dojo.some(_19,function(key){return !this.isValidKey(key);},this);},hasSettingsUI:function(){return false;},showSettingsUI:function(){},hideSettingsUI:function(){},isValidKey:function(_1b){if(_1b===null||_1b===undefined){return false;}return /^[0-9A-Za-z_]*$/.test(_1b);},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(_1c,_1d){this.providers.push(_1d);this.providers[_1c]=_1d;};this.setProvider=function(_1e){};this.autodetect=function(){if(this._initialized){return;}var _1f=dojo.config["forceStorageProvider"]||false;var _20;for(var i=0;i<this.providers.length;i++){_20=this.providers[i];if(_1f&&_1f==_20.declaredClass){_20.isAvailable();break;}else{if(!_1f&&_20.isAvailable()){break;}}}if(!_20){this._initialized=true;this.available=false;this.currentProvider=null;this.loaded();return;}this.currentProvider=_20;dojo.mixin(dojox.storage,this.currentProvider);dojox.storage.initialize();this._initialized=true;this.available=true;};this.isAvailable=function(){return this.available;};this.addOnLoad=function(_22){this._onLoadListeners.push(_22);if(this.isInitialized()){this._fireLoaded();}};this.removeOnLoad=function(_23){for(var i=0;i<this._onLoadListeners.length;i++){if(_23==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(_25){try{var _26=eval("new "+_25+"()");var _27=_26.isAvailable();if(!_27){return false;}return _27;}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 _29=[];dojo.forEach(dojox.storage.manager.providers,function(_2a){_29=_29.concat(_2a.getResourceList());});return _29;};};}if(!dojo._hasResource["dojo.gears"]){dojo._hasResource["dojo.gears"]=true;dojo.provide("dojo.gears");dojo.gears._gearsObject=function(){var _2b;var _2c;var _2d=dojo.getObject("google.gears");if(_2d){return _2d;}if(typeof GearsFactory!="undefined"){_2b=new GearsFactory();}else{if(dojo.isIE){try{_2b=new ActiveXObject("Gears.Factory");}catch(e){}}else{if(navigator.mimeTypes["application/x-googlegears"]){_2b=document.createElement("object");_2b.setAttribute("type","application/x-googlegears");_2b.setAttribute("width",0);_2b.setAttribute("height",0);_2b.style.display="none";document.documentElement.appendChild(_2b);}}}if(!_2b){return null;}dojo.setObject("google.gears.factory",_2b);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(_2e,_2f,_30){this._initWorkerPool();var msg={plaintext:_2e,password:_2f};msg=dojo.toJson(msg);msg="encr:"+String(msg);this._assignWork(msg,_30);},decrypt:function(_32,_33,_34){this._initWorkerPool();var msg={ciphertext:_32,password:_33};msg=dojo.toJson(msg);msg="decr:"+String(msg);this._assignWork(msg,_34);},_initWorkerPool:function(){if(!this._manager){try{this._manager=google.gears.factory.create("beta.workerpool","1.0");this._unemployed=[];this._employed={};this._handleMessage=[];var _36=this;this._manager.onmessage=function(msg,_38){var _39=_36._employed["_"+_38];_36._employed["_"+_38]=undefined;_36._unemployed.push("_"+_38);if(_36._handleMessage.length){var _3a=_36._handleMessage.shift();_36._assignWork(_3a.msg,_3a.callback);}_39(msg);};var _3b="function _workerInit(){"+"gearsWorkerPool.onmessage = "+String(this._workerHandler)+";"+"}";var _3c=_3b+" _workerInit();";for(var i=0;i<this._POOL_SIZE;i++){this._unemployed.push("_"+this._manager.createWorker(_3c));}}catch(exp){throw exp.message||exp;}}},_assignWork:function(msg,_3f){if(!this._handleMessage.length&&this._unemployed.length){var _40=this._unemployed.shift().substring(1);this._employed["_"+_40]=_3f;this._manager.sendMessage(msg,parseInt(_40,10));}else{this._handleMessage={msg:msg,callback:_3f};}},_workerHandler:function(msg,_42){var _43=[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 _44=[[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 Cipher(_45,w){var Nb=4;var Nr=w.length/Nb-1;var _49=[[],[],[],[]];for(var i=0;i<4*Nb;i++){_49[i%4][Math.floor(i/4)]=_45[i];}_49=AddRoundKey(_49,w,0,Nb);for(var _4b=1;_4b<Nr;_4b++){_49=SubBytes(_49,Nb);_49=ShiftRows(_49,Nb);_49=MixColumns(_49,Nb);_49=AddRoundKey(_49,w,_4b,Nb);}_49=SubBytes(_49,Nb);_49=ShiftRows(_49,Nb);_49=AddRoundKey(_49,w,Nr,Nb);var _4c=new Array(4*Nb);for(var i=0;i<4*Nb;i++){_4c[i]=_49[i%4][Math.floor(i/4)];}return _4c;};function SubBytes(s,Nb){for(var r=0;r<4;r++){for(var c=0;c<Nb;c++){s[r][c]=_43[s[r][c]];}}return s;};function ShiftRows(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 MixColumns(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 AddRoundKey(_5c,w,rnd,Nb){for(var r=0;r<4;r++){for(var c=0;c<Nb;c++){_5c[r][c]^=w[rnd*4+c][r];}}return _5c;};function KeyExpansion(key){var Nb=4;var Nk=key.length/4;var Nr=Nk+6;var w=new Array(Nb*(Nr+1));var _67=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++){_67[t]=w[i-1][t];}if(i%Nk==0){_67=SubWord(RotWord(_67));for(var t=0;t<4;t++){_67[t]^=_44[i/Nk][t];}}else{if(Nk>6&&i%Nk==4){_67=SubWord(_67);}}for(var t=0;t<4;t++){w[i][t]=w[i-Nk][t]^_67[t];}}return w;};function SubWord(w){for(var i=0;i<4;i++){w[i]=_43[w[i]];}return w;};function RotWord(w){w[4]=w[0];for(var i=0;i<4;i++){w[i]=w[i+1];}return w;};function AESEncryptCtr(_6f,_70,_71){if(!(_71==128||_71==192||_71==256)){return "";}var _72=_71/8;var _73=new Array(_72);for(var i=0;i<_72;i++){_73[i]=_70.charCodeAt(i)&255;}var key=Cipher(_73,KeyExpansion(_73));key=key.concat(key.slice(0,_72-16));var _76=16;var _77=new Array(_76);var _78=(new Date()).getTime();for(var i=0;i<4;i++){_77[i]=(_78>>>i*8)&255;}for(var i=0;i<4;i++){_77[i+4]=(_78/4294967296>>>i*8)&255;}var _79=KeyExpansion(key);var _7a=Math.ceil(_6f.length/_76);var _7b=new Array(_7a);for(var b=0;b<_7a;b++){for(var c=0;c<4;c++){_77[15-c]=(b>>>c*8)&255;}for(var c=0;c<4;c++){_77[15-c-4]=(b/4294967296>>>c*8);}var _7e=Cipher(_77,_79);var _7f=b<_7a-1?_76:(_6f.length-1)%_76+1;var ct="";for(var i=0;i<_7f;i++){var _81=_6f.charCodeAt(b*_76+i);var _82=_81^_7e[i];ct+=String.fromCharCode(_82);}_7b[b]=escCtrlChars(ct);}var _83="";for(var i=0;i<8;i++){_83+=String.fromCharCode(_77[i]);}_83=escCtrlChars(_83);return _83+"-"+_7b.join("-");};function AESDecryptCtr(_84,_85,_86){if(!(_86==128||_86==192||_86==256)){return "";}var _87=_86/8;var _88=new Array(_87);for(var i=0;i<_87;i++){_88[i]=_85.charCodeAt(i)&255;}var _8a=KeyExpansion(_88);var key=Cipher(_88,_8a);key=key.concat(key.slice(0,_87-16));var _8c=KeyExpansion(key);_84=_84.split("-");var _8d=16;var _8e=new Array(_8d);var _8f=unescCtrlChars(_84[0]);for(var i=0;i<8;i++){_8e[i]=_8f.charCodeAt(i);}var _90=new Array(_84.length-1);for(var b=1;b<_84.length;b++){for(var c=0;c<4;c++){_8e[15-c]=((b-1)>>>c*8)&255;}for(var c=0;c<4;c++){_8e[15-c-4]=((b/4294967296-1)>>>c*8)&255;}var _93=Cipher(_8e,_8c);_84[b]=unescCtrlChars(_84[b]);var pt="";for(var i=0;i<_84[b].length;i++){var _95=_84[b].charCodeAt(i);var _96=_95^_93[i];pt+=String.fromCharCode(_96);}_90[b-1]=pt;}return _90.join("");};function escCtrlChars(str){return str.replace(/[\0\t\n\v\f\r\xa0!-]/g,function(c){return "!"+c.charCodeAt(0)+"!";});};function unescCtrlChars(str){return str.replace(/!\d\d?\d?!/g,function(c){return String.fromCharCode(c.slice(1,-1));});};function encrypt(_9b,_9c){return AESEncryptCtr(_9b,_9c,256);};function decrypt(_9d,_9e){return AESDecryptCtr(_9d,_9e,256);};var cmd=msg.substr(0,4);var arg=msg.substr(5);if(cmd=="encr"){arg=eval("("+arg+")");var _a1=arg.plaintext;var _a2=arg.password;var _a3=encrypt(_a1,_a2);gearsWorkerPool.sendMessage(String(_a3),_42);}else{if(cmd=="decr"){arg=eval("("+arg+")");var _a4=arg.ciphertext;var _a2=arg.password;var _a3=decrypt(_a4,_a2);gearsWorkerPool.sendMessage(String(_a3),_42);}}}});}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(_a5){if(this._dbOpen&&(!_a5||_a5==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(!_a5){_a5=this.dbName;}try{this._initDb();this.db.open(_a5);this._dbOpen=true;}catch(exp){throw exp.message||exp;}},close:function(_a6){if(dojo.isIE){return;}if(!this._dbOpen&&(!_a6||_a6==this.dbName)){return;}if(!_a6){_a6=this.dbName;}try{this.db.close(_a6);this._dbOpen=false;}catch(exp){throw exp.message||exp;}},_exec:function(_a7){try{this._initDb();if(!this._dbOpen){this.open();this._autoClose=true;}var sql=null;var _a9=null;var _aa=null;var _ab=dojo._toArray(_a7);sql=_ab.splice(0,1)[0];if(this._needsEncrypt(sql)||this._needsDecrypt(sql)){_a9=_ab.splice(_ab.length-1,1)[0];_aa=_ab.splice(_ab.length-1,1)[0];}if(this.debug){this._printDebugSQL(sql,_ab);}var _ac;if(this._needsEncrypt(sql)){_ac=new dojox.sql._SQLCrypto("encrypt",sql,_aa,_ab,_a9);return null;}else{if(this._needsDecrypt(sql)){_ac=new dojox.sql._SQLCrypto("decrypt",sql,_aa,_ab,_a9);return null;}}var rs=this.db.execute(sql,_ab);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,_af){var msg="dojox.sql(\""+sql+"\"";for(var i=0;i<_af.length;i++){if(typeof _af[i]=="string"){msg+=", \""+_af[i]+"\"";}else{msg+=", "+_af[i];}}msg+=")";},_normalizeResults:function(rs){var _b3=[];if(!rs){return [];}while(rs.isValidRow()){var row={};for(var i=0;i<rs.fieldCount();i++){var _b6=rs.fieldName(i);var _b7=rs.field(i);row[_b6]=_b7;}_b3.push(row);rs.next();}rs.close();return _b3;},_needsEncrypt:function(sql){return /encrypt\([^\)]*\)/i.test(sql);},_needsDecrypt:function(sql){return /decrypt\([^\)]*\)/i.test(sql);}});dojo.declare("dojox.sql._SQLCrypto",null,{constructor:function(_ba,sql,_bc,_bd,_be){if(_ba=="encrypt"){this._execEncryptSQL(sql,_bc,_bd,_be);}else{this._execDecryptSQL(sql,_bc,_bd,_be);}},_execEncryptSQL:function(sql,_c0,_c1,_c2){var _c3=this._stripCryptoSQL(sql);var _c4=this._flagEncryptedArgs(sql,_c1);var _c5=this;this._encrypt(_c3,_c0,_c1,_c4,function(_c6){var _c7=false;var _c8=[];var exp=null;try{_c8=dojox.sql.db.execute(_c3,_c6);}catch(execError){_c7=true;exp=execError.message||execError;}if(exp!=null){if(dojox.sql._autoClose){try{dojox.sql.close();}catch(e){}}_c2(null,true,exp.toString());return;}_c8=dojox.sql._normalizeResults(_c8);if(dojox.sql._autoClose){dojox.sql.close();}if(dojox.sql._needsDecrypt(sql)){var _ca=_c5._determineDecryptedColumns(sql);_c5._decrypt(_c8,_ca,_c0,function(_cb){_c2(_cb,false,null);});}else{_c2(_c8,false,null);}});},_execDecryptSQL:function(sql,_cd,_ce,_cf){var _d0=this._stripCryptoSQL(sql);var _d1=this._determineDecryptedColumns(sql);var _d2=false;var _d3=[];var exp=null;try{_d3=dojox.sql.db.execute(_d0,_ce);}catch(execError){_d2=true;exp=execError.message||execError;}if(exp!=null){if(dojox.sql._autoClose){try{dojox.sql.close();}catch(e){}}_cf(_d3,true,exp.toString());return;}_d3=dojox.sql._normalizeResults(_d3);if(dojox.sql._autoClose){dojox.sql.close();}this._decrypt(_d3,_d1,_cd,function(_d5){_cf(_d5,false,null);});},_encrypt:function(sql,_d7,_d8,_d9,_da){this._totalCrypto=0;this._finishedCrypto=0;this._finishedSpawningCrypto=false;this._finalArgs=_d8;for(var i=0;i<_d8.length;i++){if(_d9[i]){var _dc=_d8[i];var _dd=i;this._totalCrypto++;dojox.sql._crypto.encrypt(_dc,_d7,dojo.hitch(this,function(_de){this._finalArgs[_dd]=_de;this._finishedCrypto++;if(this._finishedCrypto>=this._totalCrypto&&this._finishedSpawningCrypto){_da(this._finalArgs);}}));}}this._finishedSpawningCrypto=true;},_decrypt:function(_df,_e0,_e1,_e2){this._totalCrypto=0;this._finishedCrypto=0;this._finishedSpawningCrypto=false;this._finalResultSet=_df;for(var i=0;i<_df.length;i++){var row=_df[i];for(var _e5 in row){if(_e0=="*"||_e0[_e5]){this._totalCrypto++;var _e6=row[_e5];this._decryptSingleColumn(_e5,_e6,_e1,i,function(_e7){_e2(_e7);});}}}this._finishedSpawningCrypto=true;},_stripCryptoSQL:function(sql){sql=sql.replace(/DECRYPT\(\*\)/ig,"*");var _e9=sql.match(/ENCRYPT\([^\)]*\)/ig);if(_e9!=null){for(var i=0;i<_e9.length;i++){var _eb=_e9[i];var _ec=_eb.match(/ENCRYPT\(([^\)]*)\)/i)[1];sql=sql.replace(_eb,_ec);}}_e9=sql.match(/DECRYPT\([^\)]*\)/ig);if(_e9!=null){for(i=0;i<_e9.length;i++){var _ed=_e9[i];var _ee=_ed.match(/DECRYPT\(([^\)]*)\)/i)[1];sql=sql.replace(_ed,_ee);}}return sql;},_flagEncryptedArgs:function(sql,_f0){var _f1=new RegExp(/([\"][^\"]*\?[^\"]*[\"])|([\'][^\']*\?[^\']*[\'])|(\?)/ig);var _f2;var _f3=0;var _f4=[];while((_f2=_f1.exec(sql))!=null){var _f5=RegExp.lastMatch+"";if(/^[\"\']/.test(_f5)){continue;}var _f6=false;if(/ENCRYPT\([^\)]*$/i.test(RegExp.leftContext)){_f6=true;}_f4[_f3]=_f6;_f3++;}return _f4;},_determineDecryptedColumns:function(sql){var _f8={};if(/DECRYPT\(\*\)/i.test(sql)){_f8="*";}else{var _f9=/DECRYPT\((?:\s*\w*\s*\,?)*\)/ig;var _fa=_f9.exec(sql);while(_fa){var _fb=new String(RegExp.lastMatch);var _fc=_fb.replace(/DECRYPT\(/i,"");_fc=_fc.replace(/\)/,"");_fc=_fc.split(/\s*,\s*/);dojo.forEach(_fc,function(_fd){if(/\s*\w* AS (\w*)/i.test(_fd)){_fd=_fd.match(/\s*\w* AS (\w*)/i)[1];}_f8[_fd]=true;});_fa=_f9.exec(sql);}}return _f8;},_decryptSingleColumn:function(_fe,_ff,_100,_101,_102){dojox.sql._crypto.decrypt(_ff,_100,dojo.hitch(this,function(_103){this._finalResultSet[_101][_fe]=_103;this._finishedCrypto++;if(this._finishedCrypto>=this._totalCrypto&&this._finishedSpawningCrypto){_102(this._finalResultSet);}}));}});(function(){var _104=dojox.sql;dojox.sql=new Function("return dojox.sql._exec(arguments);");dojo.mixin(dojox.sql,_104);})();}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,_106,_107,_108){this._initStorage();if(!this.isValidKey(key)){throw new Error("Invalid key given: "+key);}_108=_108||this.DEFAULT_NAMESPACE;if(!this.isValidKey(_108)){throw new Error("Invalid namespace given: "+key);}if(dojo.isString(_106)){_106="string:"+_106;}else{_106=dojo.toJson(_106);}try{dojox.sql("DELETE FROM "+this.TABLE_NAME+" WHERE namespace = ? AND key = ?",_108,key);dojox.sql("INSERT INTO "+this.TABLE_NAME+" VALUES (?, ?, ?)",_108,key,_106);}catch(e){_107(this.FAILED,key,e.toString(),_108);return;}if(_107){_107(dojox.storage.SUCCESS,key,null,_108);}},get:function(key,_10a){this._initStorage();if(!this.isValidKey(key)){throw new Error("Invalid key given: "+key);}_10a=_10a||this.DEFAULT_NAMESPACE;if(!this.isValidKey(_10a)){throw new Error("Invalid namespace given: "+key);}var _10b=dojox.sql("SELECT * FROM "+this.TABLE_NAME+" WHERE namespace = ? AND "+" key = ?",_10a,key);if(!_10b.length){return null;}else{_10b=_10b[0].value;}if(dojo.isString(_10b)&&(/^string:/.test(_10b))){_10b=_10b.substring("string:".length);}else{_10b=dojo.fromJson(_10b);}return _10b;},getNamespaces:function(){this._initStorage();var _10c=[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){_10c.push(rs[i].namespace);}}return _10c;},getKeys:function(_10f){this._initStorage();_10f=_10f||this.DEFAULT_NAMESPACE;if(!this.isValidKey(_10f)){throw new Error("Invalid namespace given: "+_10f);}var rs=dojox.sql("SELECT key FROM "+this.TABLE_NAME+" WHERE namespace = ?",_10f);var _111=[];for(var i=0;i<rs.length;i++){_111.push(rs[i].key);}return _111;},clear:function(_113){this._initStorage();_113=_113||this.DEFAULT_NAMESPACE;if(!this.isValidKey(_113)){throw new Error("Invalid namespace given: "+_113);}dojox.sql("DELETE FROM "+this.TABLE_NAME+" WHERE namespace = ?",_113);},remove:function(key,_115){this._initStorage();if(!this.isValidKey(key)){throw new Error("Invalid key given: "+key);}_115=_115||this.DEFAULT_NAMESPACE;if(!this.isValidKey(_115)){throw new Error("Invalid namespace given: "+key);}dojox.sql("DELETE FROM "+this.TABLE_NAME+" WHERE namespace = ? AND"+" key = ?",_115,key);},putMultiple:function(keys,_117,_118,_119){this._initStorage();if(!this.isValidKeyArray(keys)||!_117 instanceof Array||keys.length!=_117.length){throw new Error("Invalid arguments: keys = ["+keys+"], values = ["+_117+"]");}if(_119==null||typeof _119=="undefined"){_119=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_119)){throw new Error("Invalid namespace given: "+_119);}this._statusHandler=_118;try{dojox.sql.open();dojox.sql.db.execute("BEGIN TRANSACTION");var _11a="REPLACE INTO "+this.TABLE_NAME+" VALUES (?, ?, ?)";for(var i=0;i<keys.length;i++){var _11c=_117[i];if(dojo.isString(_11c)){_11c="string:"+_11c;}else{_11c=dojo.toJson(_11c);}dojox.sql.db.execute(_11a,[_119,keys[i],_11c]);}dojox.sql.db.execute("COMMIT TRANSACTION");dojox.sql.close();}catch(e){if(_118){_118(this.FAILED,keys,e.toString(),_119);}return;}if(_118){_118(dojox.storage.SUCCESS,keys,null,_119);}},getMultiple:function(keys,_11e){this._initStorage();if(!this.isValidKeyArray(keys)){throw new ("Invalid key array given: "+keys);}if(_11e==null||typeof _11e=="undefined"){_11e=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_11e)){throw new Error("Invalid namespace given: "+_11e);}var _11f="SELECT * FROM "+this.TABLE_NAME+" WHERE namespace = ? AND "+" key = ?";var _120=[];for(var i=0;i<keys.length;i++){var _122=dojox.sql(_11f,_11e,keys[i]);if(!_122.length){_120[i]=null;}else{_122=_122[0].value;if(dojo.isString(_122)&&(/^string:/.test(_122))){_120[i]=_122.substring("string:".length);}else{_120[i]=dojo.fromJson(_122);}}}return _120;},removeMultiple:function(keys,_124){this._initStorage();if(!this.isValidKeyArray(keys)){throw new Error("Invalid arguments: keys = ["+keys+"]");}if(_124==null||typeof _124=="undefined"){_124=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_124)){throw new Error("Invalid namespace given: "+_124);}dojox.sql.open();dojox.sql.db.execute("BEGIN TRANSACTION");var _125="DELETE FROM "+this.TABLE_NAME+" WHERE namespace = ? AND key = ?";for(var i=0;i<keys.length;i++){dojox.sql.db.execute(_125,[_124,keys[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 _127=null;var icon=null;var msg="This site would like to use Google Gears to enable "+"enhanced functionality.";var _12a=google.gears.factory.getPermission(_127,icon,msg);if(!_12a){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=this._getDomain();this.initialized=true;dojox.storage.manager.loaded();},isAvailable:function(){try{var _12b=globalStorage[this._getDomain()];}catch(e){this._available=false;return this._available;}this._available=true;return this._available;},put:function(key,_12d,_12e,_12f){if(this.isValidKey(key)==false){throw new Error("Invalid key given: "+key);}_12f=_12f||this.DEFAULT_NAMESPACE;key=this.getFullKey(key,_12f);this._statusHandler=_12e;if(dojo.isString(_12d)){_12d="string:"+_12d;}else{_12d=dojo.toJson(_12d);}var _130=dojo.hitch(this,function(evt){window.removeEventListener("storage",_130,false);if(_12e){_12e.call(null,this.SUCCESS,key,null,_12f);}});window.addEventListener("storage",_130,false);try{var _132=globalStorage[this._domain];_132.setItem(key,_12d);}catch(e){this._statusHandler.call(null,this.FAILED,key,e.toString(),_12f);}},get:function(key,_134){if(this.isValidKey(key)==false){throw new Error("Invalid key given: "+key);}_134=_134||this.DEFAULT_NAMESPACE;key=this.getFullKey(key,_134);var _135=globalStorage[this._domain];var _136=_135.getItem(key);if(_136==null||_136==""){return null;}_136=_136.value;if(dojo.isString(_136)&&(/^string:/.test(_136))){_136=_136.substring("string:".length);}else{_136=dojo.fromJson(_136);}return _136;},getNamespaces:function(){var _137=[this.DEFAULT_NAMESPACE];var _138={};var _139=globalStorage[this._domain];var _13a=/^__([^_]*)_/;for(var i=0;i<_139.length;i++){var _13c=_139.key(i);if(_13a.test(_13c)==true){var _13d=_13c.match(_13a)[1];if(typeof _138[_13d]=="undefined"){_138[_13d]=true;_137.push(_13d);}}}return _137;},getKeys:function(_13e){_13e=_13e||this.DEFAULT_NAMESPACE;if(this.isValidKey(_13e)==false){throw new Error("Invalid namespace given: "+_13e);}var _13f;if(_13e==this.DEFAULT_NAMESPACE){_13f=new RegExp("^([^_]{2}.*)$");}else{_13f=new RegExp("^__"+_13e+"_(.*)$");}var _140=globalStorage[this._domain];var _141=[];for(var i=0;i<_140.length;i++){var _143=_140.key(i);if(_13f.test(_143)==true){_143=_143.match(_13f)[1];_141.push(_143);}}return _141;},clear:function(_144){_144=_144||this.DEFAULT_NAMESPACE;if(this.isValidKey(_144)==false){throw new Error("Invalid namespace given: "+_144);}var _145;if(_144==this.DEFAULT_NAMESPACE){_145=new RegExp("^[^_]{2}");}else{_145=new RegExp("^__"+_144+"_");}var _146=globalStorage[this._domain];var keys=[];for(var i=0;i<_146.length;i++){if(_145.test(_146.key(i))==true){keys[keys.length]=_146.key(i);}}dojo.forEach(keys,dojo.hitch(_146,"removeItem"));},remove:function(key,_14a){key=this.getFullKey(key,_14a);var _14b=globalStorage[this._domain];_14b.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,_14d){_14d=_14d||this.DEFAULT_NAMESPACE;if(this.isValidKey(_14d)==false){throw new Error("Invalid namespace given: "+_14d);}if(_14d==this.DEFAULT_NAMESPACE){return key;}else{return "__"+_14d+"_"+key;}},_getDomain:function(){return ((location.hostname=="localhost"&&dojo.isFF&&dojo.isFF<3)?"localhost.localdomain":location.hostname);}});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,_14f){this.url=url;this._visible=true;if(_14f!==null&&_14f!==undefined){this._visible=_14f;}this._initialize();},addLoadedListener:function(_150){this._loadedListeners.push(_150);},addInstallingListener:function(_151){this._installingListeners.push(_151);},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 _154=new dojox.flash.Install();dojox.flash.installer=_154;if(_154.needed()){_154.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(_155,_156,_157){_157=parseFloat("."+_157);if(this.versionMajor>=_155&&this.versionMinor>=_156&&this.versionRevision>=_157){return true;}else{return false;}},_detectVersion:function(){var _158;for(var _159=25;_159>0;_159--){if(dojo.isIE){var axo;try{if(_159>6){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_159);}else{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}if(typeof axo=="object"){if(_159==6){axo.AllowScriptAccess="always";}_158=axo.GetVariable("$version");}}catch(e){continue;}}else{_158=this._JSFlashInfo(_159);}if(_158==-1){this.capable=false;return;}else{if(_158!=0){var _15b;if(dojo.isIE){var _15c=_158.split(" ");var _15d=_15c[1];_15b=_15d.split(",");}else{_15b=_158.split(".");}this.versionMajor=_15b[0];this.versionMinor=_15b[1];this.versionRevision=_15b[2];var _15e=this.versionMajor+"."+this.versionRevision;this.version=parseFloat(_15e);this.capable=true;break;}}}},_JSFlashInfo:function(_15f){if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var _160=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var _161=navigator.plugins["Shockwave Flash"+_160].description;var _162=_161.split(" ");var _163=_162[2].split(".");var _164=_163[0];var _165=_163[1];var _166=(_162[3]||_162[4]).split("r");var _167=_166[1]>0?_166[1]:0;var _168=_164+"."+_165+"."+_167;return _168;}}return -1;}};dojox.flash.Embed=function(_169){this._visible=_169;};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(_16a){var _16b;var _16c=dojox.flash.url;var _16d=_16c;var _16e=_16c;var _16f=dojo.baseUrl;var _170=document.location.protocol+"//"+document.location.host;if(_16a){var _171=escape(window.location);document.title=document.title.slice(0,47)+" - Flash Player Installation";var _172=escape(document.title);_16d+="?MMredirectURL="+_171+"&MMplayerType=ActiveX"+"&MMdoctitle="+_172+"&baseUrl="+escape(_16f)+"&xdomain="+escape(_170);_16e+="?MMredirectURL="+_171+"&MMplayerType=PlugIn"+"&baseUrl="+escape(_16f)+"&xdomain="+escape(_170);}else{_16d+="?cachebust="+new Date().getTime();_16d+="&baseUrl="+escape(_16f);_16d+="&xdomain="+escape(_170);}if(_16e.indexOf("?")==-1){_16e+="?baseUrl="+escape(_16f);}else{_16e+="&baseUrl="+escape(_16f);}_16e+="&xdomain="+escape(_170);_16b="<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=\""+_16d+"\"></param>\n "+"<param name=\"quality\" value=\"high\"></param>\n "+"<param name=\"bgcolor\" value=\"#ffffff\"></param>\n "+"<embed src=\""+_16e+"\" "+"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 _173=this.id+"Container";if(dojo.byId(_173)){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=_16b;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(_176){var _177=dojo.byId(this.id+"Container");if(_176){_177.style.position="absolute";_177.style.visibility="visible";}else{_177.style.position="absolute";_177.style.y="-1000px";_177.style.visibility="hidden";}},center:function(){var _178=this.width;var _179=this.height;var _17a=dijit.getViewport();var x=_17a.l+(_17a.w-_178)/2;var y=_17a.t+(_17a.h-_179)/2;var _17d=dojo.byId(this.id+"Container");_17d.style.top=y+"px";_17d.style.left=x+"px";}};dojox.flash.Communicator=function(){};dojox.flash.Communicator.prototype={_addExternalInterfaceCallback:function(_17e){var _17f=dojo.hitch(this,function(){var _180=new Array(arguments.length);for(var i=0;i<arguments.length;i++){_180[i]=this._encodeData(arguments[i]);}var _182=this._execFlash(_17e,_180);_182=this._decodeData(_182);return _182;});this[_17e]=_17f;},_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," ");data=data.replace(/\&custom_lt\;/g,"<").replace(/\&custom_gt\;/g,">").replace(/\&custom_backslash\;/g,"\\");return data;},_execFlash:function(_185,_186){var _187=dojox.flash.obj.get();_186=(_186)?_186:[];for(var i=0;i<_186;i++){if(typeof _186[i]=="string"){_186[i]=this._encodeData(_186[i]);}}var _189=function(){return eval(_187.CallFunction("<invoke name=\""+_185+"\" returntype=\"javascript\">"+__flash__argumentsToXML(_186,0)+"</invoke>"));};var _18a=_189.call(_186);if(typeof _18a=="string"){_18a=this._decodeData(_18a);}return _18a;}};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 _18b;dojox.flash.info.installing=true;dojox.flash.installing();if(dojox.flash.info.capable==false){_18b=new dojox.flash.Embed(false);_18b.write();}else{if(dojox.flash.info.isVersionOrAbove(6,0,65)){_18b=new dojox.flash.Embed(false);_18b.write(true);_18b.setVisible(true);_18b.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 _18d=dojo.moduleUrl("dojox","storage/Storage.swf").toString();dojox.flash.setSwf(_18d,false);dojo.connect(dojo,"loaded",this,function(){this._pageReady=true;if(this._flashReady&&this._pageReady){this._loaded();}});},setFlushDelay:function(_18e){if(_18e===null||typeof _18e==="undefined"||isNaN(_18e)){throw new Error("Invalid argunment: "+_18e);}dojox.flash.comm.setFlushDelay(String(_18e));},getFlushDelay:function(){return Number(dojox.flash.comm.getFlushDelay());},flush:function(_18f){if(_18f==null||typeof _18f=="undefined"){_18f=dojox.storage.DEFAULT_NAMESPACE;}dojox.flash.comm.flush(_18f);},isAvailable:function(){return (this._available=!dojo.config["disableFlashStorage"]);},put:function(key,_191,_192,_193){if(!this.isValidKey(key)){throw new Error("Invalid key given: "+key);}if(!_193){_193=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_193)){throw new Error("Invalid namespace given: "+_193);}this._statusHandler=_192;if(dojo.isString(_191)){_191="string:"+_191;}else{_191=dojo.toJson(_191);}dojox.flash.comm.put(key,_191,_193);},putMultiple:function(keys,_195,_196,_197){if(!this.isValidKeyArray(keys)||!_195 instanceof Array||keys.length!=_195.length){throw new Error("Invalid arguments: keys = ["+keys+"], values = ["+_195+"]");}if(!_197){_197=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_197)){throw new Error("Invalid namespace given: "+_197);}this._statusHandler=_196;var _198=keys.join(",");var _199=[];for(var i=0;i<_195.length;i++){if(dojo.isString(_195[i])){_195[i]="string:"+_195[i];}else{_195[i]=dojo.toJson(_195[i]);}_199[i]=_195[i].length;}var _19b=_195.join("");var _19c=_199.join(",");dojox.flash.comm.putMultiple(_198,_19b,_19c,_197);},get:function(key,_19e){if(!this.isValidKey(key)){throw new Error("Invalid key given: "+key);}if(!_19e){_19e=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_19e)){throw new Error("Invalid namespace given: "+_19e);}var _19f=dojox.flash.comm.get(key,_19e);if(_19f==""){return null;}return this._destringify(_19f);},getMultiple:function(keys,_1a1){if(!this.isValidKeyArray(keys)){throw new ("Invalid key array given: "+keys);}if(!_1a1){_1a1=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_1a1)){throw new Error("Invalid namespace given: "+_1a1);}var _1a2=keys.join(",");var _1a3=dojox.flash.comm.getMultiple(_1a2,_1a1);var _1a4=eval("("+_1a3+")");for(var i=0;i<_1a4.length;i++){_1a4[i]=(_1a4[i]=="")?null:this._destringify(_1a4[i]);}return _1a4;},_destringify:function(_1a6){if(dojo.isString(_1a6)&&(/^string:/.test(_1a6))){_1a6=_1a6.substring("string:".length);}else{_1a6=dojo.fromJson(_1a6);}return _1a6;},getKeys:function(_1a7){if(!_1a7){_1a7=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_1a7)){throw new Error("Invalid namespace given: "+_1a7);}var _1a8=dojox.flash.comm.getKeys(_1a7);if(_1a8==null||_1a8=="null"){_1a8="";}_1a8=_1a8.split(",");_1a8.sort();return _1a8;},getNamespaces:function(){var _1a9=dojox.flash.comm.getNamespaces();if(_1a9==null||_1a9=="null"){_1a9=dojox.storage.DEFAULT_NAMESPACE;}_1a9=_1a9.split(",");_1a9.sort();return _1a9;},clear:function(_1aa){if(!_1aa){_1aa=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_1aa)){throw new Error("Invalid namespace given: "+_1aa);}dojox.flash.comm.clear(_1aa);},remove:function(key,_1ac){if(!_1ac){_1ac=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_1ac)){throw new Error("Invalid namespace given: "+_1ac);}dojox.flash.comm.remove(key,_1ac);},removeMultiple:function(keys,_1ae){if(!this.isValidKeyArray(keys)){dojo.raise("Invalid key array given: "+keys);}if(!_1ae){_1ae=dojox.storage.DEFAULT_NAMESPACE;}if(!this.isValidKey(_1ae)){throw new Error("Invalid namespace given: "+_1ae);}var _1af=keys.join(",");dojox.flash.comm.removeMultiple(_1af,_1ae);},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(_1b0,key,_1b2){var ds=dojox.storage;var dfo=dojox.flash.obj;if(_1b0==ds.PENDING){dfo.center();dfo.setVisible(true);}else{dfo.setVisible(false);}if(ds._statusHandler){ds._statusHandler.call(null,_1b0,key,null,_1b2);}}});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(_1b5){this.data={};this.force_reload=_1b5;this.sid=agi.cookie.MagicCookie.getCookieValue("psid");if(!dojox.storage.manager.isInitialized()){dojo.connect(dojox.storage.manager,"loaded",this,this.initialize);}else{this.initialize();}},initialize:function(){this.data=dojox.storage.get(this.sid);if(!this.data||this.force_reload){var _1b6="";for(var i=0;i<2048;i++){_1b6+="0123456789";}this.data={"filler":_1b6};this.save();}this.initialized=true;dojo.publish("agi/storage/initialized");},get:function(key){return this.data[key]||null;},set:function(key,_1ba){this.data["filler"]=null;this.data[key]=_1ba;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(_1bc,key,_1be){}});}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(_1bf){if(typeof _1bf!="object"){this.items={};}else{this.items=_1bf;}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,_1c4,_1c5){this.storage=_1c4;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()||_1c5||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 _1c7=this.window+1;var _1c8={q:"",o:this.offset,w:_1c7};var _1c9={url:this.url,handleAs:"json",load:dojo.hitch(this,this.process),content:_1c8,preventCache:true};var _1ca=dojo.xhrGet(_1c9);}this.offset=this.offset+this.window;},process:function(data,_1cc){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 _1cf=agi.cookie.MagicCookie.getCookieValue("reload_storage");agi.cookie.MagicCookie.delCookieValue("reload_storage");return (_1cf=="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/");
