rendered paste bodyvar Controls = Class.create();Controls.prototype = { options : { url : 'actions/controls.php' }, _controls : { 'login' : 0, 'user' : 0, 'collections' : 0, 'marker' : 0 }, initialize : function (opts) { Object.extend(this.options, opts); }, fetch_control : function(name) { if(this._controls[name] == 0) { var params = "name=" + name; var opts = {method: 'get', parameters: params, onSuccess: this._register_control}; new Ajax.Request(this.options.url, opts); } }, release_control : function(name) { this._controls[name].unload(this); this._controls[name] = 0; }, _register_control : function(request) { var response = eval(request.responseText); if(response) { if(response.meta.html) { response.insertion(); } this._controls[response.meta.name] = new Object.extend( new Class.create(), response.control); } }, init_control_list : function(controls) { Object.extend(this._controls, controls); }};