 #Entry point
 root.go = ->
   g.ve = new VisualEnvironment(document.getElementById("surface"))
-  ebox = new ElementBox(g.ve)
-  surface = new Surface(g.ve)
+  g.ve.ebox = new ElementBox(g.ve)
+  g.ve.surface = new Surface(g.ve)
   g.ve.render(g.ve)
 
 #Global event handlers

    @pos.y = -(event.layerY / @ve.container.offsetHeight) * 2 + 1
    console.log(@pos.x + "," + @pos.y)

  #onmousedown handlers
  baseDown: (event) ->
    @updateMouse(event)

        e = ixs[0].object.userData
        console.log "! ebox select -- " + e.constructor.name
        console.log e
        @makePlacingObject(e, 0, 0)
        @ve.container.onmousemove = (eve) => @placingMove(eve)
        @ve.container.onmousedown = (eve) => @placingDown(eve)

