// to get latest news from http://feeds.ziffdavisenterprise.com/RSS/tech.xml for home page


 
function  homepage_get_rss_feed(){
			
			//clear the content in the div for the next feed.
			$("#home_rss").empty();
			var urlname='http://feeds.ziffdavisenterprise.com/RSS/tech.xml';
			//use the JQuery get to grab the URL from the selected item, put the results in to an argument for parsing in the inline function called when the feed retrieval is complete
			$.get('proxy.php?url='+urlname, function(d) {
				
		
		
		  for (var i = 0; i < 3; i++) {
				
				
					//name the current found item this for this particular loop run
					var $item = $(d).find('item')
					// grab the post title
					var title = $item.eq(i).find('title').text();
					// grab the post's URL
					//var link = $item.find('link').text();
					// next, the description
					var description = $item.eq(i).find('description').text();
					//don't forget the pubdate
					var pubDate = $item.eq(i).find('pubDate').text();
					var pubDatelength =pubDate.length;
					var descriptionlength =description.length;
						 if (pubDatelength > 22 )
				 {

				  pubDate= pubDate.substr(0,22);
				  // alert(description)
				 }
				 else{

				 pubDate=pubDate;

				 }
					 if (descriptionlength > 120 )
				 {

				  description= description.substr(0,119)+'...';
				  // alert(description)
				 }
				 else{

				 description=description;

				 }
					
					// now create a var 'html' to store the markup we're using to output the feed to the browser window
					var html ="<ul><li>"
					 html += "<div class=\"date\">" + pubDate + "</div>";
					 html += "<a href=\"news.html\">" + title + "<\/a>";
					 html += "<p class=\"description\">" + description + "<p>";
					 html += "<a href=\"news.html\" ><img src=\"images/more.gif\" border=\"0\" /></a></li></ul>";
					
					//put that feed content on the screen!
					$('#home_rss').append($(html));  
	}
				
			});
			
		};
		
		
