function leggiTestoCritici(nomeFile, nomeCritico, lingua) {
	document.getElementById('cursoreId').src = 'risorse/cursore_v.gif';
	document.getElementById('nomeCritico').innerHTML = nomeCritico;
	new Ajax.Updater('criticiId', 'ajax/TestoCritico.php?testo=' + nomeFile
			+ '&lang=' + lingua, {
		metod : 'get'
	});
}


function cambiaFoto(nomeFoto, titoloFoto, lingua) {

	/*
	 * document.getElementById('image').src = './risorse/documenti/fotografie/' +
	 * nomeFoto + '/' + nomeFoto + '.jpg';
	 */
	
	
	document.getElementById('image').src = 'ajax/ThumbFoto.php?n=' + nomeFoto + "&p=fotografie";

	document.getElementById('linkFoto').href = './risorse/documenti/fotografie/'
			+ nomeFoto + '/' + nomeFoto + '.jpg';

	document.getElementById('linkFoto').rel = 'lightbox[foto]';
	document.getElementById('titoloFoto').innerHTML = titoloFoto;
	new Ajax.Updater('testoFoto', 'ajax/TestoFoto.php?testo=' + nomeFoto
			+ '&lang=' + lingua, {
		metod : 'get'
	});

	new Ajax.Updater('descrizioneFoto', 'ajax/DescrizioneFoto.php?testo='
			+ nomeFoto + '&lang=' + lingua, {
		metod : 'get'
	});

	new Ajax.Updater('elencoLinkFoto',
			'ajax/ElencoLinkFoto.php?foto=' + nomeFoto, {
				metod : 'get'
			});
}


function cambiaQuadro(nomeQuadro, titoloQuadro, lingua) {
	document.getElementById('image').src = 'ajax/ThumbFoto.php?n=' + nomeQuadro + "&p=quadri";

	document.getElementById('linkQuadro').href = './risorse/documenti/quadri/'
			+ nomeQuadro + '/' + nomeQuadro + '.jpg';

	document.getElementById('linkQuadro').rel = 'lightbox[quadro]';
	document.getElementById('titoloQuadro').innerHTML = titoloQuadro;
	new Ajax.Updater('testoQuadro', 'ajax/TestoQuadro.php?testo=' + nomeQuadro
			+ '&lang=' + lingua, {
		metod : 'get'
	});

	new Ajax.Updater('descrizioneQuadro', 'ajax/DescrizioneQuadro.php?testo='
			+ nomeQuadro + '&lang=' + lingua, {
		metod : 'get'
	});

	new Ajax.Updater('elencoLinkQuadri',
			'ajax/ElencoLinkQuadri.php?quadro=' + nomeQuadro, {
				metod : 'get'
			});
}


function cambiaInstallazione(nomeInstallazione, titoloInstallazione, lingua) {
	document.getElementById('image').src = 'ajax/ThumbFoto.php?n=' + nomeInstallazione + "&p=installazioni";

	document.getElementById('linkInstallazione').href = './risorse/documenti/installazioni/'
			+ nomeInstallazione + '/' + nomeInstallazione + '.jpg';

	document.getElementById('linkInstallazione').rel = 'lightbox[installazione]';
	document.getElementById('titoloInstallazione').innerHTML = titoloInstallazione;
	new Ajax.Updater('testoInstallazione', 'ajax/TestoInstallazione.php?testo=' + nomeInstallazione
			+ '&lang=' + lingua, {
		metod : 'get'
	});

	new Ajax.Updater('descrizioneInstallazione', 'ajax/DescrizioneInstallazione.php?testo='
			+ nomeInstallazione + '&lang=' + lingua, {
		metod : 'get'
	});

	new Ajax.Updater('elencoLinkInstallazioni',
			'ajax/ElencoLinkInstallazioni.php?installazione=' + nomeInstallazione, {
				metod : 'get'
			});
}


function cambiaVideo(nomeVideo, titoloVideo, lingua) {
	var urlVideo = 'playerFlv.swf?myVideo=risorse/documenti/video/' + nomeVideo + '/' + nomeVideo + '.flv';
	// document.getElementById('objectVideoId').value = urlVideo;
	// document.getElementById('embedVideoId').src = urlVideo;	
	
	var tagFlah = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"\n' +
		'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"\n' +
		'width="325"\n' + 
		'height="285"\n' + 
		'id="playerFlv"\n' + 
		'align="middle">\n' +
	'<param name="allowScriptAccess" value="sameDomain" />\n' +
	'<param id="objectVideoId" name="movie" value="' + urlVideo + '" />\n' +
	'<param name="quality" value="high" />\n' +
	'<param name="bgcolor" value="#ffffff" />\n' +
	'<embed id="embedVideoId" src="' + urlVideo + '"\n' +
           'quality="high"\n' +
		   'bgcolor="#ffffff"\n' + 
           'width="325"\n' +
           'height="285"\n' +
           'name="playerFlv"\n' +
           'align="middle"\n' +
           'allowScriptAccess="sameDomain"\n' +
           'type="application/x-shockwave-flash"\n' +
           'pluginspage="http://www.macromedia.com/go/getflashplayer" />\n' +
      '</object>';			
	
	document.getElementById('spazioVideoId').innerHTML = tagFlah;
	
	document.getElementById('titoloVideo').innerHTML = titoloVideo;
	
	new Ajax.Updater('testoVideo', 'ajax/TestoVideo.php?testo=' + nomeVideo
			+ '&lang=' + lingua, {
		metod : 'get'
	});
	
	new Ajax.Updater('descrizioneVideo', 'ajax/DescrizioneVideo.php?testo='
			+ nomeVideo + '&lang=' + lingua, {
		metod : 'get'
	});
}


function cambiaPerformance(nomePerformance, titoloPerformance, lingua) {
	var urlVideo = 'playerFlv.swf?myVideo=risorse/documenti/performance/' + nomePerformance + '/' + nomePerformance + '.flv';
	// document.getElementById('objectPerformanceId').value = 'playerFlv.swf?myVideo=risorse/documenti/persormance/' + nomePerformance + '/' + nomePerformance + '.flv';
	// document.getElementById('embedPerformanceId').src = 'playerFlv.swf?myVideo=risorse/documenti/performance/' + nomePerformance + '/' + nomePerformance + '.flv';

	
	var tagFlash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"\n' +
		'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"\n' +
		'width="325"\n' + 
		'height="285"\n' + 
		'id="playerFlv"\n' + 
		'align="middle">\n' +
	'<param name="allowScriptAccess" value="sameDomain" />\n' +
	'<param id="objectPerformanceId" name="movie" value="' + urlVideo + '" />\n' +
	'<param name="quality" value="high" />\n' +
	'<param name="bgcolor" value="#ffffff" />\n' +
	'<embed id="embedPerformanceId" src="' + urlVideo + '"\n' +
		   'quality="high"\n' +
		   'bgcolor="#ffffff"\n' +
           'width="325"\n' +
           'height="285"\n' +
           'name="playerFlv"\n' +
           'align="middle"\n' +
           'allowScriptAccess="sameDomain"\n' +
           'type="application/x-shockwave-flash"\n' +
           'pluginspage="http://www.macromedia.com/go/getflashplayer" />\n' +
    '</object>';
	
	document.getElementById('spazioVideoId').innerHTML = tagFlash;
	
	document.getElementById('titoloPerformance').innerHTML = titoloPerformance;
	
	new Ajax.Updater('testoPerformance', 'ajax/TestoPerformance.php?testo=' + nomePerformance
			+ '&lang=' + lingua, {
		metod : 'get'
	});
	
	new Ajax.Updater('descrizionePerformance', 'ajax/DescrizionePerformance.php?testo='
			+ nomePerformance + '&lang=' + lingua, {
		metod : 'get'
	});
}


function TextScroll(scrollname, div_name, up_name, down_name) {
	this.div_name = div_name;
	this.name = scrollname;
	this.scrollCursor = 0;
	this.speed = 5;
	this.timeoutID = 0;
	this.div_obj = null;
	this.up_name = up_name;
	this.dn_name = down_name;

	{
		if (document.getElementById) {
			div_obj = document.getElementById(this.div_name);
			if (div_obj) {
				this.div_obj = div_obj;
				this.div_obj.style.overflow = 'hidden';
			}
			div_up_obj = document.getElementById(this.up_name);
			div_dn_obj = document.getElementById(this.dn_name);
			if (div_up_obj && div_dn_obj) {
				// div_up_obj.setAttribute("onmouseover", scrollname +
				// ".scrollUp();");
				// div_up_obj.setAttribute("onmouseout", scrollname +
				// ".stopScroll();");
				// div_dn_obj.setAttribute("onmouseover", scrollname +
				// ".scrollDown();");
				// div_dn_obj.setAttribute("onmouseout", scrollname +
				// ".stopScroll();");

				div_up_obj.onmouseover = function() {
					eval(scrollname + ".scrollUp();")
				};
				div_up_obj.onmouseout = function() {
					eval(scrollname + ".stopScroll();")
				};
				div_dn_obj.onmouseover = function() {
					eval(scrollname + ".scrollDown();")
				};
				div_dn_obj.onmouseout = function() {
					eval(scrollname + ".stopScroll();")
				};
			}
		}
	}

	this.stopScroll = function() {
		clearTimeout(this.timeoutID);
	}

	this.scrollUp = function() {
		if (this.div_obj) {
			this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0
					: this.scrollCursor - this.speed;
			this.div_obj.scrollTop = this.scrollCursor;
			this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
		}
	}

	this.scrollDown = function() {
		if (this.div_obj) {
			this.scrollCursor += this.speed;
			this.div_obj.scrollTop = this.scrollCursor;
			this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
		}
	}

	this.resetScroll = function() {
		if (this.div_obj) {
			this.div_obj.scrollTop = 0;
			this.scrollCursor = 0;
		}
	}
}
