function showrecentposts(json) {
  var showpostdate = true;
  var showposttitle = true;
for (var i = 0; i < json.feed.entry.length; i++) {
    var entry = json.feed.entry[i];
    var alturl;
    if (i == json.feed.entry.length) break;
   var posttitle = entry.title.$t;
   var postdate = entry.published.$t;
   var pdyear = postdate.substring(0,4);
   var pdmonth = postdate.substring(5,7);
   var pdday = postdate.substring(8,10);
   var postdatedisp = pdday+"/"+pdmonth+"/"+pdyear;
   if ("content" in entry) {
     var post = entry.content.$t;}
   else
   if ("summary" in entry) {
     var post = entry.summary.$t;
     } else {
     var post = "";
     }
   // removes linefeeds & ...
   //var re = /<\S[^>]*>/g;
   //post = post.replace(re, "");
    var labels="";
    for (var j = 0; j < entry.category.length; j++) {
      if (entry.category[j].scheme=="http://www.blogger.com/atom/ns#") {
        labels = labels + entry.category[j].term + ",";
      }
    }
   
    var href = "'" + json.feed.entry[i].link[4].href + "'";
    var title = "<h3>" + "<a href="+ href + '" target="_blank">' + posttitle + "</a> </h3>";
    document.write(title);
    // if num of chars is zero, only output the Title
    //alert(numchars);
    if (numchars > 0) {
      document.write('<i>');
      if (post.length < numchars) {
        document.write(post);
        } else {
        post = post.substring(0, numchars);
        var quoteEnd = post.lastIndexOf(" ");
        post = post.substring(0, quoteEnd);
        document.write(post + "...<a href=" + href + ">[more]</a>");
      }
    }
  // if num of chars is zero, only output the Title
  if (numchars > 0) {
    document.write('</i>');
    document.write('<br/><span class=postdate>');
    document.write(postdatedisp);
    document.write('</span><br/>');
    }
  }
}








function showrecentposts2(json) {
var showpostdate = true;
var showposttitle = true;

document.write("<h2>" + dispcat + "</h2>");

for (var i = 0; i < json.feed.entry.length; i++) {
   var entry = json.feed.entry[i];
   var alturl;
   if (i == json.feed.entry.length) break;
   var posttitle = entry.title.$t;
   var postdate = entry.published.$t;
   var pdyear = postdate.substring(0,4);
   var pdmonth = postdate.substring(5,7);
   var pdday = postdate.substring(8,10);
   var postdatedisp = pdday+"/"+pdmonth+"/"+pdyear;
   if ("content" in entry) {
     var post = entry.content.$t;}
   else
   if ("summary" in entry) {
     var post = entry.summary.$t;
     } else {
     var post = "";
     }
   // removes linefeeds & ...
   //var re = /<\S[^>]*>/g;
   //post = post.replace(re, "");
    //alert(dispcat);
    var display=false;
    for (var j = 0; j < entry.category.length; j++) {
      if (entry.category[j].scheme=="http://www.blogger.com/atom/ns#") {
        if (entry.category[j].term==dispcat) {
          display=true;
        }
      }
    }
    //alert(display);
    if (display) {
   
    var href = "'" + json.feed.entry[i].link[4].href + "'";
    var title = "<h3>" + "<a href="+ href + '" target="_blank">' + posttitle + "</a> </h3>";
    document.write(title);
    // if num of chars is zero, only output the Title
    if (numchars > 0) {
      document.write('<i>');
      if (post.length < numchars) {
        document.write(post);
        } else {
        post = post.substring(0, numchars);
        var quoteEnd = post.lastIndexOf(" ");
        post = post.substring(0, quoteEnd);
        document.write(post + "...<a href=" + href + ">[more]</a>");
      }
    }
    }
  // if num of chars is zero, only output the Title
  if (display&&(numchars > 0)) {
    document.write('</i>');
    //document.write('<br/><span class=postdate>');
    //document.write(postdatedisp);
    //document.write('</span><br/>');
    }
  }
}
