I've made that mistake a couple of times myself..
window.addOnloadListener = function(listener)
And by the way,
isn't going to work. I guess you're used to PHP where this would be the correct (and only) way to pass "functions" as parameters. In JS, however, you do not need to do this, you can pass the function directly (which is what you are trying to do). So, drop the quotes.