event called just before value of cursor will be changed
data.attachEvent("onBeforeCursorChange", function(id){ //custom code })