//  1	- Definizione Funzioni Utilizzate nelle Pagine di www.Tribunali.it
//  2	- (c) 1999-2008 Daniel Zucconi - Ver. 2002

// ------------ GESTIONE VISUALIZZAZIONE CONTENITORI FRAME ---------------------

//  6	- Rilevamento del Nome Pagina
	function GetPageName()
	{
		var URL	= unescape(this.location);
		var SpURL	= URL.split("/");
		var FName	= SpURL[SpURL.length-1].split(".");
		return FName[0];
	}

// 15	- Rilevamento del Percorso Pagina
	function GetPagePath()
	{
		var URL	= unescape(this.location);
		var SpURL	= URL.split("/");
		var Path	= "";
		for (Count = 0; Count < SpURL.length-1; Count++)	{Path = Path + SpURL[Count] + "/";}
		return Path;
	}

// 25	- Rilevamento della Profondità della Cartella Rispetto alla Cartella di Riferimento
	function GetDepth()
	{
		var ParURL	= unescape(parent.location);
		var ParURLS	= ParURL.split("/");
		var TarURL	= unescape(this.location);
		var TarURLS	= TarURL.split("/");
		var Depth	= TarURLS.length - ParURLS.length;
		return Depth;
	}

// 15	- Controllo Home Page
	function IsTopHome(Tipo)
	{
			if (Tipo == "H" && this.location == top.location)
				{window.open("../../index.html", "_top");}
			else if (Tipo == "R" && this.location == top.location)
				{window.open("index.html", "_top");}
	}

// 36	- Inizializzazione HEAD della Pagina
	function DefInit()
	{
	// 39	- Soppressione Errori
		window.onerror	= null;
	// 41	- Settaggio Status Automatico
		window.defaultStatus	= parent.Status;
	}

// 36	- Inizializzazione HEAD della Pagina
	function InitHead(Title)
	{
		DefInit()
	// 43	- Completamento Tag TITLE, Impostazione TITLE e META
		if(!Title)
		{
			var Tipo	= 3;
			var NPrc	= 4;
			var Intestazione	= "";
			if (parent.Procedura[Tipo] == "E")
				{Intestazione	= "Esecuzione n°: ";}
			else if (parent.Procedura[Tipo] == "F")
				{Intestazione	= "Fallimento n°: ";}
			Title	= parent.Title + " - " + Intestazione + parent.Procedura[NPrc];
		}
		document.writeln("<TITLE>" + Title + "</TITLE>");
		document.writeln("<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=iso-8859-1'>");
		document.writeln("<META HTTP-EQUIV='description'  CONTENT='" + parent.Desc + "'>");
		document.writeln("<META HTTP-EQUIV='keywords'     CONTENT='Tribunale, Tribunali, Legge, Esecuzioni, Giustizia, Banca, Bank, Credito, Finanza, Affari, Circoscrizione, Case, Procedure, Auto, Automobili'>");
		document.writeln("<META HTTP-EQUIV='author'       CONTENT='Daniel Zucconi - Adiuvanda 1999-2008'>");
		document.writeln("<META HTTP-EQUIV='Reply-to'     CONTENT='info@tribunali.it'>");
	// 61	- Impostazione Stili
		var Depth	= "";
		for (Count = 0; Count < GetDepth(); Count++)	{Depth	= "../" + Depth;}
		document.writeln("<LINK REL='stylesheet' TYPE='text/css' HREF='" + Depth + "Source/CSS/Body_CSS.html'>");
	}

// 	- Inizializzazione BODY della Pagina
	function InitBody(Positioning)
	{
	// 	- Contenitore Testo
		if(Positioning.toUpperCase() == "CENTERED")
			{document.writeln("<TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='100%' HEIGHT='100%'><TR><TD ALIGN='center' VALIGN='middle'>");}
		else
			{document.writeln("<TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='100%' HEIGHT='100%'><TR><TD VALIGN='top'>");}
	//	- Inizializzazione Menu
		document.writeln("<STYLE><!--");
		for (Count = 0; Count < parent.ME.length; Count++)
			{document.writeln("#" + parent.ME[Count].Name + " {position: absolute; top: 0px; left: 0px; visibility: hidden;}");}
		document.writeln("--></STYLE>");

//<style type="text/javascript">
//<!-- Required for Netscape 4.0
//  ids.Home.position = "static"
//  ids.Info.position = "static"
// -->
//</style>

	//	- Costruzione dei Menu
		for (Count = 0; Count < parent.ME.length; Count++)
		{
			document.writeln("<TABLE BGCOLOR='#009999' BORDER='1' BORDERCOLORDARK='" + parent.ME[Count].BoColD + "' BORDERCOLORLIGHT='" + parent.ME[Count].BoColL + "' CELLPADDING='0' CELLSPACING='0' ID='" + parent.ME[Count].Name + "' STYLE='border-style:inset;' onMouseOver='ShowMenu(" + Count + ");' onMouseOut='HideAllMenu(" + Count + ");'><TR><TD><TABLE BGCOLOR='#009999' BORDER='0' CELLPADDING='2' CELLSPACING='0'>");
			for (Counter = 0; Counter < parent.ME[Count].DD.length; Counter++)
			{
				if(parent.ME[Count].Type == "DD")
				{
					var Depth	= "";
					for (Countess = 0; Countess < GetDepth(); Countess++)	{Depth	= "../" + Depth;}
					document.writeln("<TR><TD STYLE='cursor:hand;' NOWRAP onClick='window.open(&quot;" + Depth + parent.ME[Count].DD[Counter].URL + "&quot;, &quot;" + parent.ME[Count].DD[Counter].Target + "&quot;); HideAllMenu(" + Count + ");' onMouseOver='this.bgColor = &quot;" + parent.ME[Count].BgColD + "&quot;; window.status = &quot;" + parent.ME[Count].DD[Counter].SText + "&quot;' onMouseOut='this.bgColor=&quot;" + parent.ME[Count].BgColL + "&quot;'><H6 CLASS='MENU'>" + parent.ME[Count].DD[Counter].Text + "</H6></TD></TR>");
				}
			}
			document.writeln("</TABLE></TD></TR></TABLE>");
		}

	//	- Gestione dei Menu Buttons
		var Page	= GetPageName();

		var RicVis	= "hidden";
		var RicInd	= -2;
		var OPIVis	= "hidden";
		var OPIInd	= -2;
		var O_Vis	= "hidden";
		var P_Vis	= "hidden";
		var I_Vis	= "hidden";

		switch (Page)
		{
			case "VendAltr":
			case "VendAzie":
			case "VendImmo":
			case "VendMobi":
				RicVis = "visible";
				RicInd = 2
			break;

			case "Ordinanz":
			case "Perizia":
			case "Immagini":
				OPIVis = "visible";
				OPIInd = 2
				O_Vis  = "visible";
				if (parent.Procedura[11].indexOf("P") != -1) {P_Vis = "visible";}
				if (parent.Procedura[11].indexOf("I") != -1) {I_Vis = "visible";}
			break;
		}

	//	- Disabilita il Controllo Tasti se è la Prima Pagina
		if ((Page != "Tribu_B") || (Page != "Body"))
		{
			parent.Head.document.all.ORDINANZA.borderColorLight	= parent.ME[6].BoColL;
			parent.Head.document.all.ORDINANZA.borderColorDark	= parent.ME[6].BoColD;
			parent.Head.document.all.PERIZIA.borderColorLight	= parent.ME[6].BoColL;
			parent.Head.document.all.PERIZIA.borderColorDark	= parent.ME[6].BoColD;
			parent.Head.document.all.IMMAGINI.borderColorLight	= parent.ME[6].BoColL;
			parent.Head.document.all.IMMAGINI.borderColorDark	= parent.ME[6].BoColD;

			parent.Head.document.all.Ric.style.visibility	= RicVis;
			parent.Head.document.all.Ric.style.zIndex		= RicInd;

			parent.Head.document.all.OPI.style.visibility	= OPIVis;
			parent.Head.document.all.OPI.style.zIndex		= OPIInd;

			parent.Head.document.all.ORDINANZA.style.visibility	= O_Vis;
			parent.Head.document.all.PERIZIA.style.visibility	= P_Vis;
			parent.Head.document.all.IMMAGINI.style.visibility	= I_Vis;
		}

		switch (Page)
		{
			case "Ordinanz":
				parent.Head.document.all.ORDINANZA.borderColorLight = parent.ME[6].BoColD;
				parent.Head.document.all.ORDINANZA.borderColorDark = parent.ME[6].BoColL;
			break;
			case "Perizia":
				parent.Head.document.all.PERIZIA.borderColorLight = parent.ME[6].BoColD;
				parent.Head.document.all.PERIZIA.borderColorDark = parent.ME[6].BoColL;
			break;
			case "Immagini":
				parent.Head.document.all.IMMAGINI.borderColorLight = parent.ME[6].BoColD;
				parent.Head.document.all.IMMAGINI.borderColorDark = parent.ME[6].BoColL;
			break;
		}
	}

//	- Impostazione di Testo ed Icone nel Frame Tribu_H
	function PlaceHeader(Trib)
	{
		document.writeln("<TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' WIDTH='100%' HEIGHT='75'><TR HEIGHT='75'><TD>");
		document.writeln("<H1><IMG SRC='../../Tribunal/" + Trib + "/Images/Scudetto.gif'></H1>");
		document.writeln("</TD><TD ALIGN='center' VALIGN='middle'>");
		document.writeln("<H1>TRIBUNALE di " + Trib + "</H1>");
		document.writeln("</TD><TD>");
		document.writeln("<H1><IMG SRC='../../Tribunal/" + Trib + "/Images/Scudetto.gif'></H1>");
		document.writeln("</TD></TR></TABLE>");
	}

//	- Posiziona la Tabella con i Dati della Procedura
	function PlaceTable()
	{
		var Tipo	= 3;
		var NPrc	= 4;
		var DVen	= 5;
		var OVen	= 6;
		var Debi	= 9;
		var Vend	= 10;
		var DLng	= 15;

		var Intestazione	= "";
		if (parent.Procedura[Tipo] == "E")
			{Intestazione	= "Esecuzione n°: ";}
		else if (parent.Procedura[Tipo] == "F")
			{Intestazione	= "Fallimento n°: ";}

		document.writeln("<TABLE BORDER='0' CELLPADDING='5' CELLSPACING='15' WIDTH='450'><TR><TD BGCOLOR='#C0C0C0'>");
		document.writeln("<H4 CLASS='PRID'>" + parent.Procedura[Debi] +"</H4>");
		document.writeln("<P ALIGN='justify'>" + Intestazione +"<B>" + parent.Procedura[NPrc] +"</B></P>");
		document.writeln("<P ALIGN='justify'>Vendita a cura di: <B>" + parent.Procedura[Vend] + "</B></P>");
		document.writeln("<P ALIGN='justify'>Data della vendita: <B>" + parent.Procedura[DLng] + parent.Procedura[OVen] + "</B></P>");
		document.writeln("</TD></TR></TABLE>");
	}

// 	- Chiusura BODY della Pagina
	function CloseBody()
	{
	// 	- Chiusura Contenitore Testo
		document.writeln("</TD></TR><TR HEIGHT='40'><TD VALIGN='bottom'><HR ALIGN='center' COLOR='#009999' SIZE='1' WIDTH='400'><H6 CLASS='COPY'>(c) 1999-2008 <A HREF='../../Adiuvand.html' TARGET='_top'>Adiuvanda</A></H6></TD></TR></TABLE>");
	}

//	- Costruisce i Menu nel Frame Head
	function BuildMenuButton()
	{
	//	- Costruisce il Contenitore dei Menu Drop Down
		document.writeln("<TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' HEIGHT='17'><TR>");
	//	- Assegna i Valori ai Tasti
		for (Count = 0; Count < parent.ME.length; Count++)
		{
			if(parent.ME[Count].Type == "DD")
			{
			//	- Caso DD - Menu Drop Down
				document.writeln("<TD><TABLE BORDER='1' BORDERCOLORDARK='" + parent.ME[Count].BgColL + "' BORDERCOLORLIGHT='" + parent.ME[Count].BgColL + "' CELLPADDING='0' CELLSPACING='0' HEIGHT='15' ID='" + parent.ME[Count].Name + "' STYLE='border-style:inset; cursor:hand;' onMouseOver='HideAllMenu(); ShowMenu(" + Count + "); window.status = &quot;" + parent.ME[Count].SText + "&quot;;' onMouseOut='parent.flag = 0;'><TR><TD><H6 CLASS='MENUHEAD'>" + parent.ME[Count].Text + "</H6></TD></TR></TABLE></TD>");
			}
			else if(parent.ME[Count].Type == "SP")
			{
			//	- Caso SP - Spacer
				document.writeln("<TD BGCOLOR='" + parent.ME[Count].BgColD + "' WIDTH='100%'>&nbsp</TD>");
			}
		}

	//	- Chiude il Contenitore
		document.writeln("</TR></TABLE>");

		var Repos	= 0;

		for (Count = 0; Count < parent.ME.length; Count++)
		{
		//	- Caso BT - Tasti Attivabili
			if(parent.ME[Count].Type == "BT")
			{
			//	- Costruisce il Contenitore dei Tasti
				document.writeln("<TABLE ALIGN='right' BORDER='0' CELLPADDING='0' CELLSPACING='0' HEIGHT='17' ID='" + parent.ME[Count].Name + "' STYLE='position: relative; right:-" + Repos + "px; top:-20px; visibility:hidden; z-index:-2;'><TR>");

				//	- Costruisce i Tasti
					for (Countess = 0; Countess < parent.ME[Count].DD.length; Countess++)
					{
						document.writeln("<TD><TABLE BORDER='1' BORDERCOLORDARK='" + parent.ME[Count].BoColD + "' BORDERCOLORLIGHT='" + parent.ME[Count].BoColL + "' CELLPADDING='0' CELLSPACING='0' HEIGHT='15' ID='" + parent.ME[Count].DD[Countess].Text + "' STYLE='border-style:inset; cursor:hand;' onClick='ButtonClick(&quot;" + parent.ME[Count].DD[Countess].URL + "&quot;, &quot;" + parent.ME[Count].DD[Countess].Target + "&quot;);' onMouseOver='window.status = &quot;" + parent.ME[Count].DD[Countess].SText + "&quot;;'><TR><TD><H6 CLASS='MENUHEAD'>" + parent.ME[Count].DD[Countess].Text + "</H6></TD></TR></TABLE></TD>");
					}
			//	- Chiude il Contenitore
				document.writeln("</TR></TABLE>");

				var GetWidthOf	= eval ("top.Head.document.all." + parent.ME[Count].Name);
				Repos = GetWidthOf.clientWidth + 1;
			}
		}
	}

//	- Visualizza i Menu
	function ShowMenu(Which)
	{
		var Menu = eval ("top.Body.document.all." + parent.ME[Which].Name);
		var MenuHead = eval ("top.Head.document.all." + parent.ME[Which].Name);

		var RightEdge = 0;
		for (Count = (Which-1); Count >= 0; Count--)
		{
			var GetWidthOf	= eval ("top.Head.document.all." + parent.ME[Count].Name);
			RightEdge = RightEdge + 2 + GetWidthOf.clientWidth;
		}

		var topEdge = top.Body.document.body.scrollTop;

		MenuHead.borderColorLight = parent.ME[Which].BoColD;
		MenuHead.borderColorDark = parent.ME[Which].BoColL;
		Menu.style.pixelTop = topEdge;
		Menu.style.pixelLeft = RightEdge;
		Menu.style.visibility = "visible";
	}

//	- Nasconde Tutti i Menu
	function HideAllMenu()
	{
		var Menu;
		var MenuHead;

		for (Count = 0; Count < parent.ME.length; Count++)
		{
			if(parent.ME[Count].Type == "DD")
			{
				Menu = eval ("top.Body.document.all." + parent.ME[Count].Name);
				MenuHead = eval ("top.Head.document.all." + parent.ME[Count].Name);

				MenuHead.borderColorLight = parent.ME[Count].BgColL;
				MenuHead.borderColorDark = parent.ME[Count].BgColL;
				Menu.style.visibility = "hidden";
			}
		}
	}

//	- Gestione dei Menu Buttons
	function ButtonClick(URL, Target)
	{
		if (Target == "JS")
		{
			var Parent	= new Array (parent.Body.location, parent.Body.GetPageName(), parent.Rules[0], parent.Rules[1], parent.Rules[2], parent.Rules[3], parent.Body.TimeLimit);
			var Depth	= "";
			for (Count = 0; Count < GetDepth(); Count++)	{Depth	= "../" + Depth;}
			var Ricerca	= parent.Body.showModalDialog(Depth + "Source/Pages/Ricerca.html", Parent, "center:1; dialogHeight:200px; dialogWidth:350px; status:0; scroll:0;");
			parent.Rules[0]	= Ricerca[0];
			parent.Rules[1]	= Ricerca[1];
			parent.Rules[2]	= Ricerca[2];

			window.open(Parent[0], "Body");
			top.Body.focus();
		}
		else
		{
			URL = parent.Body.GetPagePath() + URL;
			window.open(URL, Target);
		}
	}

// ------------------------------------------- GESTIONE TABELLE ---------------------------------------------------

//	- Preparazione del Database
	function PrepData()
	{
		Ord1	= 0;
		Ord2	= 1;
		Ord3	= 2;
		Tipo	= 3;
		NPrc	= 4;
		DVen	= 5;
		OVen	= 6;
		LoTi	= 7;
		Desc	= 8;
		Debi	= 9;
		Vend	= 10;
		PeIm	= 11;
		NNot	= 12;
		SVar	= 13;
		Path	= 14;
		DLng	= 15;
		VTag	= 16;
		TimeLimit	= 0;

		for (Count = 0; Count < P.length; Count++)
		{
		//	- Riempie e Prepara i Campi del Database
			FilFields(Count);
		//	- Controlla i Dati per la Stampa della Tabella
			Validate(Count);
		//	- Determina la Data della Vendita Più Futura
			if (P[Count][Ord1] > TimeLimit && P[Count][Ord1] != 99999999)
				{TimeLimit	= P[Count][Ord1];}
		}
	//	- Ordina il Database
		P.sort();
	}

//	- Riempie e Prepara i Campi del Database
	function FilFields(Count)
	{
	//	- Aggiunge i Campi Sorter all'Inizio dell'Array Pratica
		var Dummy	= new Array("", "", "", P[Count][0], P[Count][1], P[Count][2], P[Count][3], P[Count][4], P[Count][5], P[Count][6], P[Count][7], P[Count][8], P[Count][9], P[Count][10]);
		P[Count]	= Dummy;

	//	- Completa i Campi Non Obbligatori
		if (!P[Count][PeIm])	{P[Count][PeIm]	= "";}
		if (!P[Count][SVar])	{P[Count][SVar]	= "";}

	//	- Prepara il Sorter Data, la Data Vendita per la Tabella Main e la Data Vendita
		var Giorno	= new Array ("Domenica", "Luned&igrave;", "Marted&igrave;", "Mercoled&igrave;", "Gioved&igrave;", "Venerd&igrave;", "Sabato");
		var Mese	= new Array ("Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre");

		if (P[Count][DVen].indexOf("-") == "-1")
		{
			P[Count][Ord1]	= 99999999;
			P[Count][DVen]	= "Da&nbsp;definirsi";
			P[Count][DLng]	= "Da&nbsp;definirsi";
		}
		else
		{
			var DataSplit	= P[Count][DVen].split("-");
			P[Count][Ord1]	= 20000000 + (DataSplit[2] * 10000) + (DataSplit[1] * 100) + (DataSplit[0] * 1);

			var DataVendita = new Date ((2000 + (DataSplit[2]*1)), ((DataSplit[1]*1) - 1), (DataSplit[0]*1));

			P[Count][DVen]	= (DataSplit[0]*1) + "&nbsp;" + Mese[(DataSplit[1]*1)-1] + "&nbsp;" + (2000 + (DataSplit[2]*1));
			P[Count][DLng]	= Giorno[DataVendita.getDay()] + ",&nbsp;" + (DataSplit[0]*1) + "&nbsp;" + Mese[(DataSplit[1]*1)-1] + "&nbsp;" + (2000 + (DataSplit[2]*1));
		}

	//	- Prepara il Sorter N° Procedura e la Stringa di Percorso
		var Class	= GetPageName();
		Class	= "Prat" + Class.substring(4, 8) + "/";
		P[Count][Tipo]	= P[Count][Tipo].toUpperCase();

		if (P[Count][NPrc].indexOf("-") == "-1")
		{
			P[Count][Ord2]	= P[Count][Tipo] + P[Count][NPrc] + P[Count][SVar];
			P[Count][Path]	= Class + P[Count][Tipo] + P[Count][NPrc] + P[Count][SVar] + "/Ordinanz.html";
			P[Count][NPrc]	= P[Count][NPrc];
		}
		else
		{
			var NPrcSplit	= P[Count][NPrc].split("-");
			if (NPrcSplit[0].length == 1) {NPrcSplit[0]	= "0" + NPrcSplit[0];}
			for (Counter = 0; Counter < NPrcSplit[1].length; Counter++)
			{
				if (NPrcSplit[1].substr(0,1) == "0")	{NPrcSplit[1]	= NPrcSplit[1].substr(1)}
			}

			var NPSLong	= NPrcSplit[1];
			var NPSShor	= NPrcSplit[1];

			if (NPSLong.length == 1)	{NPSLong	= "000" + NPSLong;}
			else if (NPSLong.length == 2)	{NPSLong	= "00" + NPSLong;}
			else if (NPSLong.length == 3)	{NPSLong	= "0" + NPSLong;}

			if (NPSShor.length == 1)	{NPSShor	= "00" + NPSShor;}
			else if (NPSShor.length == 2)	{NPSShor	= "0" + NPSShor;}

			P[Count][Ord2]	= P[Count][Tipo] + NPrcSplit[0] + NPSLong + P[Count][SVar];
			P[Count][Path]	= Class + P[Count][Tipo] + NPrcSplit[0] + "-" + NPSShor + P[Count][SVar] + "/Ordinanz.html";
			P[Count][NPrc]	= NPrcSplit[1] + "/" + NPrcSplit[0];
		}

	//	- Prepara il Sorter Località/Tipologia
		P[Count][Ord3]	= P[Count][LoTi].toUpperCase();

	//	- Prepara il Campo Numeri Procedura
		if (!P[Count][NNot] || (P[Count][NNot] == ""))
			{P[Count][NNot]	= P[Count][NPrc];}
		else
			{P[Count][NNot]	= P[Count][NPrc] + "&nbsp;Trib.<BR>" + P[Count][NNot] + "&nbsp;Notai";}

	//	- Prepara il Campo Ora Vendita
		if (P[Count][OVen] != "")
			{P[Count][OVen]	= ", ore " + P[Count][OVen];}
	}

// 	- Resetta le Variabili di Ricerca
	function RulesReset(ThisPage)
	{
		if (ThisPage != parent.Prev)
		{
			parent.Rules[0]	= "";
			parent.Rules[1]	= parent.Today;
			parent.Rules[2]	= 21001231;
		}
		parent.Prev	= ThisPage;
	}

//	- Controlla i Dati per la Stampa della Tabella
	function Validate(Count)
	{
	//	- Controlla l'Esistenza della Pratica (Campo Tipo Valido)
		if (P[Count][Tipo] == "C" || P[Count][Tipo] == "E" || P[Count][Tipo] == "F")
		{
		//	- Controlla che la Data Vendita sia Compresa nel Periodo Selezionato
			if ((P[Count][Ord1] >= parent.Rules[1] && P[Count][Ord1] <= parent.Rules[2]) || P[Count][DVen] == "Da&nbsp;definirsi")
			{
			//	- Controlla Località/Tipologia
				var SI	= P[Count][Ord3];
				var SF	= parent.Rules[0].toUpperCase();

				if ((SI.indexOf(SF) != "-1") || (SF == ""))
				{
					P[Count][VTag]	= "Valid";
				}
			}
		}
	}

//	- Stampa l'Intestazione della Tabella
	function PrintTableHead()
	{
		document.writeln("<H4 CLASS='B_HEA2'><FONT COLOR='#008000'>IN VERDE SONO INDICATI I FALLIMENTI</FONT><BR><FONT COLOR='#FF0000'>IN ROSSO SONO INDICATE LE ESECUZIONI</FONT><BR><FONT COLOR='#000080'>IN BLU SONO INDICATE ALTRE TIPOLOGIE</FONT></H4>");
		document.writeln("<P CLASS='TLOC'><TABLE ALIGN='center' BORDER='1' CELLPADDING='5' CELLSPACING='0'><TR>");
		document.writeln("<TH>Tipo</TH>");
		document.writeln("<TH>Data Vendita</TH>");
		document.writeln("<TH>Numeri Procedura</TH>");

		var Page	= GetPageName();
		var Field	= "";
		switch (Page)
		{
			case "VendImmo":
				Field	= "<TH>Localit&agrave;</TH>";
				break;
			case "VendMobi":
			case "VendAltr":
				Field	= "<TH>Tipologia</TH>";
				break;
			case "VendAzie":
				Field	= "<TH>Denominazione</TH>";
				break;
		}
		document.writeln(Field);

		document.writeln("<TH>Descrizione Sommaria</TH>");
		document.writeln("</TR>");
	}

//	- Stampa il Messaggio di Archivio Vuoto
	function PrintVoidArchive()
	{
		document.writeln("<TABLE ALIGN='center' BORDER='0' CELLPADDING='5' CELLSPACING='0' HEIGHT='100%'><TR><TD VALIGN='middle'><H4 CLASS='B_HEAD'>L'archivio non contiene vendite per questo periodo</H4></TD></TR></TABLE>");
	}

// Stampa della Tabella
	function StampaTabella(Pratica, Count)
	{
		document.writeln("<TR><TD CLASS='LIST_C'>" + Pratica[Tipo] + "</TD><TD CLASS='LIST_C'>" + Pratica[DVen] + "</TD><TD CLASS='LIST_C'>" + Pratica[NNot] + "</TD><TD CLASS='LIST'><A CLASS='LIST_" + Pratica[Tipo] + "' HREF='JavaScript:Recupera(" + Count + ");' TARGET='Body'>", Pratica[LoTi], "</A></TD><TD CLASS='LIST'>", Pratica[Desc], "</TR>");
	}

//	- Recupera la Cartella cercata
	function Recupera(Questa)
	{
		parent.Procedura	= P[Questa];
		window.open(P[Questa][Path], "Body");
		parent.Body.focus();
	}

// ------------------------------------------- GESTIONE BIGLIETTI DA VISITA ---------------------------------------

//	- Costruzione Pagina Albo effetto Biglietto da Visita
	function BuildAlbo()
	{
		//	- Stampa Intestazione
			document.writeln("<H4 CLASS='B_HEAD'>ALBO DEI C.T.U.</H4><H4 CLASS='B_HEA2'>" + Title + "</H4>");

		//	- Apertura Tabella Contenitore
			document.writeln("<TABLE ALIGN='center' BORDER='2' CELLPADDING='0' CELLSPACING='5' BORDERCOLOR='#FFFFFF' WIDTH='600'>");

		//	- Stampa Tabella
		var CellTD	= "<TD BORDERCOLORDARK='#CCCCCC' BORDERCOLORLIGHT='#555555' WIDTH='50%' VALIGN='top'>";
		var InTable	= "<TABLE BORDER='0' CELLPADDING='0' CELLSPACING='5' BORDERCOLOR='#FFFFFF' WIDTH='100%'>";

		//	- Stampa Ultima Riga a Seconda se n° Biglietti Pari o Dispari
		if ((Biglietto.length/2)!=(parseInt(Biglietto.length/2)))
		{
				Biglietto[Biglietto.length]	= new Array (	"",	"",	"",	"",	"",	"",	"",	"",	"",	"");
		}

		for (Count = 0; Count < Biglietto.length; Count = Count + 2)
		{
			document.writeln("<TR>" + CellTD + InTable + "<TR><TD WIDTH='50%'><P CLASS='SLCTU'>Codice CTU:&nbsp;" + Biglietto[Count][0] + "<BR>N°&nbsp;" + Biglietto[Count][1] + "<BR>Data Iscrizione&nbsp;" + Biglietto[Count][2] + "</TD><TD WIDTH='50%'><P CLASS='SRCTU'><A HREF='mailto:" + Biglietto[Count][9] + "'>" + Biglietto[Count][9] + "</A></TD></TR><TR><TD COLSPAN='2'><P CLASS='L_CTU'><B>" + Biglietto[Count][3] + "</B><BR>" + Biglietto[Count][5] + "</P></TD></TR><TR><TD WIDTH='50%'><P CLASS='SLCTU'>" + Biglietto[Count][6] + "</TD><TD WIDTH='50%'><P CLASS='SRCTU'>" + Biglietto[Count][7] + "<BR>" + Biglietto[Count][8] + "</TD></TR></TABLE></TD>");
			document.writeln(CellTD + InTable + "<TR><TD WIDTH='50%'><P CLASS='SLCTU'>Codice CTU:&nbsp;" + Biglietto[Count+1][0] + "<BR>N°&nbsp;" + Biglietto[Count+1][1] + "<BR>Data Iscrizione&nbsp;" + Biglietto[Count+1][2] + "</TD><TD WIDTH='50%'><P CLASS='SRCTU'><A HREF='mailto:" + Biglietto[Count+1][9] + "'>" + Biglietto[Count+1][9] + "</A></TD></TR><TR><TD COLSPAN='2'><P CLASS='L_CTU'><B>" + Biglietto[Count+1][3] + "</B><BR>" + Biglietto[Count+1][5] + "</P></TD></TR><TR><TD WIDTH='50%'><P CLASS='SLCTU'>" + Biglietto[Count+1][6] + "</TD><TD WIDTH='50%'><P CLASS='SRCTU'>" + Biglietto[Count+1][7] + "<BR>" + Biglietto[Count+1][8] + "</TD></TR></TABLE></TD>");
		}
		document.writeln("</TR></TABLE>");
	}


	function CHP ()
	{
		var PWD = prompt("Inserire la Password", "");
		if (PWD == "AdiuvaNO") {window.open("../Curatori/Main.html", "Body")}
	}