function JSTONE(JSON,free,clear){this.clear=function(){for(var key=k.split("."),i=0,l=key.length-1,t=get();i<l;i++){if(!t[key[i]]){t[key[i]]={}}t=t[key[i]]}t[key[i]]={};sync()};this.read=function(key){var o=find(key);return o.o[o.key]};this.write=function(key,value){var o=find(key);o.o[o.key]=value;sync()};var find=function(key){for(var i=0,l=(key=k.concat(".",key).split(".")).length-1,t=get();i<l;i++){if(!t[key[i]]){t[key[i]]={}}t=t[key[i]]}return{o:t,key:key.pop()}},get=function(){return o=window.name?JSON.parse(window.name):o},sync=function(){window.name=JSON.stringify(o)},unload=clear?function(){window.name=""}:null,k=!free?location.href.split("/").slice(2,3)[0].replace(/:[0-9]+/,""):"o.o",o={};get();if(unload){window.addEventListener?window.addEventListener("unload",unload,false):window.attachEvent("on".concat("unload"),unload)}};
