Crossbrowser and lightweight way to check if user is looking at the page or interacting with it

No details provided beyond the title which says it all.  This JS sits in your page and listens to the visitor and tries to determine if they are interacting with the page or simply reading it.  May not be entirely applicable to mobile devices as it listens for mouse movement.