function popwin(str, tipo, titolo) {
	height=100*str.length;
	if (height>350) height=350;
	if (titolo+"" == "undefined") titolo=".";
	msgwin=window.open('','msgwin',"resizable,scrollbars,width=350,height=" + height);
	with (msgwin.document) {
		open();
		writeln('<html><head><title>' + titolo + '</title></head>');
		writeln('<style>');
		writeln('th,td,body,p,h1 {font-family:Arial,Helvetica,Sans-Serif;text-align:left}');
		writeln('h1,p {text-align:center}');
		writeln('</style>');
		writeln('<body onblur="window.close(); return (true);">');
		if (titolo != ".") {
			writeln("<h1>" + titolo + "</h1>");
		}
		writeln('<table border=0 cellpadding=3 cellspacing=0>');
		if (tipo==1) {
			writeln('<tr>');
			writeln('	<td valign=top>' + str[0] + '</td>');
			writeln('</tr>');
			writeln('<tr>');
			writeln('	<td valign=top>' + str[1] + '</td>');
			writeln('</tr>');
		} else {
			for (i in str) {
				writeln('<tr>');
				writeln('	<th valign=top>' + str[i][0] + '</th>');
				writeln('	<td valign=top>' + str[i][1] + '</td>');
				writeln('</tr>');
			}
		}
		writeln('</table>');
		write('<p align=center><a href="" onclick="window.close();">Chiudi</a></p></body></html>');
		close();
	}
	msgwin.focus();
	return false;
}
