//
var fin=null;

function ImgPopUp(img, titolo, width, height) {
	if (fin && !fin.closed){		// chiude le finestre aperte
		fin.close()
	}
	
	var xc = screen.width;
	var yc = screen.height;
	fin="";	
	
	var cntxc = Math.round(( xc / 2 ) - ( width / 2 ));
	var cntyc = Math.round(( yc / 2 ) - (( height * 9 ) / 10 ));
	
	if(height < 481){var scroll = "no";} else {var scroll = "yes";height = 450;width = Math.round(width + 18);}
	if(width > xc){width = Math.round(( xc ) - ( xc / 4 ));}
	
	fin=open ('','_blank','scrollbars=' + scroll + ',status=no,menubar=no,toolbar=no,location=no,directories=no,resizable=yes,copyhistory=no,left=' + cntxc + ',top=' + cntyc + ',width=' + width + ',height=' + Math.round(height+22));
	fin.document.open();
	fin.document.write("<html><head><title>");
	fin.document.write(titolo);
	fin.document.write("</title></head><body bgcolor=#AFACA9 topmargin=5 marginheight=5 leftmargin=5 marginwidth=5>");
	fin.document.write("<img src=" + img + " align=top><br><a href=javascript:window.close()><img src=../libreria/exit.gif border=0 vspace=3 hspace=5 align=right></a>");
	fin.document.write("</body></html>");
	fin.focus();
}
//
function PagPopUp(pag,width, height) {
	
	var xc = screen.width;
	var yc = screen.height;
	
	var cntxc = Math.round(( xc / 2 ) - ( width / 2 ));
	var cntyc = Math.round(( yc / 2 ) - (( height * 9 ) / 10 ));
	
	if(height < 481){var scroll = "no";} else {var scroll = "yes";height = 450;width = Math.round(width + 18);}
	if(width > xc){width = Math.round(( xc ) - ( xc / 4 ));}
	
	window.open (pag,'_blank','scrollbars=' + scroll + ',status=yes,menubar=no,toolbar=no,location=no,directories=no,resizable=yes,copyhistory=no,left=' + cntxc + ',top=' + cntyc + ',width=' + width + ',height=' + Math.round(height+22));
}
//
	function PopUp(url, width, height) {

	var xc = screen.width;
	var yc = screen.height;

	var cntxc = Math.round(( xc / 2 ) - ( width / 2 ));
	var cntyc = Math.round(( yc / 2 ) - (( height * 9 ) / 10 ));

	window.open (url,'_blank','scrollbars=yes,status=no,menubar=no,toolbar=no,location=no,directories=no,resizable=yes,copyhistory=yes,left=' + cntxc + ',top=' + cntyc + ',width=' + width + ',height=' + height);
}
//self.onerror = function() { return true } // Elimina eventuali messaggi di errore nella pagina.
//
// ciao ciao