// Beautiful Beta Javascript Library
// -------------------------------------------
// Version: 1.04
// Date: 2006-12-21
// Website: http://beautifulbeta.blogspot.com
// -------------------------------------------

function showsbtext(id,index) {
var bookmarktext=document.getElementById(id);
var sbValues= new Array();
  sbValues[0] = 'Condividi questo articolo';
  sbValues[1] = '<strong>Google</strong>';
  sbValues[2] = '<strong>Digg</strong>';
  sbValues[3] = '<strong>Del.icio.us</strong>';
  sbValues[4] = '<strong>Technorati</strong>';
  sbValues[5] = '<strong>Segnalo</strong>';
  sbValues[6] = '<strong>Ok Notizie</strong>';
  sbValues[7] = '<strong>Yahoo</strong>';
  sbValues[8] = '<strong>Ma.gnolia</strong>';
  sbValues[9] = '<strong>Reddit</strong>';
  sbValues[10] = '<strong>Furl</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] = "Gennaio";
   monthnames[2] = "Febbraio";
   monthnames[3] = "Marzo";
   monthnames[4] = "Aprile";
   monthnames[5] = "Maggio";
   monthnames[6] = "Giugno";
   monthnames[7] = "Luglio";
   monthnames[8] = "Agosto";
   monthnames[9] = "Settembre";
   monthnames[10] = "Ottobre";
   monthnames[11] = "Novembre";
   monthnames[12] = "Dicembre";
   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/>');
}