For Back Button in jquery // http://code.jquery.com/jquery-latest.js
jQuery(window).bind("unload", function() { //
and in html5 there is an event The event is called 'popstate'
window.onpopstate = function(event) {
alert("location: " + document.location + ", state: " + JSON.stringify(event.state));
};
and for refresh please check Check if page gets reloaded or refreshed in Javascript
In Mozilla Client-x and client-y is inside document area https://developer.mozilla.org/en-US/docs/Web/API/event.clientX