function recPass(dato,urlSendPri,urlSendSec) {
	$("#recPassLoader").removeClass("hide");
	$("#recPassButton").addClass("hide");
	$.ajax({
		type: "POST",
		dataType: 'json',
		url: urlSendPri+urlSendSec+"ajax/recPass.php",
		data: {
			email : dato
		},
		//Evento di riuscita
		success: function(response){
			if(response == ''){
				$("#dialogRecPass").dialog('option','height',150);
				$("#recPassDiv").html('');
				$("#recPassDiv").html(''
					+'Recupero password completato<br />'
					+'Tra pochi istanti riceverai una mail con la nuova password<br /><br />'
					+'Attendi il reindirizzamento'
				);
				setTimeout(function(){
					window.location.reload();
				}, 1000);
			} else {
				$("#recPassLoader").addClass('hide');
				$("#recPassButton").removeClass('hide');
				$("#recError_msg").addClass('show');
				$("#recError_msg").html(response);
			}
		},
		error: function(){
			$("#error_msg").addClass('show');
			$("#error_msg").html('C\'è un problema riprovare');
		}
	});
}

$(function(){
	// Dialog			
	$('#dialogRecPass').dialog({
		autoOpen: false,
		width: 280,
		height: 200,
		modal: true,
		draggable: false,
		position: ['top','center'],
		resizable: false
	});
	
	// Dialog Link
	$('#open_dialogRecPass').click(function(){
		$('#dialogRecPass').dialog('open');
		$('#emailRec').val('');
		$('#recError_msg').removeClass('show');
		$('#recError_msg').hide();
		return false;
	});
});
