solved (the quick way)
just do -
window.setup = function () {…} window.draw = function () {…} etc etc…