deleted dead code, changed functions and added multi-browser compatibility for mousemovement