    $(document).ready(function()
    {
        //$.get('/feed', function(d){
    	$.ajax({
    	  url: "feed",
    	  async: false,
   		  success: function(d){
			var imgs = new Array();
			var tits = new Array();
			var desc = new Array();
			var date = new Array();
			var link = new Array();
			//for each item node in the xml file
			$(d).find("item").each(function()
			{
				//$("#output").append("<p><img src=\"" + $(this).find("media\\:content").attr("url") + "\"></p>\n");
				var txt01 = $(this).find("media\\:content").attr("url");
				var txt02 = $(this).find("title").attr("text");
				var txt03 = $(this).find("media\\:description").attr("innerHTML");
				var txt04 = $(this).find("pubDate").attr("innerHTML");
				var txt05 = $(this).find("guid").attr("innerHTML");
				if(txt01 && txt02 && txt03 && txt04 && txt05){
					imgs.push(txt01);
					tits.push(txt02);
					desc.push(txt03);
					date.push(txt04);
					link.push(txt05);		
				}
			});
			
			$("#tits01").html(tits[0]);
			$("#tits02").html(tits[1]);
			$("#tits03").html(tits[2]);
			$("#tits04").html(tits[3]);
			
			$("#tits05").html(tits[4]);
			$("#tits06").html(tits[5]);
			$("#tits07").html(tits[6]);			
			
			$("#desc01").html(desc[0].substring(0,180) + "...").unescape();
			$("#desc02").html(desc[1].substring(0,180) + "...").unescape();
			$("#desc03").html(desc[2].substring(0,180) + "...").unescape();
			$("#desc04").html(desc[3].substring(0,180) + "...").unescape();
			
			$("#desc05").html(desc[4]).unescape();
			$("#desc06").html(desc[5]).unescape();
			$("#desc07").html(desc[6]).unescape();			
			
			$("#imgs01").attr('src',imgs[0]);
			$("#imgs02").attr('src',imgs[1]);
			$("#imgs03").attr('src',imgs[2]);
			$("#imgs04").attr('src',imgs[3]);		
			
			$("#imgs05").attr('src',imgs[4]);
			$("#imgs06").attr('src',imgs[5]);
			$("#imgs07").attr('src',imgs[6]);
			
			$("#imgs08").attr('src',imgs[7]);
			$("#imgs09").attr('src',imgs[8]);
			$("#imgs10").attr('src',imgs[9]);
			$("#imgs11").attr('src',imgs[10]);
			$("#imgs12").attr('src',imgs[11]);
			$("#imgs13").attr('src',imgs[12]);	
			$("#imgs14").attr('src',imgs[13]);
			$("#imgs15").attr('src',imgs[14]);
			$("#imgs16").attr('src',imgs[15]);	
			$("#imgs17").attr('src',imgs[16]);
			$("#imgs18").attr('src',imgs[17]);
			$("#imgs19").attr('src',imgs[18]);			
			
			$("#imgs08").attr('title',tits[7]);
			$("#imgs09").attr('title',tits[8]);
			$("#imgs10").attr('title',tits[9]);
			$("#imgs11").attr('title',tits[10]);
			$("#imgs12").attr('title',tits[11]);
			$("#imgs13").attr('title',tits[12]);	
			$("#imgs14").attr('title',tits[13]);
			$("#imgs15").attr('title',tits[14]);
			$("#imgs16").attr('title',tits[15]);	
			$("#imgs17").attr('title',tits[16]);
			$("#imgs18").attr('title',tits[17]);
			$("#imgs19").attr('title',tits[18]);
			
			$("#imgs01").aeImageResize({ width: 110 });
			$("#imgs02").aeImageResize({ width: 110 });
			$("#imgs03").aeImageResize({ width: 110 });
			$("#imgs04").aeImageResize({ width: 110 });		

			$("#imgs05").aeImageResize({ width: 110 });
			$("#imgs06").aeImageResize({ width: 110 });
			$("#imgs07").aeImageResize({ width: 110 });			

			$("#imgs08").aeImageResize({ width: 110 });
			$("#imgs09").aeImageResize({ width: 110 });
			$("#imgs10").aeImageResize({ width: 110 });
			$("#imgs11").aeImageResize({ width: 110 });
			$("#imgs12").aeImageResize({ width: 110 });
			$("#imgs13").aeImageResize({ width: 110 });
			$("#imgs14").aeImageResize({ width: 110 });
			$("#imgs15").aeImageResize({ width: 110 });
			$("#imgs16").aeImageResize({ width: 110 });			
			$("#imgs17").aeImageResize({ width: 110 });
			$("#imgs18").aeImageResize({ width: 110 });
			$("#imgs19").aeImageResize({ width: 110 });					
			
			$("#date01").html(date[0].substring(5,16));
			$("#date02").html(date[1].substring(5,16));
			$("#date03").html(date[2].substring(5,16));
			$("#date04").html(date[3].substring(5,16));	

			$("#date05").html(date[4].substring(5,16));
			$("#date06").html(date[5].substring(5,16));
			$("#date07").html(date[6].substring(5,16));	
			
			$("#date01").attr('datetime',date[0].substring(5,16));
			$("#date02").attr('datetime',date[1].substring(5,16));
			$("#date03").attr('datetime',date[2].substring(5,16));
			$("#date04").attr('datetime',date[3].substring(5,16));			
			
			$("#date05").attr('datetime',date[4].substring(5,16));
			$("#date06").attr('datetime',date[5].substring(5,16));
			$("#date07").attr('datetime',date[6].substring(5,16));				

			$("#enlace01").attr('href',link[0]);
			$("#enlace02").attr('href',link[1]);
			$("#enlace03").attr('href',link[2]);
			$("#enlace04").attr('href',link[3]);
			
			$("#enlace05").attr('href',link[4]);
			$("#enlace06").attr('href',link[5]);
			$("#enlace07").attr('href',link[6]);	

			$("#enlace08").attr('href',link[7]);
			$("#enlace09").attr('href',link[8]);
			$("#enlace10").attr('href',link[9]);
			$("#enlace11").attr('href',link[10]);
			$("#enlace12").attr('href',link[11]);
			$("#enlace13").attr('href',link[12]);
			$("#enlace14").attr('href',link[13]);
			$("#enlace15").attr('href',link[14]);
			$("#enlace16").attr('href',link[15]);			
			$("#enlace17").attr('href',link[16]);
			$("#enlace18").attr('href',link[17]);
			$("#enlace19").attr('href',link[18]);				
			
			//alert(imgs[8]);
			//alert(tits[8]);
			//alert(desc[8]);
			//alert(date[8]);
			//alert(link[8]);
   		  }
		});
	});

