title: JavaScript - override or prevent execution
body: <p>I'm working on a client project and I have to include their header and footer, which includes some core JavaScript files. I have a couple of <code>PNG</code>s on the page, but their core JS file is poorly coded and doesn't check for IE 7 before attempting to replace <code>IMG</code> tags that contain <code>.png</code> files with <code>DIVS</code> that use the <code>AlphaImageLoader</code> filter. The result is that in IE 7, all my <code>.png</code> images are replaced with <code>DIV</code> tags that have a default <code>display: block</code>, causing a linebreak after every single png image in my pages.</p>
  <p>What I'd like to do is override their function with a better one or somehow prevent theirs from executing, but I cannot modify the JS file itself, which both defines the function and attaches it to the window <code>onload</code> event. I've tried redefining the function under the same name in several places (header, just before the <code>/body</code> tag, in <code>$(document).ready</code>, etc...) but the original function always seems to execute, presumably because the original function code is what is stored with the event handler, and not merely a pointer to the function.</p>
  <p>Any way I can fix? Is there a way to selectively remove <code>onload</code> event handlers?</p>