dojo.provide("parus.userdata");dojo.require("parus.parus8");dojo.require("parus.database");dojo.require("parus.xml");if(!parus){parus={}}if(!parus.userdata){dojo.mixin(parus,{userdata:{}})}dojo.mixin(parus.userdata,{_store:null,_signature:"version 1.0.0.0",_timeoutID:null,load:function(){var b={};nodes=parus.parus8.rowNodes(parus.database.execute("GetUserData",{}))[0];if(nodes){nodes=nodes.firstChild;if(nodes){nodes=nodes.firstChild;if(nodes){nodes=nodes.childNodes;if(nodes){for(var a=0;a<nodes.length;a++){b[nodes[a].nodeName]=nodes[a].firstChild.nodeValue}}}}}this._store=(b._signature==this._signature)?b:{}},_extractIdent:function(a){return a.replace(/[^a-zA-Z0-9_\-\.]/g,"")},get:function(a){try{return this._store?dojo.fromJson(this._store[this._extractIdent(a)]||"{}"):{}}catch(b){return{}}},set:function(d,c,b){if(!this._store){return}this._store._signature=this._signature;var a=this.get(d);dojo.mixin(a,c);this._store[this._extractIdent(d)]=dojo.toJson(a);if(this._timeoutID){clearTimeout(this._timeoutID)}this._timeoutID=setTimeout(dojo.hitch(this,function(){this._timeoutID=null;parus.database.execute("SetUserData",{blobDATA:{DATA:dojo.clone(this._store)}},function(){})}),b?1:6000)},cleanUp:function(){this._store={_signature:this._signature};if(this._timeoutID){clearTimeout(this._timeoutID)}this._timeoutID=null;parus.database.execute("SetUserData",{blobDATA:{DATA:dojo.clone(this._store)}})},spread:function(a){this._store._signature=this._signature;if(this._timeoutID){clearTimeout(this._timeoutID)}if(this._timeoutID){clearTimeout(this._timeoutID)}this._timeoutID=null;parus.database.execute("SpreadUserData",{blobDATA:{DATA:dojo.clone(this._store)},RN:a.join(";")})}});