             cb(err)
         _loading_threejs_callbacks = []
     )
-
-window.load_threejs = load_threejs
 
 
 _scene_using_renderer  = undefined

        (cb) -> load("/static/threejs/r#{VERSION}/Detector.min.js", cb)
        (cb) ->
            f = () ->
                if THREE?
                    cb()
                else
                    #console.log("load_threejs: waiting for THREEJS...")

$.ajaxSetup(cache: true) # when using getScript, cache result.

load_threejs = (cb) ->
    if Detector?
        cb(); return
    _loading_threejs_callbacks.push(cb)
    #console.log("load_threejs")
    if _loading_threejs_callbacks.length > 1
        #console.log("load_threejs: already loading...")
        return  # will get called later below

    load = (script, name, cb) ->
        if typeof(name) != 'string'
