title: Set variable with function
body: <p>I'm trying to use ExternalInterface to modify an HTML page, but it is only able to call Javascript functions and not set variables.  What I want to do is set a variable with a function, like doing <code>set_var('foo','bar')</code> would be equivalent to <code>var foo='bar'</code>.
  In PHP, I could make a function like:</p>
  
  <pre><code>function set_var($varname, $value)
  {
      $GLOBALS[$varname]=$value;
  }
  </code></pre>
  
  <p>But I don't know how to do this in Javascript.  Maybe something with the window object?</p>