The solution involves performing a test on the element that the mouse is now on. The element can be retrieved using the relatedTarget in FireFox or toElement in Internet Explorer. Once we have the element, we will make sure that it isn’t the element itself or a child of the element. Remember, we only want to fire the onMouseOut event when the mouse has fully left the parent. The setup here is that you have an ASP.NET AJAX Control that has a method named _onMouseOut where you have already created the handler and such for it. If you aren’t familiar with this, I would recommend checking out the ASP.NET AJAX Documentation under the ASP.NET AJAX Extensibility section, specifically, a good example is this one, which illustrates using the IScriptControl.
I have added inline comments to make the code self-explanatory, I feel it is pretty straightforward to understand. In addition to the _onMouseOut method, you can see I also added a helper method to test if an element is a child of a parent element. You can trim these down into a single function if you’d like. The one thing that you may find confusing is accessing the rawEvent. Note that the event argument passed in an ASP.NET AJAX Control is of the type Sys.UI.DomEvent, not the native DOM event, so hence the rawEvent property, which exposes this. The DomEvent contains this property even though it isn’t listed in the ASP.NET AJAX Documentation as of this writing.
I came up with this technique after doing some research on the Internet and came across this post on the CodeHead forums as well as this one on QuirksMode.org. Using these ideas, I tweaked them to get them to work within the context of an ASP.NET AJAX Control.