// popup di varie dimensioni

var IE=navigator.appName.indexOf("Microsoft")!=-1;
var NN=navigator.appName.indexOf("Netscape")!=-1;
var browserVer=parseInt(navigator.appVersion);

function apri(url,larg,alt,scrol,resiz)		
{
	if (typeof(larg)=="undefined") larg=550;
	if (typeof(alt)=="undefined") alt=450;
	if (typeof(scrol)=="undefined") scrol="no";
	if (typeof(resiz)=="undefined") resiz="no";
	posX = (screen.width/2) - (larg/2);
	posY = (screen.height/2) - (alt/2);
	var nomerandom="";
    for(nomerandom_i=0;nomerandom_i<=10;nomerandom_i++) nomerandom+=String.fromCharCode(Math.round(97+25*Math.random()));
	var siteWindowVar=open(url,nomerandom,"toolbar=no,status=no,menubar=no,scrollbars="+scrol+""
						+",resizable="+resiz+",location=no,directories=no,width="+larg+",height="+alt+""
						+",top="+posY+",left="+posX);
	if (NN||browserVer>=4)	{	siteWindowVar.focus();	siteWindowVar.focus();	}
}

function aprifoto(foto,larg,alt,scrol,resiz)
{
	img = new Image;
	img.src = foto;
	if (typeof(larg)=="undefined") larg=550;
	if (typeof(alt)=="undefined") alt=450;
	if (typeof(scrol)=="undefined") scrol="no";
	if (typeof(resiz)=="undefined") resiz="no";
	posX = (screen.width/2) - (larg/2);
	posY = (screen.height/2) - (alt/2);
	var nomerandom="";
    for(nomerandom_i=0;nomerandom_i<=10;nomerandom_i++) nomerandom+=String.fromCharCode(Math.round(97+25*Math.random()));
	html = '<HTML>\n<HEAD>\n<TITLE>SCIRIO</TITLE>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 BGCOLOR=#FFFFFF>\n<CENTER><a href=\'javascript:self.close();\' title=\'Clicca per chiudere questa finestra\'><IMG SRC="'+foto+'" BORDER=0 NAME=immagine></a></CENTER>\n</BODY>\n</HTML>';
	posX = (screen.width/2) - (img.width/2);
	posY = (screen.height/2) - (img.height/2);
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars='+scrol+',resizable='+resiz+',top='+posY+',left='+posX+',width='+larg+',height='+alt);
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close()
}

function aprifoto2(url,larg,alt,rootpath)		
{
	if (typeof(larg)=="undefined") larg=450;
	if (typeof(alt)=="undefined") alt=450;
	posX = (screen.width/2) - (larg/2);
	posY = (screen.height/2) - (alt/2);
	if (location.host=="127.0.0.1") var rootpath="http://"+location.host+"/sciriosito/";
	else var rootpath="http://"+location.host+"/";
	var nomerandom="";
    for(nomerandom_i=0;nomerandom_i<=10;nomerandom_i++) nomerandom+=String.fromCharCode(Math.round(97+25*Math.random()));
	var siteWindowVar=open(rootpath+"js/foto2.php?percorso="+url,nomerandom,"toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,width="+larg+",height="+alt+""
						+",top="+posY+",left="+posX);
	if (NN||browserVer>=4)	{	siteWindowVar.focus();	siteWindowVar.focus();	}
}