var noun_type_text = { 
    _name: "word", 
    suggest: function( text, html ) { 
      var suggestions = []; 
      suggestions.push( CmdUtils.makeSugg( CmdUtils.getSelection() ) ); 
      return suggestions; 
    } 
} 

CmdUtils.CreateCommand({
        name: "alc",
        author: { name: "memorycraft", email: "memorycraft(at)gmail(dot)com"},
        description: "translate JP <=> EN on ALC",
        takes: {word: noun_arb_text},
        icon: "http://www.alc.co.jp/favicon.ico",

        preview: function( pblock, object ) {
                if (object.length < 1) url = this.name;
                var out = '';
                out += 'Translate <strong>' + object.text + '</strong> on ALC';

                pblock.innerHTML = out;
        },

        execute: function( word ) {
                var url = "http://eow.alc.co.jp/$1/UTF-8/".replace("$1", word.text);
                Utils.openUrlInBrowser( url );
        }
})


