var srvGallerie = "/Pages/Gallerie/gallerie.asp";
var srvArtisti = "/Pages/Artisti/artisti.asp";
var srvServizi = "/Pages/Servizi/servizi.asp";
var srvEventi = "/Pages/Eventi/eventi.asp";

//***********************************************************************************
function ShowArtistaDatiGen(ID) {
var co;
var ss;
var sRow;
var sRef;
	status = "Ricerca in corso...";
	co = RSExecute(srvArtisti,"cerca",ID, Tipo);
	ss=co.return_value.split(";");
	if (ss[0] != "") {
		if (Tipo != 4) {
			sRow = "<table border=0 width=" + (wData-2*mgwData) + " height=" + (hData-2*mgwData) + " align='center' cellpadding='0' cellspacing='0'>" +
				"<tr valign='bottom'><td><IMG SRC='/Images/Cornice/altosx.gif'></td><td><IMG SRC='/Images/Cornice/alto.gif' height=15 width='" + (wData-2*mgwData-30) + "'></td><td><IMG SRC='/Images/Cornice/altodx.gif'></td></tr>" +
				"<tr valign='top'><td align=left><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td>" +
				"<td align='center' background='/Images/Cornice/sfondo.gif'>" +
				"<p class='headerpopup'>" + ss[1] + "</p>";
			sRow = sRow + "<p class='headerpopup2'>Dati Generali</p>";
			sRow = sRow + "<p class='vocepopup'>"
			if (ss[2] != "") 	{sRow = sRow + "" + ss[2] + "<br>";} 
			if (ss[3] != "") 	{sRow = sRow + "Nazionalita' : " + ss[3] + "<br><br>";} 
			sRow = sRow + "Mercato : "; 
			switch (parseInt(ss[4])) {
			case 1: {sRow = sRow + "Regionale"; break;}
			case 2: {sRow = sRow + "Interreggionale"; break;}
			case 3: {sRow = sRow + "Nazionale"; break;}
			case 4: {sRow = sRow + "Internazionale"; break;}
			} 
			sRow = sRow + "<br>"; 
			sRow = sRow + "Prezzo di Riferimento (50x70): "; 
			switch (parseInt(ss[5])) {
			case 1: {sRow = sRow + "Inferiore a 2500 Euro"; break;}
			case 2: {sRow = sRow + "Da 2500 a 5000 Euro"; break;}
			case 3: {sRow = sRow + "Da 5000 a 10000 Euro"; break;}
			case 4: {sRow = sRow + "Da 10000 a 20000 Euro"; break;}
			case 5: {sRow = sRow + "Oltre i 20000 Euro"; break;}
			} 
			sRef = escape(location.pathname + location.search + "&Page=" + CurrentPage);
			sRow = sRow + "</p>"; 
			sRow = sRow + "<p class='linkpopup'><a href='/Pages/Opere/VisOpere.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1]) + "&Back=" +  sRef + "'><font color='#ff8346'>Opere disponibili</a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaBiografia(" + ss[0] + ");'><font color='#ff8346'>Biografia</font></a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaFoto(" + ss[0] + ");'><font color='#ff8346'>Foto</a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaAut(" + ss[0] + ");'><font color='#ff8346'>Autentica delle Opere disponibili</a><br>";
			sRow = sRow + "<a href='/Pages/Gallerie/VisGallerieSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1]) + "&Back=" +  sRef + "'><font color='#ff8346'>Gallerie che trattano l'artista</a><br>";
			sRow = sRow + "<a href='/Pages/Aste/VisRisultatiSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1]) + "&Back=" +  sRef + "'><font color='#ff8346'>Risultati d'asta</a></p>";
		} else {
			sRow = "<table border=0 width=" + (wData-2*mgwData) + " height=" + (hData-2*mgwData) + " align='center' cellpadding='0' cellspacing='0'>" +
				"<tr valign='bottom'><td><IMG SRC='/Images/Cornice/altosx.gif'></td><td><IMG SRC='/Images/Cornice/alto.gif' height=15 width='" + (wData-2*mgwData-30) + "'></td><td><IMG SRC='/Images/Cornice/altodx.gif'></td></tr>" +
				"<tr valign='top'><td align=left><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td>" +
				"<td align='center' background='/Images/Cornice/sfondo.gif'>" +
				"<p class='headerpopup'>" + ss[1] + " " + ss[2] + "</p>";
			sRow = sRow + "<p class='headerpopup2'>Dati Generali</p>";
			sRow = sRow + "<p class='vocepopup'>"
			if (ss[3] != "") 	{sRow = sRow + "Indirizzo : " + ss[3] + "<br>";} 
			if (ss[5] != ss[6]) {
				sRow = sRow + ss[4] + " " + ss[5] + " (" + ss[6]  + ")";
			} else {
				sRow = sRow + ss[4] + " " + ss[5];
			}
			sRow = sRow + "</p>"
			sRow = sRow + "<p class='vocepopup'>"
			if (ss[7] != "") 	{sRow = sRow + "Telefono : " + ss[7] + "<br>";} 
			if (ss[8] != "") 	{sRow = sRow + "Fax : " + ss[8];} 
			sRow = sRow + "</p>"
			sRow = sRow + "<p class='vocepopup'>"
			if (ss[9] != "") 	{sRow = sRow + "EMail : <a href='mailto:" + ss[9] + "'>" + ss[9] + "</a><br>";} 
			if (ss[10] != "") 	{sRow = sRow + "Web : <a href='javascript:apri(\"" + ss[10] + "\");'>" + ss[10] + "</a>";} 
			sRow = sRow + "</p>"
			sRef = escape(location.pathname + location.search + "&Page=" + CurrentPage);
			sRow = sRow + "<p class='linkpopup'><a href='javascript:ShowArtistaBiografia(" + ss[0] + ");'><font color='#ff8346'>Biografia</font></a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaFoto(" + ss[0] + ");'><font color='#ff8346'>Foto</a><br>";
			sRow = sRow + "<a href='/Pages/Mostre/VisPubblicheSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1] + " " + ss[2]) + "&Back=" + sRef + "');'><font color='#ff8346'>Mostre dell'artista</font></a></p>";
		}
		sRow = sRow + "<p><a href='javascript:nascondi();' class='chiudipopup'>Chiudi</a></p>";
		sRow = sRow + "</td><td align='right'><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td></tr></table>"
		ChangeText (sData,sRow,wData,hData,bgcData,mgwData);
		ShowLayer (sData,true);
		status="Ok!";
	} else {
		status="Error in remote scripting call!!!!";
		alert("Errore in remote scripting call " + ss[1]);
	}
}

//***********************************************************************************
function ShowArtistaFoto(ID) {
var co;
var ss;
var sRow;
var iLen;
var sNome;
var sPerm;
var sRef;
	status = "Ricerca in corso...";
	co = RSExecute(srvArtisti,"cercanome",ID, Tipo);
	ss=co.return_value.split(";");
	if (ss[0] != "") {
		sNome = ss[1];
		co = RSExecute(srvArtisti,"cercafoto",ID, Tipo);
		ss = co.return_value.split(";");
		sRow = "<table border=0 width=" + (wData-2*mgwData) + " height=" + (hData-2*mgwData) + " align='center' cellpadding='0' cellspacing='0'>" +
			"<tr valign='bottom'><td><IMG SRC='/Images/Cornice/altosx.gif'></td><td><IMG SRC='/Images/Cornice/alto.gif' height=15 width='" + (wData-2*mgwData-30) + "'></td><td><IMG SRC='/Images/Cornice/altodx.gif'></td></tr>" +
			"<tr valign='top'><td align=left><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td>" +
			"<td align='center' background='/Images/Cornice/sfondo.gif'>" +
			"<p class='headerpopup'>" + sNome + "</p>";
		sRow = sRow + "<p class='headerpopup2'>Foto</p>";
		if (Tipo != 4) {
			if (ss[1] != "") 	{
				sRow = sRow + "<p class='vocepopup'>Foto dell'artista</p>";
				sRow = sRow + "<img src=\"" + ss[1] + "\">";
			} else {
				sRow = sRow + "<p class='vocepopup'>Nessuna foto dell'artista</p>";
			}
/*			if (ss[2] != "") 	{
				sRow = sRow + "<p class='vocepopup'>Foto di un'opera dell'artista</p>";
				sRow = sRow + "<img src=\"" + ss[2] + "\">";
			} else {
				sRow = sRow + "<p class='vocepopup'>Nessuna foto di un'opera dell'artista</p>";
			}
*/			sRef = escape(location.pathname + location.search + "&Page=" + CurrentPage);
			sRow = sRow + "<p class='linkpopup'><a href='/Pages/Opere/VisOpere.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1]) + "&Back=" +  sRef + "'><font color='#ff8346'>Opere disponibili</a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaDatiGen(" + ss[0] + ");'><font color='#ff8346'>Dati Generali</font></a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaBiografia(" + ss[0] + ");'><font color='#ff8346'>Biografia</font></a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaAut(" + ss[0] + ");'><font color='#ff8346'>Autentica delle Opere disponibili</a><br>";
			sRow = sRow + "<a href='/Pages/Gallerie/VisGallerieSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(sNome) + "&Back=" +  sRef + "'><font color='#ff8346'>Gallerie che trattano l'artista</a><br>";
			sRow = sRow + "<a href='/Pages/Aste/VisRisultatiSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1]) + "&Back=" +  sRef + "'><font color='#ff8346'>Risultati d'asta</a></p>";
		} else {
			if (ss[1] != "") 	{
				if (ss[2] != "") 	{
					sRow = sRow + "<p class='headerpopup2'>" + ss[2] + "</p>";
				} else {
					sRow = sRow + "<p class='headerpopup2'>Foto di un'opera</p>";
				}
				sRow = sRow + "<p align=center><img src=\"" + ss[1] + "\"></p>";
				if (ss[3] != "") {sRow = sRow + "<p class='vocepopup'>" + ss[3] + "</p>";}
			} else {
				sRow = sRow + "<p class='vocepopup'>Nessuna foto!</p>";
			}
			sRow = sRow + "<p class='linkpopup'><a href='javascript:ShowArtistaDatiGen(" + ss[0] + ");'><font color='#ff8346'>Dati Generali</font></a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaBiografia(" + ss[0] + ");'><font color='#ff8346'>Biografia</font></a><br>";
			sRow = sRow + "<a href='/Pages/Mostre/VisPubblicheSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(sNome) + "&Back=" + sRef + "');'><font color='#ff8346'>Mostre dell'artista</font></a></p>";
		}	
		sRow = sRow + "<p><a href='javascript:nascondi()' class='chiudipopup'>Chiudi</a></p>";
		sRow = sRow + "</td><td align='right'><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td></tr></table>"

		ChangeText (sData,sRow,wData,hData,bgcData,mgwData);
		ShowLayer (sData,true);
		status="Ok!";
	} else {
			alert("Errore in remote scripting call " + ss[1]);
			status="Error in remote scripting call!!!!";
	}
}

//***********************************************************************************
function ShowArtistaBiografia(ID) {
var co;
var ss;
var sRow;
var iLen;
var sNome;
var sPerm;
var sRef;
	status = "Ricerca in corso...";
	co = RSExecute(srvArtisti,"cercanome",ID, Tipo);
	ss=co.return_value.split(";");
	if (ss[0] != "") {
		sNome = ss[1];
		co = RSExecute(srvArtisti,"cercabiografia",ID ,Tipo);
		ss = co.return_value.split(";");
		if (ss[0] != "") {
				sRow = "<table border=0 width=" + (wData-2*mgwData) + " height=" + (hData-2*mgwData) + " align='center' cellpadding='0' cellspacing='0'>" +
					"<tr valign='bottom'><td><IMG SRC='/Images/Cornice/altosx.gif'></td><td><IMG SRC='/Images/Cornice/alto.gif' height=15 width='" + (wData-2*mgwData-30) + "'></td><td><IMG SRC='/Images/Cornice/altodx.gif'></td></tr>" +
					"<tr valign='top'><td align=left><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td>" +
					"<td align='center' background='/Images/Cornice/sfondo.gif'>" +
					"<p class='headerpopup'>" + sNome + "</p>";
				sRow = sRow + "<p class='headerpopup2'>Biografia</p>";
				if (Tipo != 4) {
					if (ss[1] != "") 	{
						sRow = sRow + "<p class='vocepopup'>" + ss[1] + "</p>";
					} else {
						sRow = sRow + "<p class='vocepopup'>Nessuna biografia dell'artista</p>";
					}
					sRef = escape(location.pathname + location.search + "&Page=" + CurrentPage);
					sRow = sRow + "<p class='linkpopup'><a href='/Pages/Opere/VisOpere.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1]) + "&Back=" +  sRef + "'><font color='#ff8346'>Opere disponibili</a><br>";
					sRow = sRow + "<a href='javascript:ShowArtistaDatiGen(" + ss[0] + ");'><font color='#ff8346'>Dati Generali</font></a><br>";
					sRow = sRow + "<a href='javascript:ShowArtistaFoto(" + ss[0] + ");'><font color='#ff8346'>Foto</font></a><br>";
					sRow = sRow + "<a href='javascript:ShowArtistaAut(" + ss[0] + ");'><font color='#ff8346'>Autentica delle Opere disponibili</a><br>";
					sRow = sRow + "<a href='/Pages/Gallerie/VisGallerieSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(sNome) + "&Back=" +  sRef + "'><font color='#ff8346'>Gallerie che trattano l'artista</a><br>";
					sRow = sRow + "<a href='/Pages/Aste/VisRisultatiSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1]) + "&Back=" +  sRef + "'><font color='#ff8346'>Risultati d'asta</a></p>";
				} else { 
					if (ss[3] != "") 	{
						sRow = sRow + "<p class='vocepopup'>" + ss[3] + "</p>";
					} else {
						sRow = sRow + "<p class='vocepopup'>Nessuna biografia dell'artista</p>";
					}
					sRef = escape(location.pathname + location.search + "&Page=" + CurrentPage);
					sRow = sRow + "<p class='linkpopup'><a href='javascript:ShowArtistaDatiGen(" + ss[0] + ");'><font color='#ff8346'>Dati Generali</font></a><br>";
					sRow = sRow + "<a href='javascript:ShowArtistaFoto(" + ss[0] + ");'><font color='#ff8346'>Foto</a><br>";
					sRow = sRow + "<a href='/Pages/Mostre/VisPubblicheSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1] + " " + ss[2]) + "&Back=" + sRef + "');'><font color='#ff8346'>Mostre dell'artista</font></a></p>";
				}
				sRow = sRow + "<p><a href='javascript:nascondi()' class='chiudipopup'>Chiudi</a></p>";
				sRow = sRow + "</td><td align='right'><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td></tr></table>"
				ChangeText (sData,sRow,wData,hData,bgcData,mgwData);
				ShowLayer (sData,true);
				status="Ok!";
		} else {
			alert("Errore in remote scripting call " + ss[1]);
			status="Error in remote scripting call!!!!";
		}
	} else {
			alert("Errore in remote scripting call " + ss[1]);
			status="Error in remote scripting call!!!!";
	}
}

//***********************************************************************************
function ShowArtistaAut(ID) {
var co;
var ss;
var sNome;
var sRow;
var sRef;
var	iLen;
	status = "Ricerca in corso...";
	co = RSExecute(srvArtisti,"cercanome",ID, Tipo);
	ss=co.return_value.split(";");
	if (ss[0] != "") {

		sNome = ss[1];
		co = RSExecute(srvServizi, "cercaartista", ID);
		ss=co.return_value.split(";");
		iLen = ss.length - 1; 
		if (ss[0] != "") {
			sRow = "<table border=0 width=" + (wData-2*mgwData) + " height=" + (hData-2*mgwData) + " align='center' cellpadding='0' cellspacing='0'>" +
				"<tr valign='bottom'><td><IMG SRC='/Images/Cornice/altosx.gif'></td><td><IMG SRC='/Images/Cornice/alto.gif' height=15 width='" + (wData-2*mgwData-30) + "'></td><td><IMG SRC='/Images/Cornice/altodx.gif'></td></tr>" +
				"<tr valign='top'><td align=left><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td>" +
				"<td align='center' background='/Images/Cornice/sfondo.gif'>" +
				"<p class='headerpopup'>" + sNome + "</p>";
			if (iLen > 1) {
				sRow = sRow + "<p class='headerpopup2'>Ente 1</p>";
			 	sRow = sRow + "<p class='vocepopup'>" + ss[2] + "</p>";
				if (ss[3] != "") 	{sRow = sRow + "<p class='vocepopup'>EMail : <a href='mailto:" + ss[3] + "'>" + ss[3] + "</a></p>";} 
				if (ss[4] != "") 	{sRow = sRow + "<p class='vocepopup'>" + ss[4] + "</p>";} 
//				if (ss[5] != "") 	{sRow = sRow + "<p class='linkpopup'><a href='javascript:ShowArtistaDatiAut2(" + ss[0] + ");'><font color='#ff8346'>Ente 2</font></a></p>";}
			} else {
			 	sRow = sRow + "<p class='vocepopup'>Nessuna autentica disponibile</p>";		
			}

			sRef = escape(location.pathname + location.search + "&Page=" + CurrentPage);
			sRow = sRow + "</p>"; 
			sRow = sRow + "<p class='linkpopup'><a href='/Pages/Opere/VisOpere.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1]) + "&Back=" +  sRef + "'><font color='#ff8346'>Opere disponibili</a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaDatiGen(" + ss[0] + ");'><font color='#ff8346'>Dati Generali</font></a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaBiografia(" + ss[0] + ");'><font color='#ff8346'>Biografia</font></a><br>";
			sRow = sRow + "<a href='javascript:ShowArtistaFoto(" + ss[0] + ");'><font color='#ff8346'>Foto</a><br>";
			sRow = sRow + "<a href='/Pages/Gallerie/VisGallerieSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(sNome) + "&Back=" +  sRef + "'><font color='#ff8346'>Gallerie che trattano l'artista</a><br>";
			sRow = sRow + "<a href='/Pages/Aste/VisRisultatiSearch.asp?IDArt=" + ss[0] + "&sArt=" + escape(ss[1]) + "&Back=" +  sRef + "'><font color='#ff8346'>Risultati d'asta</a></p>";
			sRow = sRow + "<p><a href='javascript:nascondi();' class='chiudipopup'>Chiudi</a></p>";
			sRow = sRow + "</td><td align='right'><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td></tr></table>"
			ChangeText (sData,sRow,wData,hData,bgcData,mgwData);
			ShowLayer (sData,true);
			status="Ok!";
		} else {
			status="Error in remote scripting call!!!!";
			alert("Errore in remote scripting call " + ss[1]);
		}
	} else {
			alert("Errore in remote scripting call " + ss[1]);
			status="Error in remote scripting call!!!!";
	}
}

//***********************************************************************************
function ShowGalleriaDatiGen(ID) {
var co;
var ss;
var sRow;
var sRef;
	status = "Ricerca in corso...";
	co = RSExecute(srvGallerie,"cerca",ID);
	ss=co.return_value.split(";");
	if (ss[0] != "") {
		sRow = "<table border=0 width=" + (wData-2*mgwData) + " height=" + (hData-2*mgwData) + " align='center' cellpadding='0' cellspacing='0'>" +
			"<tr valign='bottom'><td><IMG SRC='/Images/Cornice/altosx.gif'></td><td><IMG SRC='/Images/Cornice/alto.gif' height=15 width='" + (wData-2*mgwData-30) + "'></td><td><IMG SRC='/Images/Cornice/altodx.gif'></td></tr>" +
			"<tr valign='top'><td align=left><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td>" +
			"<td align='center' background='/Images/Cornice/sfondo.gif'>" +
			"<p class='headerpopup'>" + ss[1] + "</p>";
		if (Tipo != 3) {
			sRow = sRow + "<p class='vocepopup'>" + ss[2] + "<br>";
			if (ss[3] != ss[16]) {
				sRow = sRow + ss[5] + " " + ss[3] + " (" + ss[16]  + ")";
			} else {
				sRow = sRow + ss[5] + " " + ss[3];
			}
			sRow = sRow + "</p>";
		}
		sRow = sRow + "<p class='vocepopup'>";
		if (ss[6] != "") 	{sRow = sRow + "Telefono : " + ss[6] + "<br>";} 
		if (ss[7] != "") 	{sRow = sRow + "Fax : " + ss[7] + "<br>";} 
		if (ss[8] != "") 	{sRow = sRow + "EMail : <a href='mailto:" + ss[8] + "'>" + ss[8] + "</a><br>";} 
		if (ss[9] != "") 	{sRow = sRow + "Web : <a href='javascript:apri(\"" + ss[9] + "\");'>" + ss[9] + "</a><br>";} 
		sRow = sRow + "</p>";
		if (ss[12] != "") 	{sRow = sRow + "<p class='vocepopup'>Orario : " + ss[12] + "</p>";} 
		sRef = escape(location.pathname + location.search + "&Page=" + CurrentPage);
		sRow = sRow + "<p class='linkpopup'><a href='/Pages/Opere/VisOpere.asp?IDGal=" + ss[0] + "&sGal=" + escape(ss[1]) + "&Back=" + sRef + "');'><font color='#ff8346'>Opere disponibili</font></a><br>";
		if (IDProv != 0) {
			sRow = sRow + "<a href='/Pages/Artisti/VisArtistiSearch.asp?IDGal=" + ss[0] + "&sGal=" + escape(ss[1]) + "&Back=" + sRef + "');'><font color='#ff8346'>Artisti della Galleria</font></a><br>";
		} else {
			sRow = sRow + "<a href='/Pages/Artisti/VisArtistiSearch.asp?IDGal=" + ss[0] + "&sGal=" + escape(ss[1]) + "&Back=" + sRef + "');'><font color='#ff8346'>Artisti della Galleria</font></a><br>";
		}
		sRow = sRow + "<a href='/Pages/Mostre/VisPrivateSearch.asp?IDGal=" + ss[0] + "&sGal=" + escape(ss[1]) + "&Back=" + sRef + "');'><font color='#ff8346'>Mostre della Galleria</font></a></p>";
		sRow = sRow + "<p class='chiudipopup'><a href='javascript:nascondi();' class='chiudipopup'>Chiudi</a></p>";
		sRow = sRow + "</td><td align='right'><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td></tr></table>"
		ChangeText (sData,sRow,wData,hData,bgcData,mgwData);
		ShowLayer (sData,true);
		status="Ok!";
	} else {
		status="Error in remote scripting call!!!!";
		alert("Errore in remote scripting call " + ss[1]);
	}
}

//***********************************************************************************
function ShowAutenticheDatiGen(ID) {
var co;
var ss;
var sRow;
	status = "Ricerca in corso...";
	co = RSExecute(srvServizi,"cerca",ID);
	ss=co.return_value.split(";");
	if (ss[0] != "") {
		sRow = "<table border=0 width=" + (wData-2*mgwData) + " height=" + (hData-2*mgwData) + " align='center' cellpadding='0' cellspacing='0'>" +
			"<tr valign='bottom'><td><IMG SRC='/Images/Cornice/altosx.gif'></td><td><IMG SRC='/Images/Cornice/alto.gif' height=15 width='" + (wData-2*mgwData-30) + "'></td><td><IMG SRC='/Images/Cornice/altodx.gif'></td></tr>" +
			"<tr valign='top'><td align=left><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td>" +
			"<td align='center' background='/Images/Cornice/sfondo.gif'>" +
			"<p class='headerpopup'>" + ss[1] + "</p>";
		sRow = sRow + "<p class='headerpopup2'>Ente 1</p>";
		if (ss[2] != "") 	{sRow = sRow + "<p class='vocepopup'>" + ss[2] + "</p>";} 
		if (ss[3] != "") 	{sRow = sRow + "<p class='vocepopup'>EMail : <a href='mailto:" + ss[3] + "'>" + ss[3] + "</a></p>";} 
		if (ss[4] != "") 	{sRow = sRow + "<p class='vocepopup'>" + ss[4] + "</p>";} 
		if (ss[5] != "") 	{sRow = sRow + "<p class='linkpopup'><a href='javascript:ShowAutenticheDatiGen2(" + ss[0] + ");'><font color='#ff8346'>Ente 2</font></a></p>";}

		sRow = sRow + "<p><a href='javascript:nascondi();' class='chiudipopup'>Chiudi</a></p>";
		sRow = sRow + "</td><td align='right'><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td></tr></table>"
		ChangeText (sData,sRow,wData,hData,bgcData,mgwData);
		ShowLayer (sData,true);
		status="Ok!";
	} else {
		status="Error in remote scripting call!!!!";
		alert("Errore in remote scripting call " + ss[1]);
	}
}

//***********************************************************************************
function ShowAutenticheDatiGen2(ID) {
var co;
var ss;
var sRow;
	status = "Ricerca in corso...";
	co = RSExecute(srvServizi,"cerca2",ID);
	ss=co.return_value.split(";");
	if (ss[0] != "") {
		sRow = "<table border=0 width=" + (wData-2*mgwData) + " height=" + (hData-2*mgwData) + " align='center' cellpadding='0' cellspacing='0'>" +
			"<tr valign='bottom'><td><IMG SRC='/Images/Cornice/altosx.gif'></td><td><IMG SRC='/Images/Cornice/alto.gif' height=15 width='" + (wData-2*mgwData-30) + "'></td><td><IMG SRC='/Images/Cornice/altodx.gif'></td></tr>" +
			"<tr valign='top'><td align=left><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td>" +
			"<td align='center' background='/Images/Cornice/sfondo.gif'>" +
			"<p class='headerpopup'>" + ss[1] + "</p>";
		sRow = sRow + "<p class='headerpopup2'>Ente 2</p>";
		if (ss[2] != "") 	{sRow = sRow + "<p class='vocepopup'>" + ss[2] + "</p>";} 
		if (ss[3] != "") 	{sRow = sRow + "<p class='vocepopup'>EMail : <a href='mailto:" + ss[3] + "'>" + ss[3] + "</a></p>";} 
		if (ss[4] != "") 	{sRow = sRow + "<p class='vocepopup'>" + ss[4] + "</p>";} 
		if (ss[5] != "") 	{sRow = sRow + "<p class='linkpopup'><a href='javascript:ShowAutenticheDatiGen(" + ss[0] + ");'><font color='#ff8346'>Ente 1</font></a></p>";}

		sRow = sRow + "<p><a href='javascript:nascondi();' class='chiudipopup'>Chiudi</a></p>";
		sRow = sRow + "</td><td align='right'><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td></tr></table>"
		ChangeText (sData,sRow,wData,hData,bgcData,mgwData);
		ShowLayer (sData,true);
		status="Ok!";
	} else {
		status="Error in remote scripting call!!!!";
		alert("Errore in remote scripting call " + ss[1]);
	}
}

//***********************************************************************************
function ShowEvento(ID) {
var co;
var ss;
var sRow;
var sRef;
	status = "Ricerca in corso...";
	co = RSExecute(srvEventi,"cerca",ID);
	ss=co.return_value.split(";");
	if (ss[0] != "") {
		sRow = "<table border=0 width=" + (wData-2*mgwData) + " height=" + (hData-2*mgwData) + " align='center' cellpadding='0' cellspacing='0'>" +
			"<tr valign='bottom'><td><IMG SRC='/Images/Cornice/altosx.gif'></td><td><IMG SRC='/Images/Cornice/alto.gif' height=15 width='" + (wData-2*mgwData-30) + "'></td><td><IMG SRC='/Images/Cornice/altodx.gif'></td></tr>" +
			"<tr valign='top'><td align=left><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td>" +
			"<td align='center' background='/Images/Cornice/sfondo.gif'>" +
			"<p class='headerpopup'>" + ss[1] + "</p>";
		if (ss[2] != "") 	{sRow = sRow + "<p class='vocepopup'>Data : <b>" + ss[2] + "</b></p>";} 

		if (ss[3] != "") 	{sRow = sRow + "<p class='vocepopup'>" + ss[3] + "</p>";} 

		if (ss[4] != "") 	{sRow = sRow + "<p class='vocepopup'><img src='" + ss[4] + "'></p>";} 
		sRow = sRow + "<p class='vocepopup'>";
		if (ss[5] != "") 	{sRow = sRow + "Info : " + ss[5] + "<br>";} 
		if (ss[6] != "") 	{sRow = sRow + "EMail : <a href='mailto:" + ss[6] + "'>" + ss[6] + "</a><br>";} 
		if (ss[7] != "") 	{sRow = sRow + "Web : <a href='javascript:apri(\"" + ss[7] + "\");'>" + ss[7] + "</a><br>";} 
		sRow = sRow + "</p>";
		sRow = sRow + "<p class='chiudipopup'><a href='javascript:nascondi();' class='chiudipopup'>Chiudi</a></p>";
		sRow = sRow + "</td><td align='right'><IMG SRC='/Images/Cornice/lato.gif' width='2' height=" + (hData-2*mgwData-30) + "></td></tr></table>"
		ChangeText (sData,sRow,wData,hData,bgcData,mgwData);
		ShowLayer (sData,true);
		status="Ok!";
	} else {
		status="Error in remote scripting call!!!!";
		alert("Errore in remote scripting call " + ss[1]);
	}
}

//***********************************************************************************
function nascondi() {
	ShowLayer(sData, false);
}