<!--

var signResult;
var signedBase64;

function IsGenerated(taskId)
{
	if (UcWait.IsGenerated(taskId).value)
	{
		document.location.href = document.location.href;
	}
	else
	{
		setTimeout("IsGenerated(" + taskId + ")", 5000);
	}
}

function Sign(path)
{
	try
	{
		signedBase64 = GetSignedFile(path);
						
		if (signResult == 0)
		{
			document.all.Form1.myUpload_signResult.value = signedBase64;
			document.all.Form1.submit();

			return true;
		}
		else
		{
			if (signResult==2)
			{
				alert("Błąd podpisywania!");
			}
			return false;
		}
	}
	catch (ex)
	{
		alert("Błąd inicjalizacji modułu podpisywania");
	}
}

function GetSignedFile(path)
{
	signResult = MySigner.SignFile(path, "" , null, false, false);

	return MySigner.Base64String;
}

function Verify(signedFileName, fileName, data)
{
	try
	{
		MyVerifier.VerifyAll(signedFileName, fileName, data);
	}
	catch (ex)
	{
		alert("Bł±d inicjalizacji modułu weryfikacji");
	}
}

-->
