Function name from a variable in Javascript
<p>I create a context-menu from an array like this:</p>

<pre><code>var menu1 = [
   {
      'OPTION1':function(menuItem,menu) {
         // code for OPTION1
      }
   },
   {
      'OPTION2':function(menuItem,menu) {
         // code for OPTION2
      }
   }
];
</code></pre>

<p>When the user right-clicked on my webpage, a menu appears with the options OPTION1 and OPTION2.</p>

<p>I need to change dynamically the function name, because it's the context-menu option text. <strong>Is there any way to declare the function name as a variable?</strong></p>

<p>This is what I want:</p>

<pre><code>var optionsletters = {};
optionsletters['option1'] = 'option_one';
optionsletters['option2'] = 'option_two';

var menu1 = [
   {
      optionsletters['option1']:function(menuItem,menu) {
         // code for OPTION1
      }
   },
   {
      optionsletters['option2']:function(menuItem,menu) {
         // code for OPTION2
      }
   }
];
</code></pre>

<p>EDIT#1: This is the plugin I've been using <a href="http://www.javascripttoolbox.com/lib/contextmenu/index.php" rel="nofollow">jQuery ContextMenu Plugin</a></p>

<p>EDIT#2: I need this to allow change language from spanish to english and viceversa.</p>
