var GenericMessageOverlay = function (id) {
	this.overlay = new Overlay(id, {	width: "400px",
										draggable: true,
										visible: false,
										zindex: 500,
										fixedcenter: true,
										constraintoviewport: true
	});

	this.show = function (anchorShow, text, anchorHide, fn) {
		this.overlay.show(null, this.overlay.generateOverlay(text), null, fn);
	};
	
	this.showPlain = function (title, text, color, properties) {
		if(color) this.overlay.color = color;
		// else this.overlay.color = this.overlay.defaultColor;
		
		var html = '<h3>' + title + '</h3>' +
					'<p>' + text + '</p>';
		
		var me = this;
		this.show(null, html, null, function () {
			if(properties)
				for(var property in properties)
					me.overlay.setProperty(property, properties[property]);
		});
	};
	
	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);
	}
};

OverlayConfiguration.genericMessage = new GenericMessageOverlay('textOverlay');
OverlayManager.genericMessage = function (args) {
	OverlayConfiguration.genericMessage.show(args[0], args[1], args[2]);
};