JavaScript "normalize event object"
<p>This program taken from a book Pro JavaScript Techniques is used to create hover-like functionality for an Element.</p>

<p>I don`t understand what the author means when he says, in the comments, Normalize the Event object.</p>

<p>Can you tell me</p>

<p>a) why is this necessary, explaining what would happen if it wasn`t normalized</p>

<p>b) how does the code provide achieve the effect</p>

<p>Thank you.</p>

<pre><code>var div = document.getElementsByTagName('div')[0];

div.onmouseover = div.onmouseout = function(e) {

//Normalize the Event object
e = e || window.event;

//Toggle the background colover of the &lt;div&gt;
this.style.background = (e.type == 'mouseover') ? '#EEE' : '#FFF';

};
</code></pre>
