CmdUtils.CreateCommand({
  name: "blogo",
  homepage: "http://www.drinkbrainjuice.com/blogo",
  author: { name: "Brainjuice", email: "support@drinkbrainjuice.com"},
  license: "MIT",
  description: "Send to Blogo.",
  help: "Send the current web page to Blogo.",
  icon: "http://drinkbrainjuice.com/images/blogo/blogo_icon_32x32.png",
  preview: function( pblock ) {
    pblock.innerHTML = "Sends the current web page to Blogo";
  },

  execute: function() {
    var doc = CmdUtils.getDocument();
    var baseUrl = 'blogo:';
    var url = baseUrl;
    var title = doc.title;
    url = url + 'title=' + encodeURIComponent (title);
    var currentUrl = doc.location.href;
    url = url + '&url=' + encodeURIComponent (currentUrl);
    var selectedText;
    selectedText = CmdUtils.getSelection();
    var boo_box = doc.getElementById('widgethtml');
    url = url + '&text=' + encodeURIComponent (selectedText) + '&page_text=' + encodeURIComponent (doc.innerHTML);
    if(boo_box) { url = url + '&boo_box=' + encodeURIComponent(boo_box.value) };
    doc.location.href=url;
  }
})

