// JavaScript Document

/*author Thomas Ricci*/
<!--
var xmlHttp;

function getFotoNextEvent(src,dest)
	{
		try
		{
			xmlHttp= new XMLHttpRequest(); //Firefox,Chrome...
		}catch(e)
			{
				try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); //IE...
			}catch(e)
		{try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){alert("Il tuo browser non supporta contenuto dinamico: Aggiorna il Browser!");}}}
		

		xmlHttp.onreadystatechange = function (){ callback(dest); }
		xmlHttp.open("get",src,true);
		xmlHttp.send(null);
			
	}
	
	
	function callback(dest)
	{
		if ( xmlHttp.readyState === 2 ) {
	    		dest.innerHTML = "Richiesta inviata...";
			}
		else if ( xmlHttp.readyState === 3 ) {
    			dest.innerHTML = "Ricezione della risposta...";
			}
		else if ( xmlHttp.readyState === 4 )
			 {
			        if ( xmlHttp.status === 200 ) 
				{
					    var xmlDoc=xmlHttp.responseXML.documentElement;
						var last=xmlDoc.getElementsByTagName("evento").length-1;
						
					 dest.innerHTML="<a href='eventi.jsp?event="+xmlDoc.getElementsByTagName("id")[last].firstChild.nodeValue+"'><img src='"+xmlDoc.getElementsByTagName("img")[last].firstChild.nodeValue+"' alt='"+xmlDoc.getElementsByTagName("nome")[last].firstChild.nodeValue+" - "+xmlDoc.getElementsByTagName("luogo")[last].firstChild.nodeValue+"' title='"+xmlDoc.getElementsByTagName("nome")[last].firstChild.nodeValue+" - "+xmlDoc.getElementsByTagName("luogo")[last].firstChild.nodeValue+"' border='0' width='340px' height='206px' /></a><div align='center'><strong>"+xmlDoc.getElementsByTagName("nome")[last].firstChild.nodeValue+"</strong></div>";
	        		}

			
	       			 else {
	        			// errore di caricamento
	        			dest.innerHTML = "<font style='color:red;'>Errore nella ricezione dei dati!</font><br/>";
	        		}

			}
	}
-->