CmdUtils.CreateCommand({
  icon: "http://weborganics.co.uk/files/uf-favicon.ico",
  name: "uf-search",
  author: {name: "Martin McEvoy", email: "weborganics@googlemail.com"},
  description: "Searches the microformats.org wiki for your words",
  takes: {"your words": noun_arb_text},
  preview: function(pblock, directObject) {
  searchText = jQuery.trim(directObject.text);
    if(searchText.length < 1) {
    pblock.innerHTML = "Search the <a style=\"color:#679A06;\" href=\"http://microformats.org/wiki/Main_Page\">Microformats</a> Wiki";
  return;
  }
  var previewTemplate = "Search the <a style=\"color:#679A06;\" href=\"http://microformats.org/wiki/Main_Page\">Microformats</a> Wiki for ${query}";
  var previewData = {query: searchText};
  pblock.innerHTML = CmdUtils.renderTemplate(previewTemplate, previewData);
 },
execute: function(directObject) {
var url = "http://microformats.org/wiki/Special:Search?search={QUERY}"
var query = directObject.text
var urlString = url.replace("{QUERY}", query);
   if (searchText.length < 1){
     urlString = "http://microformats.org/wiki/Main_Page";
     Utils.openUrlInBrowser(urlString);
   }else{
     Utils.openUrlInBrowser(urlString);
  }
}
})
