window.LocalStorage = { storage: window.localStorage, save : function(obj) { var pos = this._unpack('pos'); pos[obj.key] = obj; this.storage.setItem('pos', JSON.stringify(pos)); }, read : function(key, cbk) { cbk(this._unpack('pos')[key]); }, _unpack : function(key) { var data = this.storage.getItem(key) return (data)?jQuery.parseJSON(data):{}; } };