var bookmark_bildu = {
  description: "Gorde Bildu-n",
  shortDescription: "Bildu (+)",
  icon: "http://www.bildu.net/icon.png",
  scope: {
    semantic: {
	  "xFolk" : "taggedlink"
    }
  },
  doAction: function(semanticObject, semanticObjectType) {
    var url;
    if (semanticObjectType == "xFolk") {
      var xfolk = semanticObject;
      if (xfolk && xfolk.taggedlink && xfolk.taggedlink.link) {
        url = 'http://www.bildu.net/bookmarks/bildu?action=add&address=' + encodeURIComponent(xfolk.taggedlink.link);
        if (xfolk.taggedlink.title) {
          url += '&title=' + encodeURIComponent(xfolk.taggedlink.title);
        }
        if (xfolk.description) {
          url += '&description=' + encodeURIComponent(xfolk.description);
        }
        if (xfolk.tag) {
          url += '&tags=';
          for (var i = 0; i < xfolk.tag.length; i++) {
            url += encodeURIComponent(xfolk.tag[i]);
            url += ",";
          }
        }
      }
    }
    return url;
  }
};


SemanticActions.add("bookmark_bildu", bookmark_bildu);
