+1  A: 

Try to add an envent listener for 'load' instead, or use the declarative syntax <body onload="init()">.

EDIT: Additionally, saying window.onload = init(); sets window.onload to the result of calling init(). What you mean is window.onload = init; (a lambda expression). This is bad practice still, as it overwrites other things that might be bound to window.onload.

Tomalak
This is fine, actually. The onload event handler will be executed once the window loads.
EndangeredMassa
I don't see why this deserves a downvote, though. Is it wrong?
Tomalak
Removing line 82 and updating the body tag as described works.
Zack Peterson
You can set the onload handler wherever you like. It could even be the first thing you do inside the first <script> tag under <head>.
Ates Goral
I didn't downvote you. =P
EndangeredMassa
You are right. I will remove that recommendation.
Tomalak
+1  A: 

I'm no javascript master, but I usually setup onload functions like so:

window.onload = function() { init(); }

Doing it your way appears to execute the function, then set the return value to the window.onload property.

EndangeredMassa
+11  A: 

Shouldn't line 82 read:

window.onload = init;

When you do "init()" it's a call to a function that returns void. You end up calling that function before the page loads.

Ates Goral
window.onload = init(); Assigns the result of Init to window.onload, which expects a function pointer. This is the error I think.
The Wicked Flea
Yep, right on the money.
dmercer
Just what I said.
Tomalak
Several good answers. But, I accept this one because it requires only two key strokes.
Zack Peterson
A: 

In addition to the onload fixes proposed here, also check to see if there are multiple elements with that ID, I believe IE will return a collection of all elements with that ID, in which case you would need to select the intended item out of the collection before accessing that property or ensure you are using unique IDs.

J c
The ID is unique.
Zack Peterson
+2  A: 

To preserve any previously set onload functions try this

var prevload = window.onload;
window.onload = function(){
    prevload();
    init();
}
Jacob
That's a neat idea.
Zack Peterson
Check to see if prevload is set first:prevload
Ates Goral
You should be using attachEvent/addEventListener instead (and abstracting it if you do it more than once).
eyelidlessness
@Ates Goral: If that's what it looks like, that is pretty darn sweet syntactic sugar.
eyelidlessness
Sadly, it does not work :(
eyelidlessness
A: 

Try running it in FireFox with the FireBug plugin enabled. This will allow you to debug the javascript

edosoft
Only Internet Explorer throws an error.
Zack Peterson