CmdUtils.CreateCommand({
  name: "allmusic",
  description: "Searches allmusic.com for a given artist.",
  homepage: "http://xnyl.net",
  author: { name: "Derek Reeve", email: "derek@audilis.com"},
  help: "Searches allmusic.com for the artist name given in the search terms.",
  icon: "http://allmusic.com/favicon.ico",
  takes: {"search terms": noun_arb_text},
    execute: function(terms) {
      var doc =  Application.activeWindow.activeTab.document;
      var en=encodeURIComponent;
      var urlTerms = en(terms.text).replace(/%20/g, "|");
      // TODO: handle selections
      doc.location.href = "http://www.allmusic.com/cg/amg.dll?p=amg&sql=1:" + urlTerms;
   }
});