// Le grotte 2005 sorgenti.js 
// deve funzionare per IE e per Mozilla!!

var MSIE=navigator.userAgent.indexOf("MSIE");
var NETS=navigator.userAgent.indexOf("Netscape");
var OPER=navigator.userAgent.indexOf("Opera");

var LastUpdate  = "gennaio 2005";
var MyCopyright = "&copy; Marco Bonavoglia 2004/2005";

function	WebPage (intref, nameit, nameeng)
{
	this.IntRef  = intref;
	this.ItName  = nameit;
	this.EngName = nameeng;
	return this;
}

var	HomePage = 0;
var	GenePage = 1;
var	ChesPage = 2;
var MilaPage = 3;
var	LinkPage = 4;
var	QuadPage = 5;
var	FotoPage = 6;
var	CiboPage = 7;
var	GamsPage = 8;
var	PoesPage = 9;
var TibePage = 10;
var	AltrPage = 11;
var	NewsPage = 12;
var TotPages = 13;
var	MailPage = TotPages + 1;

var 	Pages = new Array (TotPages);
Pages [HomePage] = new WebPage ("mab_home.html", "PrimaPagina", "Home Page");
Pages [GenePage] = new WebPage ("genealogy/index.html", "Genealogia", "Genealogy");
Pages [ChesPage] = new WebPage ("mab_scac.html", "Scacchi", "Chess");
Pages [MilaPage] = new WebPage ("mab_mila.html", "Milano", "Milan");
Pages [LinkPage] = new WebPage ("mab_link.html", "Collegamenti", "Links");
Pages [QuadPage] = new WebPage ("mab_quad.html", "Quadri", "Paintings");
Pages [FotoPage] = new WebPage ("mab_foto.html", "Fotografie", "Photographs");
Pages [CiboPage] = new WebPage ("mab_cibo.html", "Ricette", "Recipes");
Pages [GamsPage] = new WebPage ("mab_gams.html", "Giochi", "Games");
Pages [PoesPage] = new WebPage ("mab_poes.html", "Poesie", "Poetry");
Pages [TibePage] = new WebPage ("mab_tibe.html", "Libert&agrave; per il Tibet", "Freedom for Tibet");
Pages [AltrPage] = new WebPage ("mab_altr.html", "Of_Cabbages", "and_Kings");
Pages [NewsPage] = new WebPage ("mab_news.html", "Giornali", "Newpapers");
Pages [MailPage] = new WebPage ("mab_mail.html", "I vostri commenti", "Your comments");

function	GoToPage (n, s)
{
	document.write ('<a class=int href="');
	document.write (Pages [n].IntRef);
	document.write ('">', s, '</a>');
}

function	GoToSubpage (n, sub, s)
{
	document.write ('<a class=int href="');
	document.write (Pages [n].IntRef);
	document.write ('#', sub, '">', s, '</a>');
}
// spezzare l'href di mailto per evitare i robot che cercano gli indirizzi
function	MyMail (s)
{
	document.write   ("<a class=int href='mail", "to:mbo");
	document.writeln ("navo@tin.it'>", s, "</a>");
}

function	MyMailGif (align)
{
	document.write   ("<a class=int href='mail", "to:mbo");
	document.writeln ("navo@tin.it'><img align=" +
					   align + 
	                  " src='gifanim/mail.gif'></a>");
}

function	GoBack (wd, imgdir)
{
	document.writeln ("<a href='javascript:history.go(-1)'>" +
	                  "<img width=" + wd + 
	                  " src='" + imgdir +
				      "/immagini/back.gif' alt='indietro - back'></a>");
}

function	GoToTop (wd, imgdir)
{
	document.write   ("<a class=int href=#testa>");
	document.writeln ("<img width=" + wd + " src='" + imgdir + 
				      "/immagini/top.gif' alt='inizio pagina - top of page'></a>");
}

function	Revision (oneline)
{
	document.write   ("Ultimo aggiornamento - Latest revision");
	if (!oneline)
		document.write   ("<br>", LastUpdate);
	else
		document.write   (" ", LastUpdate);
}

/*
** scrive header della pagina
*/

function	WriteHeader (pagenumber)
{
	var	i;
	
// àncora iniziale
	document.write ("<a name=testatutto></a>");
// crea tabella
	document.write ("<table align=center width=100% bgcolor=#ffffc8");
	document.writeln (" border=0 bordercolor=black bordercolor2=red>");
// prima linea
	document.writeln ("<tr>");
// cella con titolo
		document.writeln ("<td valign=center align=center width=25% ");
		document.writeln ("style = 'background:red; color:white; font-size:20pt; font-weight:700'>");
		document.writeln ("Le Grotte<br>di Marco Bonavoglia");
// prima cella con elenco pagine
		document.writeln ("<td valign=top width=32%><ul>");
		for (i = 0; i < TotPages / 2; i++)
		{
			document.write   ("<li>");
			if (i != pagenumber)
			{
				document.write   ('<a class=int href="');
				document.write   (Pages [i].IntRef);
				document.write   ('">');
			}
			else
				document.write ("<font color=red><b>")
			document.write   (Pages [i].ItName);
			document.write   (" - ");
			document.write   (Pages [i].EngName);
			if (i != pagenumber)
				document.writeln ("</a>");
			else
				document.write ("</b></font>");
		}
		document.writeln ("</ul>");
// seconda cella con elenco pagine
		document.writeln ("<td valign=top width=31%><ul>");
		for (; i < TotPages ; i++)
		{
			document.write   ("<li>");
			if (i != pagenumber)
			{
				document.write   ('<a class=int href="');
				document.write   (Pages [i].IntRef);
				document.write   ('">');
			}
			else
				document.write ("<font color=red><b>")
			document.write   (Pages [i].ItName);
			document.write   (" - ");
			document.write   (Pages [i].EngName);
			if (i != pagenumber)
				document.writeln ("</a>");
			else
				document.write ("</b></font>");
		}
		document.writeln ("</ul>");
// seconda linea mailto e copyright
	document.writeln ("<tr>");
	document.writeln ("<td colspan=4 align=center>");
	if (pagenumber != MailPage)
	{
		MyMailGif ("left");
		MyMailGif ("right");
		document.writeln ('<a class=int href="#copyright">' + MyCopyright + '</a><br>');
		Revision ();
		document.write ("<tr><td colspan='2' align=left>");
		GoToPage (MailPage, "Inviatemi i vostri commenti, grazie!");
		document.write ("    <td colspan='2' align=right>");
		GoToPage (MailPage, "Please send me your comments, thanks!");
	}
	else
		document.write ("<h2>I vostri commenti - Your comments</h2>");
// chiude tabella
	document.writeln ("</table>");
// àncora inizio pagina
	document.writeln ("<a name=testa></a>");
// div musicale ('clip') e immagine popup ('imgpop')
	document.writeln ("<div id='clip'></div>");
	document.writeln ("<img class='pop' id='imgpop' src='immagini/tstrip.gif' width=2>");

}
/*
** Scrive footer della pagina (campo Address)
*/
function	WriteFooter ()
{
	document.writeln ("<address>");
// crea una tabella (2 linee per due colonne) 
	document.writeln ("<table width=100% align=center cellpadding=5");
	document.writeln (" bordercolor=red bgcolor=#ffffc8 border=2>");
// data ultimo aggiornamento
// e ritorno a inizio pagina
	document.writeln ("<tr><td colspan=2 align=center>");
	MyMailGif ("left");
	MyMailGif ("right");
	document.writeln ("<a class=int href=#testa>Inizio pagina - Top of page</a><br>");
	Revision ();
// àncora per copyright
	document.writeln ("<tr>");
	document.writeln ("<a name=copyright></a>");
// contenuto in italiano
	document.writeln ("<td width=50% valign=top>");
	document.writeln ("<font size=+1><center><i><b>" + MyCopyright + "</i></b></center></font>");
	document.writeln ("<center><br>Con l'eccezione di parti riprodotte da altri siti");
	document.writeln (" tutti i testi, immagini, fotografie possono essere copiati");
	document.writeln ("<br><font color=#ff0000 size=+1>purché l'URL e l'autore siano indicati</font>");
	document.writeln ("<br> ... e sarebbe bello se mi informaste al <br>");
	MyMail ("mio indirizzo elettronico");
// contenuto in inglese
	document.writeln ("<td width=50% valign=top>");
	document.writeln ("<font size=+1><center><i><b>" + MyCopyright + "</i></b></center></font>");
	document.writeln ("<center><br>Unless otherwise specified, ");
	document.writeln (" all texts, pictures, images photographs can be freely copied,");
	document.writeln ("<br><font color=#ff0000 size=+1>provided the URL and author are indicated</font>");
	document.writeln ("<br> ... and it would be very nice of you to let me know at <br>");
	MyMail ("my Email address");
// chiude tabella ...
	document.writeln ("</table>");
// ... e campo address
	document.writeln ("</address>");
}
//
// scrive una linea di tabella con <n> celle di pari larghezza
//
function	NCellRow (n)
{
	var	i;
	var	w = document.body.clientWidth / n;
	
	document.write ("<tr>");
	for (i = 0; i < n; i++)
		document.write ("<td height=1 width=", w, "><img src='immagini/tstrip.gif' alt='transp'>");
}

function	FourCellRow ()
{
	var	i;
	var	w = document.body.clientWidth;
	
	document.write ("<tr>");
	for (i = 0; i < 4; i++)
		document.write ("<td height=1 width=", (w/4), "><img src='immagini/tstrip.gif' alt='transp'>");
}

// 
// funzioni audio per IE e Mozilla
//
function Play (id, source)
{
	var divid = document.getElementById (id);
	divid.innerHTML =  "<bgsound src=\"" + source + "\" volume=100>";
	divid.innerHTML += "<embed   src=\"" + source + "\" width=0 height=2 volume=100>";
}

// un po' di funzioni utili
//
//
// Random (min, max) ritorna un INTERO compreso fra min e max (inclusi)
function	Random (min, max)
{
	var	range = max - min + 1;
	return min + Math.floor (Math.random() * range);
}
// 
// funzioni data e ora in italiano e inglese
//

// array con i nomi dei giorni e dei mesi
var NomeMesi   = new Array ("gennaio", "febbraio", "marzo", 
                          "aprile", "maggio", "giugno", 
                          "luglio", "agosto", "settembre", 
                          "ottobre", "novembre", "dicembre");
var NomeGiorni = new Array ("domenica", "luned&iacute;", "marted&iacute;", "mercoled&iacute;", 
                            "gioved&iacute;", "venerd&iacute;", "sabato");

var MonthsName = new Array ("January", "February", "March", 
                            "April", "May", "June", 
                            "July", "August", "September", 
                            "October", "November", "December");
var DaysName   = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", 
                            "Thursday", "Friday", "Saturday");
// variabili di Date
var time;
var month;
var day;
var hour;
var minute;
var second;

// converte Date d in italiano <<giorno gg-mese-aaaa>>

function datagiorno (d)
{
	var str;

	time  = d ? d : new Date ();
	month = time.getMonth ();
	day   = time.getDay ();
	str   = NomeGiorni [day] + " " + time.getDate ();
	str  += " " + NomeMesi [month] + " " + time.getFullYear ();
	
	return str;
}

// converte Date d in italiano <<gg-mese-aaaa>>
function data (d)
{
	var str;

	time  = d ? d : new Date ();
	month = time.getMonth ();
	str   = time.getDate ();
	str  += " " + NomeMesi [month] + " " + time.getFullYear ();
	
	return str;
}

// converte Date d in italiano <<hh:mm:ss>>
function ora (d)
{
	var str;

	time   = d ? d : new Date ();
	minute = time.getMinutes();
	second = time.getSeconds();
	hour   = time.getHours ();
//
	str    = hour;
    str   += ((minute < 10 ? ":0" : ":") + minute);
    str   += ((second < 10 ? ":0" : ":") + second);
    return str;
}

// converte Date d in italiano <<hh:mm>>
function ora_min (d)
{
	var str;

	time   = d ? d : new Date ();
	minute = time.getMinutes();
	second = time.getSeconds();
	hour   = time.getHours ();
//
	str    = hour;
    str   += ((minute < 10 ? ":0" : ":") + minute);
    return str;
}

// converte Date d in inglese <<giorno gg-mese-aaaa>>
function eng_datagiorno (d)
{
	var str;

	time  = d ? d : new Date ();
	month = time.getMonth ();
	day   = time.getDay ();
	str   = DaysName [day] + ", " + MonthsName [month];
	str  += " " + time.getDate () + " " + time.getFullYear ();
	
	return str;
}

// converte Date d in inglese <<gg-mese-aaaa>>
function eng_data (d)
{
	var str;

	time  = d ? d : new Date ();
	month = time.getMonth ();
	str   = MonthsName [month];
	str  += " " + time.getDate () + " " + time.getFullYear ();
	
	return str;
}

// converte Date d in inglese <<hh:mm:ss>>
function eng_ora (d)
{
	var str;

	time   = d ? d : new Date ();
	minute = time.getMinutes();
	second = time.getSeconds();
	hour   = time.getHours ();
//
	str    = hour > 12 ? (hour - 12) : hour;
    str   += ((minute < 10 ? ":0" : ":") + minute);
    str   += ((second < 10 ? ":0" : ":") + second);
    str   += hour > 12 ? "PM" : "AM";
    return str;
}

// converte Date d in inglese <<hh:mm>>
function eng_ora_min (d)
{
	var str;

	time   = d ? d : new Date ();
	minute = time.getMinutes();
	second = time.getSeconds();
	hour   = time.getHours ();
//
	str    = hour > 12 ? (hour - 12) : hour;
    str   += ((minute < 10 ? ":0" : ":") + minute);
    str   += hour > 12 ? "PM" : "AM";
    return str;
}

// ritorna stringa di benvenuto in italiano
function benvenuto ()
{
	var	saluto;
	var	d, o;
	
	d = datagiorno ();
	o = ora_min ();
	
	if (hour < 17)
		saluto = "Buongiorno";
	else
		saluto = "Buona sera";
	if (day == 0)
		saluto += " e buona domenica!";
	else
		saluto += "!";
	return saluto + "<br>Sono le " + o + " di " + d;
}

// ritorna stringa di benvenuto in inglese
function welcome ()
{
	var	saluto;
	var	d, o;
	
	d = eng_datagiorno ();
	o = eng_ora_min ();
	
	if (hour < 13)
		saluto = "Good Morning";
	else if (hour < 17)
		saluto = "Good Afternoon";
	else
		saluto = "Good Evening";
	if (day == 0)
		saluto += " and happy Sunday!";
	else
		saluto += "!";
	return saluto + "<br>It's " + o + " of " + d;
}

// ritorna data ultima modifica di un documento
function	modificato (doc, lang)
{
	var d;
	
	d = new Date (doc.lastModified);
	if (lang == null)
		lang = 1;
	switch (lang)
	{
		case 0: 
			return eng_data (d);
		case 1:
			return data (d);
		case 2:
			return data (d) + " - " + eng_data (d);
		case 3:
			return eng_data (d) + " - " + data (d);
	}
	return "Errore in modificato () => lang undefined";
}

//
// visualizza testo su schermo (NON in una nuova finestra!)
//
// (il testo è già scritto nel <div> divid

var	TextBack = "#c8ffff";
var TextFore = "#ff0000";

// Equivalente di <a href ... > per evitare di interrompere i gif o i suoni
// (forse si può eliminare Reverse)
//
function Reverse (divid, backcol, pencol)
{
	divid.style.background = pencol;
	divid.style.color      = backcol;
}
function	Rif (what, descr, clr, bck)
{
	if (!clr)
		clr = 'black';
	if (!bck)
		bck = 'white';
//
	var revstr1  = "javascript:Reverse (this, ";
		revstr1 += "'" + bck + "', '" + clr + "');";
	var revstr2  = "javascript:Reverse (this, ";
		revstr2 += "'" + clr + "', '" + bck + "');";
//
	document.write ("<div class=divdiv");
	document.write (" style=\"width:*; color:'", clr, "'; background:'", bck, "';\"");
	document.write (" onclick='javascript:");
	document.write (what);
	document.write ("'");
	document.write (" onmouseover=\"", revstr1, "\"");
	document.write (" onmouseout =\"", revstr2, "\">");
	document.write (descr);
	document.write ("</div>");
}

function	CreateText (divid, ref, clr, bck)
{
	var	TextId;
	var str;
	
	str  = "<table border=0><tr><td bgcolor='" + TextBack + "'>";
	str += "<font size=-1>Cliccate sulla finestra per chiuderla - ";
	str += "Click on the window to close it";
	str += "<tr><td align=center bgcolor='" + TextBack + "' style='color:" + TextFore + "; padding-left: 10; padding-right : 10; text-align:justify'>";
	TextId = document.getElementById (divid);
	TextId.style.left = -5000;
	TextId.style.top  = -5000;
	TextId.innerHTML  = str + TextId.innerHTML + "</table>";
	
	Rif ("ShowText (\"" + divid + "\");", ref, clr, bck);
}

function	ShowText (txtid)
{
	var	TextId;
	var	w = document.body.clientWidth;
	
	w = Math.floor (w * 2 / 3);
	
	TextId = document.all.item (txtid);
	TextId.style.width  = w;
	TextId.style.left   = 10;
	TextId.style.top	= 10 + document.body.scrollTop;
}

function	HideText (txtid)
{
	var	TextId;
	
	TextId = document.all.item (txtid);
	TextId.style.left   = -5000;
	TextId.style.top	= -5000;
}



//
// visualizza immagine su schermo (NON in una nuova finestra!)
//

function	CreateImage (imgname, ratio, n, descr)
{
	var	divid;
	
	if (n < 10)
		divid = "imgdiv0" + n;
	else
		divid = "imgdiv" + n;
	document.write ("<div id=" + divid + " class=image onClick=\"HideImage(");
	document.write (divid + ");\"></div>");
	document.write ("<a class=int href=\"javascript:ShowImage (");
	document.write (divid + ", \'" + imgname + "\', " + ratio + ");\">");
	document.write (descr + "</a>");
}

function	CreateThumb (lowresimg, ratio, n, wid, h, hiresimg, titolo)
{
	var	divid;
	
	if (n < 10)
		divid = "thmbdiv0" + n;
	else
		divid = "thmbdiv" + n;
	document.write ("<div id=" + divid + " class=image onClick=\"HideImage(");
	document.write (divid + ");\"></div>");
	document.write ("<a class=int href=\"javascript:ShowImage (");
	if (!h)
		h = 0;
	if (hiresimg == null)
		hiresimg = lowresimg;
	if (titolo   == null)
		titolo   = "_____";
	document.write (divid + ", \'" + hiresimg + "\', " + ratio + ", \'" + titolo + "\');\">");
	if (wid)
		document.write ("<img class=limg src='" + lowresimg + "' width=" + wid +">");
	if (h)
		document.write ("<img class=limg src='" + lowresimg + "' height=" + h +">");
	document.write ("</a>");
}

function	ShowImage (divid, imgname, ratio, titolo)
{
	var	w = document.body.clientWidth;
	var	h;
	
	if (!ratio)
		ratio = 1.333;
	w = Math.floor (w * 2 / 3);
	h = Math.floor (w / ratio);  // #### cambiato 25.7.2004
	
	divid.style.width  = w;
	divid.style.height = h;
	divid.innerHTML    = "Cliccare sull'immagine per chiuderla - Click on the image to close it<br>";
	if (titolo)
		divid.innerHTML += "<font size=+2 color=red><b>" + titolo + "</b></font><br>";
	divid.innerHTML   += "<img class='standing' src='" + imgname + "' width=" + w + " height=" + h + ">";
	divid.innerHTML   += "<img class='standing' src='immagini/x.gif' onerror='src=\"../immagini/x.gif\"' width=" + w + " height=" + h + ">";
// #### 13/8
	divid.style.top	   = 10 + document.body.scrollTop;
	divid.style.left   = 10;
}

function	HideImage (divid)
{
	divid.style.top    = -1000;
	divid.style.left   = -1000;
}

//
//	gestione delle foto 
//
var	MaxPhoto  = 200;
var	TotPhoto;
var AllPhotos = new Array (MaxPhoto);
var	PhotoDir  = "./immagini/";
var	ImgName   = 'pix';
var DivName1  = 'descr1';
var DivName2  = 'descr2';
var	PhotoInd  = 0;
// oggetto Photo
function Photo (name, filename, descrita, descreng, author, portrait)
{
	this.name     = name;
	this.filename = PhotoDir + filename;
	this.descrita = descrita;
	this.descreng = descreng;
	this.author   = "Foto : " + author;
	this.portrait = portrait;
	return this;
}

// visualizza la foto nella <img name = 'imgid' e descrizione in <div name = 'divid
function	ShowPhoto (ind)
{
	var pic = AllPhotos [ind];
	var	im  = document.images   [ImgName];
	var dv1 = document.getElementById (DivName1);
	var dv2 = document.getElementById (DivName2);
	var	clw = document.body.clientWidth;
	var w;

	if (im.src == pic.filename)
		return;
	im.alt = pic.name;
	im.src = pic.filename;

	if (pic.portrait)
		w = Math.floor (clw * 0.525);
	else
		w = Math.floor (clw * 0.7);
	im.style.width = w;
	dv1.innerHTML  = "<h3>" + pic.name + "</h3>";
	dv1.innerHTML += pic.descrita;
	dv1.innerHTML += "<br>" + pic.descreng;
	dv1.innerHTML += "<br>" + pic.author;
	dv2.innerHTML  = dv1.innerHTML;
	PhotoInd      = ind;
}

function	NextPhoto ()
{
	PhotoInd = (PhotoInd + 1) % TotPhoto;
	ShowPhoto (PhotoInd);
}

function	PrevPhoto ()
{
	PhotoInd = (PhotoInd + TotPhoto - 1) % TotPhoto;
	ShowPhoto (PhotoInd);
}

// lista le foto con anchor per visualizzarle
function	PhotoNames (columns)
{	
	if (!columns)
		columns = 5;
	var	i, j;
	var	tdstr   = "<td width=" + Math.floor (100/columns) + "%>";
	
	for (i = 0; i < TotPhoto; i += columns)
	{
		document.write ("<tr>");
		for (j = 0; j < columns; j++)
		{
			if (i + j >= TotPhoto) break;
			document.write (tdstr);
			document.write ("<div ");
			Rif ("ShowPhoto(" + (i + j) + ")", "&nbsp;&bull;&nbsp;" + AllPhotos [i + j].name, 'navy', 'gold');
		}
	}
}
// cella con lista
function PhotoList (wid, col)
{
	var widscr;
	
	widscr = wid ? wid + "%" : "100%"
	col    = col ? col : 5;
	document.write ("<table class=photolist width=", widscr, ">");
	PhotoNames (col);
	document.write ("</table>");
}

function	PhotoBody (title, good)
{
	TotPhoto = i;
	
	document.write ("<scr" + "ipt>");
	document.write ("LastUpdate = modificato (document, 2);");
	document.write ("WriteHeader (-1);");
	document.write ("</scr" + "ipt>");
	if (good)
	{
		document.write ('<a href="http://validator.w3.org/check?uri=referer"><img border="0"');
		document.write ('src="http://www.w3.org/Icons/valid-html401"');
		document.write ('alt="Valid HTML 4.01!" height="31" width="88"></a>');
	}
	document.write ("<table class=photo width=100% cellspacing=0 border=0 cellpadding=0>");
	document.write ("<tr><td style='color:white; font-weight:bold; background:red; text-align:center; font-size:24pt' width=100% colspan=2>Album fotografico - Photographic book");
	document.write ("<br>" + title);
	document.write ("<tr><td align=center colspan=2 style=\"color:red; font-weight:700;\"><b>Ogni foto &egrave; mediamente 100Kb. Il caricamento pu&ograve; richiedere molto tempo<br>");
	document.write ("A photo is 100Kb average, its download may take some time</b>");
//
	document.write ("<tr>");
//
	document.write ("<td valign=top width=30% rowspan=2>");
	document.write ("<scr" + "ipt>PhotoList (100, 1);</scr" + "ipt>");
	document.write ("<td valign=top width=70%>");
	document.write ("<div class=photo style='padding-left: 100px;' id=" + DivName1 + ">");
	document.write ("&rarr; ERRORE. Descrizione della foto mancante.<br>");
	document.write ("&rarr; ERROR. Missing photo description.</div>");
	document.write ("<br><center>");
	document.write ("<input class = redbtn type = button ");
	document.write ("onClick = 'PrevPhoto ()'");
	document.write (" value = '&nbsp;&nbsp;&lt;&lt;&nbsp;&nbsp'>");
	document.write ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	document.write ("<input class = blubtn type = button ");
	document.write ("onClick = 'NextPhoto ()'");
	document.write (" value = '&nbsp;&nbsp;&gt;&gt;&nbsp;&nbsp'>");
	document.write ("<tr>");
	document.write ("<td width=70% align=center valign=top ");
	document.write ("style='padding-left:20px; padding-right:20px; margin:none;border:none;'>");
	document.write ("<img class=photoimg name =" + ImgName + " src='immagini/nophoto.gif'");
	document.write (" alt=\"Foto mancante - No such photo\">");
	document.write ("<div class=photo style='padding-left: 100px;' id=" + DivName2 + ">");
	document.write ("&rarr; ERRORE. Descrizione della foto mancante.<br>");
	document.write ("&rarr; ERROR. Missing photo description.</div>");
	document.write ("<br><center>");
	document.write ("<input class = redbtn type = button ");
	document.write ("onClick = 'PrevPhoto ()'");
	document.write (" value = '&nbsp;&nbsp;&lt;&lt;&nbsp;&nbsp'>");
	document.write ("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	document.write ("<input class = blubtn type = button ");
	document.write ("onClick = 'NextPhoto ()'");
	document.write (" value = '&nbsp;&nbsp;&gt;&gt;&nbsp;&nbsp'>");
	document.write ("</center><br><br>");
	document.write ("</table>");	
	ShowPhoto (0);
}


