/*
	----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
	Powered by GalleLuke - http://galleluke.altervista.org/
	----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----

	CORSO JAVASCRIPT
	http://www.mrwcorsi.it/corsi/scheda/corso-javascript-e-dhtml.asp

*/

// SCRIVI IL NUMERO DELLE FOTO, RICORDANDO CHE (SIA NELLA CARTELLA "BIG" CHE NELLA CARTELLA "SMALL")
// I NOMI DELLE FOTO DEVONO ESSERE NUMERICI, A PARTIRE DA 1 AD "N", IN FORMATO .JPG

var numluke = 5;

// POPOLA L'ARRAY CON LA DESCRIZIONE DELLE FOTO, INDICANDO PER OGNI ITEM DELL'ARRAY LA DESCRIZIONE
// CORRISPONDENTE AL NOME DELLA FOTO STESSA
// AD ESEMPIO:
// luke_descr[1] = "Cavallo bianco";
// CORRISPONDE ALLA FOTO 1.JPG, E COSI VIA

var luke_descr = new Array();

luke_descr[1] = "Laboratorio di mosaico";
luke_descr[2] = "Laboratorio Dall uva al vino";
luke_descr[3] = "Laboratorio dal Grano al pane";
luke_descr[4] = "Laboratorio di scavo archeologico";
luke_descr[5] = "Serata araba";

/*
	----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
	NON TOCCARE NULLA DI SOTTO!!!
	----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
*/

var luke;
window.onload = function()
{
	document.getElementById("imgluke").innerHTML = "<img src='big/1.jpg' id='lukeffect' alt=''/>";
	document.getElementById("imgluke_1").className = "imglukeon";
	document.getElementById("txtluke").innerHTML = document.getElementById("luketxt_1").title;
	for (luke = 2; luke < numluke + 1; luke++)
	{
		document.getElementById("imgluke_" + luke).className = "imglukeoff";
	}
}
function ShowGalleLuke(ShowBreak)
{
	var lukecount = 0;
	with (document)
	{
		write("<div align='center' id='imgluke'></div>");
		write("<div align='center' id='txtluke'></div>");
		write("<div align='center' id='galleluke'><table cellpadding='0' cellspacing='1'><tr>");
		for (luke = 1; luke < numluke + 1; luke++)
		{
			if (ShowBreak > 0)
			{
				if (lukecount == ShowBreak)
				{
					lukecount = 0;
					write("</tr><tr>");
				}
			}
			write("<td id='imgluke_" + luke + "'><a href='javascript:GalleLuke(" + luke + ")' id='luketxt_" + luke + "' title='" + luke_descr[luke] + "'><img src='small/" + luke  + ".jpg' alt=''/></a></td>");
			if (ShowBreak > 0) lukecount++;
		}
		write("<tr></table></div>");
	}
}
function GalleLuke(ImgName)
{
	document.getElementById("imgluke").innerHTML = "<img src='big/" + ImgName + ".jpg' id='lukeffect' alt=''/>";
	document.getElementById("txtluke").innerHTML = document.getElementById("luketxt_" + ImgName).title;
	document.getElementById("imgluke_" + ImgName).className = "imglukeon";
	for (luke = 1; luke < numluke + 1; luke++)
	{
		if (ImgName != luke)
		{
			document.getElementById("imgluke_" + luke).className = "imglukeoff";
		}
	}
}
