// JavaScript Document function onBeforeUnloadAction(){ //return "If you close the window now all work will be lost!"; } window.onbeforeunload = function(){ if((window.event.clientX < 0) || (window.event.clientY < 0)){ return onBeforeUnloadAction(); } }