Creating a var in javascript; modification of a script to create var usage?
<p>I have a fairly simple problem for someone familiar with js.  I quite like the style of the audio player from: <a href="http://wpaudio.com/" rel="nofollow">http://wpaudio.com/</a></p>

<p>I've taken this and have it mostly extracted to a rails project, however it turns out that the  WordPress plugin creates a variable <code>_wpaudio</code> within php as follows:</p>

<pre><code>## WPaudio style, jQuery, SWFObject
function wpaHead(){
    global $wpa_options;
    # Put all styles into the _wpaudio settings object
    $style = '';
    foreach ( $wpa_options as $key =&gt; $value ) {
        $exploded = explode('_', $key, 3);
        if ( $exploded[1] == 'style' ) {
            $style .= $exploded[2] . ":'$value',";
        }
    }
    $style = trim( $style, ',' );
    $style = '{' . $style . '}';
    # Common JS
    $wpa_pref_link_mp3 = ($wpa_options['wpa_pref_link_mp3']) ? 'true' : 'false';
    $head = "&lt;script type='text/javascript'&gt;/* &lt;![CDATA[ */ var _wpaudio = {url: '" . WPAUDIO_URL . "', enc: {}, convert_mp3_links: $wpa_pref_link_mp3, style: $style}; /* ]]&gt; */&lt;/script&gt;";
    echo $head;
}
</code></pre>

<p><strong>Obviously nearly ALL of that code is not pertinent</strong>, however it's simply to illustrate that the <code>_wpaudio</code> var is created there.  I don't really care to have the paths built, etc.  I simply want to be able to manipulate the script such that the var is created within the js file.  I've tried a few different ways, but I'm so uninitiated in javascript that my attempts have been futile thus far.</p>

<p>Here's the javascript which fails on load in the console with the <code>Can't find variable: _wpaudio</code> error: 
<a href="https://gist.github.com/fd208d327484306d65a9" rel="nofollow">https://gist.github.com/fd208d327484306d65a9</a></p>

<p><strong>How do I modify the script so that it properly creates the _wpaudio at initialization?</strong></p>
