Function Not Defined OEmbed Vimeo API
<p>Started messing around with Vimeo API in an attempt to create a clickable gallery like this (http://www.aideffectiveness.org/busanhlf4/vimeo/php-example.php). However, when I moved some of the code into a "script.js" file as a way to organize my code from the other parts of the site, the json callback keeps saying that the 'embedVideo' function is not defined. Any ideas?</p>

<p>The "script.js" file is placed at the bottom of the page and has the following:</p>

<pre><code>var NS = NS || NS;

NS = {

  videoInit: function() {

    var oEmbedUrl = 'http://vimeo.com/api/oembed.json';
    var oEmbedCallback = 'embedVideo';
    var videoid =  "";

    if(videoid == '' ){
        videoid = '23515961';
    }

    function embedVideo( video ) {
        var videoEmbedCode = video.html;
        document.getElementById('embed').innerHTML = unescape(videoEmbedCode);
    }

    function init() {
      loadScript(oEmbedUrl + '?url=http://vimeo.com/' + videoid + '&amp;height=380&amp;width=700&amp;callback=' + oEmbedCallback);
    }

    function loadScript( url ) {
        var js = document.createElement('script');
        js.setAttribute('src', url);
       document.getElementsByTagName('head').item(0).appendChild(js);
    }

    init();
  }
}
$(function() {
   NS.videoInit();
});
</code></pre>

<p>The HTML:</p>

<pre><code>&lt;div id="wrapper"&gt;
    &lt;div id="embed"&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>
