<body style="margin-left:0; margin-top:0">
    <script>
        function log(message)
        {
            var item = top.document.createElement("li");
            item.appendChild(document.createTextNode(message));
            top.document.getElementById("log").appendChild(item);
        }
        
        function logMouseEvent(evt)
        {
            target = (evt.target) ? evt.target : evt.srcElement;
            log(evt.type + " on " + target.id);
        }
        
        function doOnMouseOut(evt)
        {
            logMouseEvent(evt);
            document.getElementById("t4_1").style.backgroundColor = "gray";
        }
        
    </script>
    <div style="height: 50; width: 50; background:white; top:0;left:0; position:absolute;" id="t4_1" 
        onMouseOver="logMouseEvent(event);" 
        onMouseOut="doOnMouseOut(event)">4</div>
</body>
