// Beautiful Beta Javascript Library
// -------------------------------------------
// Version: 1.01
// Date: 2006-11-27
// Website: http://beautifulbeta.blogspot.com
// -------------------------------------------

function showsbtext(id,index) {
var bookmarktext=document.getElementById(id);
var sbValues= new Array();
  sbValues[0] = 'Bookmark this post:';
  sbValues[1] = 'Add to <strong>Digg</strong>';
  sbValues[2] = 'Add to <strong>Delicious</strong>';
  sbValues[3] = 'Add to <strong>Blinklist</strong>';
  sbValues[4] = 'Add to <strong>Yahoo Web</strong>';
  sbValues[5] = 'Add to <strong>Netvouz</strong>';
  sbValues[6] = 'Add to <strong>Ma.gnolia</strong>';
  sbValues[7] = 'Add to <strong>Fark</strong>';
  sbValues[8] = 'Add to <strong>Furl</strong>';
  sbValues[9] = 'Add to <strong>Technorati</strong>';
  sbValues[10] = 'Add to <strong>Simpy</strong>';
  sbValues[11] = 'Add to <strong>Spurl</strong>';
  sbValues[12] = 'Add to <strong>Newsvine</strong>';
  sbValues[13] = 'Add to <strong>Blinkbits</strong>';
  sbValues[14] = 'Add to <strong>Smarkings</strong>';
  sbValues[15] = 'Add to <strong>Segnalo</strong>';
  sbValues[16] = 'Add to <strong>De.lirio.us</strong>';
  sbValues[17] = 'Add to <strong>Reddit</strong>';
  sbValues[18] = 'Add to <strong>Wists</strong>';
document.getElementById(bookmarktext.id).innerHTML = sbValues[index];
}

function getPostTitle(fullpath) {
var splitinput = fullpath.split("/");
var lastpart = splitinput[5];
var linktext = lastpart.split(".html");
var postlink = fullpath.split("#");
var outputstring = linktext[0].replace(/-/g," ");
outputstring = "\"" + outputstring + "\"";
outputstring = outputstring.link(postlink[0]);
document.write(outputstring);
return;
}

function getCommentLink(clink) {
var splitinput = clink.split("#");
var commentlink = splitinput[0];
commentlink = commentlink.concat("#comment-",splitinput[1]);
var outputstring = "(more)";
outputstring= outputstring.link(commentlink);
document.write(outputstring);
}

function showrecentcomments(json) {
  for (var i = 0; i < numcomments; i++) {
    var entry = json.feed.entry[i];
    var alturl;

    if (i == json.feed.entry.length) break;
    for (var k = 0; k < entry.link.length; k++) {
      if (entry.link[k].rel == 'alternate') {
        alturl = entry.link[k].href;
        break;
      }
    }
   alturl = alturl.replace("#", "#comment-");
   var postlink = alturl.split("#");
   postlink = postlink[0];
   var linktext = postlink.split("/");
   linktext = linktext[5];
   linktext = linktext.split(".html");
   linktext = linktext[0];
   var posttitle = linktext.replace(/-/g," ");
   posttitle = posttitle.link(postlink);
   var commentdate = entry.published.$t;
   var cdyear = commentdate.substring(0,4);
   var cdmonth = commentdate.substring(5,7);
   var cdday = commentdate.substring(8,10);
   var monthnames = new Array();
   monthnames[1] = "Jan";
   monthnames[2] = "Feb";
   monthnames[3] = "Mar";
   monthnames[4] = "Apr";
   monthnames[5] = "May";
   monthnames[6] = "Jun";
   monthnames[7] = "Jul";
   monthnames[8] = "Aug";
   monthnames[9] = "Sep";
   monthnames[10] = "Oct";
   monthnames[11] = "Nov";
   monthnames[12] = "Dec";
   var comment = entry.content.$t;
   var re = /<\S[^>]*>/g; 
   comment = comment.replace(re, "");
   if (showcommentdate == true) document.write('On ' + monthnames[parseInt(cdmonth,10)] + ' ' + cdday + ' ');
   document.write('<a href="' + alturl + '">' + entry.author[0].name.$t + '</a> commented');
   if (showposttitle == true) document.write(' on ' + posttitle);
   document.write(':<br/>');
   if (comment.length < numchars)
         document.write('<i>' + comment + '</i><br/><br/>');
   else
         document.write('<i>'+ comment.substring(0, numchars) + '...</i><br/><br/>');
  }
document.write('<span style="font-size:80%;">Widget by <a href="http://hackosphere.blogspot.com">Hackosphere</a><br/>Powered by <a href="http://beautifulbeta.blogspot.com">Beautiful Beta</a></span><br/><br/>');
}

function showrecentposts(json) {
  for (var i = 0; i < numposts; i++) {
    var entry = json.feed.entry[i];
    var posttitle = entry.title.$t;
    var posturl;
    if (i == json.feed.entry.length) break;
    for (var k = 0; k < entry.link.length; k++) {
      if (entry.link[k].rel == 'alternate') {
        posturl = entry.link[k].href;
        break;
      }
    }
    posttitle = posttitle.link(posturl);
    var readmorelink = "(more)";
    readmorelink = readmorelink.link(posturl);
    var postdate = entry.published.$t;
    var cdyear = postdate.substring(0,4);
    var cdmonth = postdate.substring(5,7);
    var cdday = postdate.substring(8,10);
    var monthnames = new Array();
    monthnames[1] = "Jan";
    monthnames[2] = "Feb";
    monthnames[3] = "Mar";
    monthnames[4] = "Apr";
    monthnames[5] = "May";
    monthnames[6] = "Jun";
    monthnames[7] = "Jul";
    monthnames[8] = "Aug";
    monthnames[9] = "Sep";
    monthnames[10] = "Oct";
    monthnames[11] = "Nov";
    monthnames[12] = "Dec";
    var postcontent = entry.content.$t;
    var re = /<\S[^>]*>/g; 
    postcontent = postcontent.replace(re, "");
    document.write('- ' + posttitle);
    if (showpostdate == true) document.write(' - ' + monthnames[parseInt(cdmonth,10)] + ' ' + cdday);
    if (showpostsummary == true) {
      if (postcontent.length < numchars)
         document.write('<br/><i>' + postcontent + '</i>');
      else
         document.write('<br/><i>'+ postcontent.substring(0, numchars) + '...' + readmorelink + '</i>');}
  document.write('<br/>');
}
document.write('<span style="font-size:80%;"><br/>Widget by <a href="http://beautifulbeta.blogspot.com">Beautiful Beta</a></span>');
}