Edit in JSFiddle

var moHandler = function(){
    alert('Mouse out!');
}

var mdHandler = function(){
    alert('iClicked!');
}


window.addEventListener("mouseout",  moHandler );
window.addEventListener("mousedown", mdHandler );
Click here