I've been reading the book "JavaScript the definitive guide" to learn more about JavaScript. In this book he gives an example function to create pop-ups. The example function is in the code posted below. This function is shown in the book without examples of how you evoke it. So I added a little more code to try it. When I evoke it was a onclick event to function works fine however when I evoke it with a mouseover event (see commented out code in posting) the firebug debugger generates this error "w has no properties [Break on this error] var d = w.document; // Get its Document object DynamicContent.ht... (line 13)". So why does evoking this function was an onclick event work while evoking it with an onmouseover event fail?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

	<title>JavaScript Window Open Example</title>
	<link rel="STYLESHEET" type="text/css" href="/style/jsc.css">
<script language="javascript" type="text/javascript">
// This function opens a pop-up window. Invoke it from an event handler
// or the pop up will probably be blocked.
function hello() {
    var w = window.open();             //    Create a new window with no content
    var d = w.document;                // Get its Document object
    d.open();                             // Start a new document (optional)
    d.write("<h1>Hello world!</h1>");  // Output document content
    d.close();                           // End the document
window.onload = function(){

<a href="#" id="helloID">Link to popup</a>