var mouse_x = 0;
var mouse_y = 0;
function mouse_position ()
{
    document.body.addEventListener
    (
        "mousemove"
        ,
        function(event)
        {
            var body = document.body;
            var local_screen = document.body.getBoundingClientRect();
            mouse_x = (event.pageX / local_screen.width) * 100;
            mouse_y = (event.pageY / local_screen.height) * 100;

            body.setAttribute('screen_x', local_screen.width.toString());
            body.setAttribute('screen_y', local_screen.height.toString());

            body.setAttribute('mouse_x', mouse_x.toString());
            body.setAttribute('mouse_y', mouse_y.toString());

            body.setAttribute('px_x', event.pageX.toString());
            body.setAttribute('px_y', event.pageY.toString());
        }
    );

    document.body.addEventListener
    (
        "touchmove"
        ,
        function(event)
        {
            var body = document.body;
            var local_screen = document.body.getBoundingClientRect();
            mouse_x = (event.changedTouches[0].pageX / local_screen.width) * 100;
            mouse_y = (event.changedTouches[0].pageY / local_screen.height) * 100;

            body.setAttribute('screen_x', local_screen.width.toString());
            body.setAttribute('screen_y', local_screen.height.toString());

            body.setAttribute('mouse_x', mouse_x.toString());
            body.setAttribute('mouse_y', mouse_y.toString());

            body.setAttribute('px_x', event.pageX.toString());
            body.setAttribute('px_y', event.pageY.toString());
        }
    );
}

/*
touch events:

touchcancel

touchend

touchmove

touchstart
*/

/*
onclick	The event occurs when the user clicks on an element
oncontextmenu	The event occurs when the user right-clicks on an element to open a context menu
ondblclick	The event occurs when the user double-clicks on an element
onmousedown	The event occurs when the user presses a mouse button over an element
onmouseenter	The event occurs when the pointer is moved onto an element
onmouseleave	The event occurs when the pointer is moved out of an element
onmousemove	The event occurs when the pointer is moving while it is over an element
onmouseout	The event occurs when a user moves the mouse pointer out of an element, or out of one of its children
onmouseover	The event occurs when the pointer is moved onto an element, or onto one of its children
onmouseup	The event occurs when a user releases a mouse button over an element
*/