CmdUtils.CreateCommand({
  names: ["mooch"],
  icon: "http://www.bookmooch.com/favicon.ico",
  description: "Searches BookMooch for your text.",
  help: "Try typing 'mooch Stephen King'",
  author: {name: "Stephanie Leary", email: "steph@sillybean.net"},
  license: "GPL",
  homepage: "http://labs.mozilla.com/",
  arguments: [{role: 'object', nountype: noun_arb_text, label: 'search term'}],
  preview: function preview(pblock, args) {
    pblock.innerHTML = "Searching bookmooch.com for " + args.object.html;
  },
  execute: function(arguments) {
    var url = "http://bookmooch.com/m/s/";
    var query = encodeURI(arguments.object.text);
    query = query.replace(/\s+/, '+'); 
    Utils.openUrlInBrowser(url+query);
  }
});
