I have having some trouble with getting this to work in IE, it works perfect in firefox.

Here is the code:
Code:
<script type="text/javascript">
window.addEvent=function(e,ev,f,c){if(e.addEventListener){e.addEventListener(ev,f,c);}else if(e.attachEvent){var r=e.attachEvent('on'+ev,f);return r;}else{e['on'+ev]=f;}};

function all(){
	document.write('SOMETHING HERE');

	function mouseover()
	{
 		alert('onmouseover');
	}

window.onmouseover = mouseover;
}

window.addEvent(window, "load", all, false);
</script>
Why doesn't it work in IE? Is there a way to do this that works in all browser?

Thanks!