var PasswordRecoveryOverlay = function (id) {
	
	this.overlay = new Overlay(id, {	width: '250px',
										draggable: true,
										visible: false,
										zindex: 1000,
										fixedcenter: true,
										constraintoviewport: true
	});
	
	this.overlay.scriptUrl = "http://" + conf.baseUrl + "/gui_manager/captcha";
	
	this.show = function (anchorShow, text, anchorHide) {
		this.overlay.show(null, this.overlay.generateOverlay(text), null);
	};
	
	
	
	this.stepOne = function () {
		this.overlay.scriptUrl = "http://" + conf.baseUrl + "/overlay_manager/password_recovery";

		// definisce cosa fare nello step 2, in realtà chiama step 2
		this.overlay.setContentByAjax(null, null, null, this);
	};
	
	this.stepTwo = function (form){
		var callback = {
			    success : function (o) {
				},
			    failure : function (o) { 
			    	alert(o);
			    },
			    upload: function (o) {
			    	
			    	OverlayConfiguration.passwordRecovery.overlay.hide();
			    	var data = YAHOO.lang.JSON.parse(o.responseText);
			    	
			    	message = data['body'];
		    		title = data['header'];
			    	if(data['result'] == 'OK'){			    		
						OverlayManager.show('genericMessage', title, message, 'blu');
			    	}
			    	else{
						OverlayManager.show('genericMessage', title, message, 'rosso');
			    	}
			    	
			    }
			};
			
			YAHOO.util.Connect.setForm(form, true);
			var conn = YAHOO.util.Connect.asyncRequest("POST", 'http://' + conf.baseUrl + '/gui_manager/password_recovery', callback);	
	}

};