function WidgetManager(widget) {
	this.widget = widget; 
	this.DEBUG = false;
}

WidgetManager.prototype.widget;
WidgetManager.prototype.DEBUG;

WidgetManager.prototype.getData = function(callback){
	try {
		if (Ajax == null) {
			return;
		}
		new Ajax.Request(
			this.widget.getUri(), 
			{
				method: 'get',
				onSuccess: callback,
				onException: function(transport, exception) { 
					throw new Exception("Ajax execution error: " + exception);
				}
			});
	} catch (e) {
		if (this.DEBUG) { alert('Error: ' + e); }
	}
}

WidgetManager.prototype.render = function(data) {
	try {
    	//var response =  transport.responseText.evalJSON(true)
		var response = eval('(' + data + ')');
		return response;
	} catch (e) {
		if (this.DEBUG) { alert('Error: ' + e); }
	}
}

