var myGlobalHandlers = {
    onCreate: function(){
        Element.show('systemWorking');
        document.body.style.cursor='wait';
    },

    onComplete: function() {
        if(Ajax.activeRequestCount == 0){
            Element.hide('systemWorking');
            document.body.style.cursor='default';
        }
    }
};

Ajax.Responders.register(myGlobalHandlers);

function mouseEventHandler(e) {
    var x = Event.pointerX(e);
    var y = Event.pointerY(e);
    loadingPosition(x,y);
}

function loadingPosition(x,y) {
    var obj = $("systemWorking");
    obj.style.top = (parseInt(y)-8) + 'px';
    obj.style.left = (parseInt(x)+8) + 'px';
}


