function popupfoto(categoria,foto,w,h,desc1,desc2,lang){
if((categoria == null)||(foto == null)||(w == null)||(h == null)||(desc1 == null)||(desc2 == null)){
	msg_c = (categoria == null)?"categoria\n":"";
	msg_f = (foto == null)?"foto\n":"";
	msg_w = (w == null)?"width\n":"";
	msg_h = (h == null)?"height\n":"";
	msg_d1 = (desc1 == null)?"descrizione1\n":"";
	msg_d2 = (desc2 == null)?"descrizione2\n":"";
	msg_al = "info incomplete:\n"+msg_c+msg_f+msg_w+msg_h+msg_d1+msg_d2;
	
	alert(msg_al);return false;
	
}
else{
	if (!lang)
	{chiudi="chiudi";
	img_tit = "tit_album.gif"
	}
	else
	{chiudi="close";
		img_tit = "tit_album-en.gif"

	
	}
	foto_hi = "<img src='/i/foto/"+categoria+"/"+foto+".jpg' name='dettaglio' id='dettaglio' /> "
	posX = screen.width/2;
	posX = posX-300;
	hw = h+110;
	ww = w+100;
	wwb = ww+20;
	wwr = ww-218;
	winpopup = open('', foto,'width='+wwb+',height='+hw+',left='+posX+',top=0,toolbars=0,scrollbars=1,resizable=1');
	
	winpopup.document.open();
	msg ="<html><head><title>il castello estense di ferrara</title><meta http-equiv='content-type' content='text/html; charset=iso-8859-1'>";
	msg += "<link href='/c/puf.css' rel='stylesheet' type='text/css'></head>";
	msg += "<body bgcolor=#bbbbbb leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onload='javascript:self.focus()'>";
	msg += "<div id=\"content\"><div id=\"head\"><img src='/i/foto/"+img_tit+"' /></div>"
	msg += "<div id=\"main\"><h1>[<span>"
	msg += desc1
	msg += "</span> : <span>"
	msg += desc2
	msg += "</span>]</h1>"
	msg += foto_hi
	msg += "<div id=\"foot\"><a class='chiudi' href='javascript:self.close()'>"
	msg += chiudi
	msg += "</a></div>"
	msg += "</div></div></body></html>"
	winpopup.document.write(msg);
	winpopup.document.close()
	}
}
