google.load("feeds", "1");
	function initialize() {
		var attributes = ["comments","title", "link", "publishedDate", "author"]; 
		//contentSnippet = description
		var feed = new google.feeds.Feed("http://www.logosquotes.org/rss_en.xml");
			feed.setNumEntries(1);
			
/*			
function myfunction(author){
   var myString = author;
   var myArray = myString.split(' ');
   i = myArray.length;
   
   if(i==2) {
   	  	nome = myArray[1];
		cognome = myArray[0]; 
   }
    if(i>2) {
    	cognome = myArray[0];
    	nome = "";
    	for(k=1;k<=i-1;k++) {
   		nome = nome+" "+ myArray[k];
		} 
	 
   }
   //alert(nome);
	var autore= nome + " " + cognome;
		return autore;
		//alert(autore);

}
*/			
			
		feed.load(function(result) {
			if (!result.error) {
				var container = document.getElementById("feed");
				for (var i = 0; i < result.feed.entries.length; i++) {
					var entry = result.feed.entries[i];
					var div = document.createElement("div");
					var span = document.createElement('span');
					var link = document.createElement('a');
					link.setAttribute('href', entry.link);
					link.appendChild(document.createTextNode(entry.title));					
					var em = document.createElement('em');
					var em2 = document.createElement('em');
					/*var img = document.createElement('img');
					img.src = "images/vtop.gif";
					var img2 = document.createElement('img');
					img2.src = "images/vbtn.gif";*/
					
					
					/*
					var author=entry.author;
					var name = myfunction(author);
					*/
					var name = entry.author;
					var frase = entry.title;
				

						//Se volete impostare il nome di una classe per lo stile usate:
						//div.setAttribute((document.all ? 'className' : 'class'), 'rosso');
						//Questo perch FF e IE utilizzano un metodo diverso per farlo...
						div.setAttribute((document.all ? 'className' : 'class'), 'logos-quotes');
						//div.style.cssText = 'color:#003; margin-top:10px';
						//span.style.cssText = 'color:#777; font-size:11px';
						//link.style.cssText = 'font-weight:bold';
						
						//div.appendChild(em);
						//em.appendChild(document.createTextNode('\"'));
						//div.appendChild(img);

						div.appendChild(link);
						//div.appendChild(em2);
						//em2.appendChild(document.createTextNode('\"'));
						//div.appendChild(img2);
						x = frase.indexOf(name);
						if(x== -1){
							div.appendChild(span);
							span.appendChild(document.createTextNode(name));
						}
					
						
						container.appendChild(div);

				}
			}
		});
	}
	google.setOnLoadCallback(initialize);

