var AbuseReportOverlay = function (id) {
	this.overlay = new Overlay(id, {	width: '420px',
										draggable: true,
										visible: false,
										zindex: 1000,
										fixedcenter: true,
										constraintoviewport: true
	});

	// Identifica un overlay a pił passi
	this.overlay.stepOverlay = true;
	
	this.overlay.color = 'rosso';
	this.overlay.defaultColor = 'rosso';
	
	this.wrapper = function (overlay, args) {
		var params = {
			overlay: overlay,
			t_nick: args[0],
			t_profile_id: args[1],
			abuse_id: args[2],
			content_id: args[3],
			abuse_type: args[4],
			text: args[5]
		};
		
		this.stepOne(params);
	};
	
	this.show = function (anchorShow, text, anchorHide) {
		this.overlay.show(null, this.overlay.generateOverlay(text), null);
	};
	
	this.stepOne = function (params) {
		this.overlay.scriptUrl = "http://" + conf.baseUrl + "/overlay_manager/segnala_" + params.abuse_type;
		this.overlay.setContentByAjax(Utilities.createActionString(params), null, null, this);
	};
	
	this.stepTwo = function (overlay, formName, contentType) {
		this.overlay.scriptUrl = "http://"+ conf.baseUrl +"/gui_manager/segnala_" + contentType;
		this.overlay.setContentByAjax('', null, null, this, formName, true);
	};
};

OverlayConfiguration.abusereport = new AbuseReportOverlay('textOverlay');
OverlayManager.abusereport = function (args) {
	OverlayConfiguration.abusereport.wrapper('abusereport', args);
};