var MOUSE_INPUT_MAP = {
    mousedown: INPUT_START,
    mousemove: INPUT_MOVE,
    mouseup: INPUT_END,
    mouseout: INPUT_CANCEL
};

var MOUSE_ELEMENT_EVENTS = 'mousedown';
var MOUSE_WINDOW_EVENTS = 'mousemove mouseout mouseup';

/**
 * Mouse events input
 * @constructor
 */
function MouseInput() {
    this.elEvents = MOUSE_ELEMENT_EVENTS;
    this.winEvents = MOUSE_WINDOW_EVENTS;

    this.allow = true; // used by Input.TouchMouse to disable mouse events
    this.pressed = false; // mousedown state

    Input.apply(this, arguments);
}

inherit(MouseInput, Input, {
    /**
     * handle mouse events
     * @param {Object} ev
     */
    handler: function(ev) {
        var eventType = MOUSE_INPUT_MAP[ev.type];

        // on start we want to have the left mouse button down
        if(eventType & INPUT_START && ev.button === 0) {
            this.pressed = true;
        }

        // mouse must be down, and mouse events are allowed (see the TouchMouse input)
        if(!this.pressed || !this.allow) {
            return;
        }

        var target = ev.relatedTarget || ev.toElement;
        var mouseOut = (eventType & INPUT_CANCEL && (!target || target.nodeName == 'HTML'));

        if(eventType & INPUT_END || mouseOut) {
            this.pressed = false;
        }

        this.callback(this.manager, eventType, {
            pointers: [ev],
            changedPointers: [ev],
            pointerType: INPUT_TYPE_MOUSE,
            srcEvent: ev
        });
    },
});

@@ -1031,32 +1031,62 @@
 urn;%0A        %7D%0A%0A
+        // out of the window?%0A
         var targ
@@ -1136,63 +1136,73 @@
     
-var mouseOut = (eventType & INPUT_CANCEL && (!target %7C%7C
+console.log(target.nodeName);%0A        if(ev.type == 'mouseout' &&
  tar
@@ -1214,17 +1214,17 @@
 odeName 
-=
+!
 = 'HTML'
@@ -1224,18 +1224,64 @@
  'HTML')
-);
+ %7B%0A            eventType = INPUT_MOVE;%0A        %7D
 %0A%0A      
@@ -1293,24 +1293,25 @@
 eventType & 
+(
 INPUT_END %7C%7C
@@ -1313,18 +1313,22 @@
 ND %7C
-%7C mouseOut
+ INPUT_CANCEL)
 ) %7B%0A

fix mouseout bug