 window.Carnival =
   init: (options) ->
-    @setOptions(options)
+    Carnival.setOptions(options)
 
     xmlhttp = new XMLHttpRequest();
     xmlhttp.onreadystatechange = () =>

        n.innerHTML = xmlhttp.responseText
        document.body.appendChild(n)

        @replaceScriptsRecurse(n)

    xmlhttp.open('GET', '@{EmbedR siteId}?t=' + Math.random(), true);
    xmlhttp.send();

        CarnivalOptions[property] = defaults[property]

  replaceScriptsRecurse: (node) ->
    if Carnival.isScriptNode(node)
      script = document.createElement('script')
      script.src = node.src

      node.parentNode.replaceChild(script, node)
    else
      Carnival.replaceScriptsRecurse(child) for child in node.childNodes

    node;

