$(document).ready(function(){
	if ($('#errore_download').length)
	{
		$("#errore_download").show();
		$("#errore_download").dialog({ resizable: false, width: 350 });
		$("#loginform").submit(function() {
			$("#errore_download").dialog('close');
			//window.location.reload();
			return true;
		});
	}
});

function superoggetto (id)
{
	$("body").css("cursor", "wait");
	$.ajax
	({
		url: "/librerie_comuni/art15/php/superoggetto.php",
		data: "ID="+id,
		/*url: "popup.html",*/
		
		success: function(html)
		{
			$("#popup").remove();
			$("#risorse_digilibro").after(html);
			$("#popup").dialog({ width: 600, height: 400, resizable: true, autoOpen: true });
		}
	});
	$("body").css("cursor", "default");
}

function azionelogin(act)
{
	$("#loginform").attr("action",act);
	//$("#errore_download").dialog('close');
	alert ($("#loginform").attr("action"));
	$("#loginform").submit();
}

function popuppassword()
{
	$("body").css("cursor", "wait");
	$.ajax
	({
		url: "/librerie_comuni/art15/php/password.php",
		
		success: function(html)
		{
			$("#errore_download").remove();
			$("#risorse_digilibro").after(html);
			$("#errore_download").dialog({ width: 500, resizable: false, autoOpen: true });
			$('#errore_download').dialog('option', 'resizable', false);
		}
	});
	$("body").css("cursor", "default");
}

function passworddimenticata()
{
	$("body").css("cursor", "wait");
	$.ajax
	({
		url: "/librerie_comuni/art15/php/password.php",
		type: "POST",
		async: false,
		data: "email="+$("#email").val(),
		
		success: function(html)
		{
			$("#errore_download").remove();
			$("#risorse_digilibro").after(html);
			$("#errore_download").dialog({ width: 500, resizable: false, autoOpen: true });
			$('#errore_download').dialog('option', 'resizable', false);
		}
	});
	$("body").css("cursor", "default");
}
