var GenericMessageOverlay = function (id) {
	this.overlay = new Overlay(id, {	width: "400px",
										draggable: true,
										visible: false,
										zindex: 1000,
										fixedcenter: true,
										constraintoviewport: true
	});

	// Imposta la modalità debug
	this.overlay.debugMode = true;
	
	this.show = function (anchorShow, text, anchorHide) {
		this.overlay.show(null, this.overlay.generateOverlay(text), null);
	};
	
	this.showPlain = function (title, text, color) {
		if(color) this.overlay.color = color;
		
		var html = '<h3>' + title + '</h3>' +
					'<p>' + text + '</p>';
		
		this.show(null, html, null);
	};
	
	this.showFormatted = function (overlay, url, color) {
		if(color) this.overlay.color = color;
		this.overlay.scriptUrl = 'http://' + conf.baseUrl + '/' + url;
		actionString = 'overlay=' + overlay;
		this.overlay.setContentByAjax(actionString, null, null, this);
	}
};