there's an awful lot of code in this onload... probably best as a handler function I would think