function XProps (content){ // set this to false to disable caching of property values this._use_cache = true; this._content = content; this._fillers = new Object (); if (this._use_cache) this._values = new Object ();}XProps.prototype = { Add : function (atom, filler) { this._fillers[atom] = filler; this.Invalidate (atom); this.__defineGetter__ (atom+"", function () { if (this._use_cache && atom in this._values) { return this._values[atom]; } else { var prop_bag = this._content.nativeWindow.GetProperty (atom); var val = (prop_bag == null) ? null : this._fillers[atom](prop_bag); if (this._use_cache) this._values[atom] = val; return val; } }); }, Invalidate: function (atom) { if (this._use_cache) delete this._values[atom]; }}