CmdUtils.CreateCommand({
	names: ["thesaurus"],
		homepage: "http://www.zacharyspencer.com/",
			author: { name: "Zachary Spencer", email: "zspencer@zacharyspencer.com"},
				contributors: ["Zachary Spencer", "Tom Wright", "Justin"],
					license: "MPL",
					    arguments: [ {role: "object", nountype: noun_arb_text, label: "word"}],
					            preview: function (pblock, args) {
						                word = args.object.text
								            pblock.innerHTML = "Searching for " + word + ' on <b><a href="http://thesaurus.com">thesaurus.com...</a></b>';
									                url = "http://thesaurus.reference.com/search";
											            params = {q: word};
												                previewTemplate = this.previewTemplate;
														            jQuery.get(url, params, function (htmlData){
															                    pblock.innerHTML = "";
																	                    var doc = context.focusedWindow.document;
																			                    var domDiv = doc.createElement( "div" );
																					                    domDiv.innerHTML = htmlData;
																							                    content = jQuery(".the_content > tbody > tr:last-child > td:last-child > span", domDiv);
																									                    if (content.length == 0){
																											                         pblock.innerHTML += "No direct matches.<br> <b>Hit enter for suggested alternative searches...</b>";
																														                      return;
																																                      }
																																		                      for(var i =0; i< content.length; i++){
																																				                           pblock.innerHTML += content.eq(i).html() + ",";
																																							                   }
																																									                   pblock.innerHTML += "<br> <b>Hit enter for more information...</b>";
																																											               });
																																												               },
																																													       	
																																															execute: function( args ) {
																																																	Utils.openUrlInBrowser('http://thesaurus.reference.com/browse/' + args.object.text);
																																																		}
																																																		})  

