JS: Using window.addEventListener

Overriding window.onload leads to conflicts with other JS scripts doing the same thing (e.g. Google Analytics). Only the last function assigned via window.onload = function(){…} will be triggered.

window.addEventListener (or attachEvent for IE < 8) is a clean solution for adding more than one function to the load event.