function getFeed(sender, uri) {
  $.get('/include/jquery.jfeed.proxy.php?url='+uri, function(d) {
    
    // Commented each item to only find the first.
    //(d).find('entry').each(function() {

      //name the current found item this for this particular loop run
      //var $item = $(this);

      // Commented the line above to find just the first item.
      var $item = $(d).find('entry:first');
      var title = $item.find('title').text();
      var link = $item.find('link[rel^=\'alternate\']').attr('href');
      var description = $item.find('content').text();
      var pubDate = $item.find('published').text();
      var author = $item.find('author').find('name').text();
      var authorID = $item.find('author').find('uri').text().replace('http://www.blogger.com/profile/','');

      var html = "<div class=\"divEntry author_" + authorID + "\">"
      html += "<h3><span>Kycklingbonden</span> - " + author + "</h3>"
      html += "<div class=\"quote\"><p class=\"pHeading\"><a href=\""+link+"\" target=\"_blank\">" + title + "</a></p>";
      html += "<p class=\"pSummary\">" + description + "</p>";
      html += "<p class=\"pLink\"><a href=\"" + link + "\" target=\"_blank\">Läs hela inlägget av " + author + " och kommentera det »</a><br />"
      html += "<a href=\"http://kycklingbonde.blogspot.com\" target=\"_blank\">Visa alla inlägg »</a></p></div></div>";
 
      jQuery(sender).append($(html));
    
    // Commented for the each-loop
    //});
  });
};

function getFirstBlogPost(sender, uri) {
  $.get('/include/jquery.jfeed.proxy.php?url='+uri+'feeds/posts/default', function(d) {
      var $item = $(d).find('entry:first');
      var title = $item.find('title').text();
      var link = $item.find('link[rel^=\'alternate\']').attr('href');
      var description = $item.find('content').text();
      var pubDate = $item.find('published').text();
      var author = $item.find('author').find('name').text();
      var authorID = $item.find('author').find('uri').text().replace('http://www.blogger.com/profile/','');

      var html = "<div class=\"divEntry author_" + authorID + "\">"
      html += "<div class=\"quote\"><p class=\"pHeading\"><a href=\""+link+"\" target=\"_blank\">" + title + "</a></p>";
      html += "<p class=\"pSummary\">" + description.substr(0,150) + "...</p>";
      html += "<p class=\"pAuthor\">" + author + "</p>"
      html += "<p class=\"pLink\"><a href=\"" + link + "\" target=\"_blank\">Läs hela inlägget och kommentera det »</a><br />"
      html += "<a href=\""+uri+"\" target=\"_blank\">Gå till bloggen / Visa alla inlägg »</a></p></div></div>";
 
      jQuery(sender).append($(html));
  });
};

//--- [ Enter / Leave Textbox ] ---
var tbValue = '';
function enterTB(tb, originalvalue){
  if(tb.value==originalvalue){
    tbValue=originalvalue; tb.value='';
  }
} 
function leaveTB(tb){
  if(tb.value=='') tb.value=tbValue;
}

function doHoverExpand(objid,leave){
	if(leave)
		document.getElementById(objid).style.height='13px';
	else
		document.getElementById(objid).style.height='auto';
}

//  ~(8(|) HOMER ©07
