/**** (C)Scripterlative.com Info: http://scripterlative.com?mousepos These instructions may be removed but not the above text. Please notify any suspected errors in this text or code, however minor. Reports absolute mouse cursor co-ordinates Installation ~~~~~~~~~~~~ Save this text/file as 'mousepos.js' and place it in a folder related to your website. In all HTML documents that require the script, insert the following tags within the
section: (If mousepos.js resides in a different folder, include a relative path) Insert the following anywhere within the section: The script uses the onmousemove handler to initialise itself, and will append to any existing onmousemove handler. If any other script is known to use the onmousemove handler, this script should be initialised after it. Configuration ~~~~~~~~~~~~~ None. Operation ~~~~~~~~~ The absolute mouse co-ordinates are accessible to your code via the globally accessible variables: MousePosition.x and MousePosition.y . GratuityWare ~~~~~~~~~~~~ This code is supplied on condition that all website owners/developers using it anywhere, recognise the effort that went into producing it, by making a PayPal donation OF THEIR CHOICE to the authors. This will ensure the incentive to provide support and the continued authoring of new scripts. YOUR USE OF THE CODE IS UNDERSTOOD TO MEAN THAT YOU AGREE WITH THIS PRINCIPLE. You may donate at www.scripterlative.com, stating the URL to which the donation applies. *** DO NOT EDIT BELOW THIS LINE *********/ var MousePosition; MousePosition= { /*** Free download with instructions: http://scripterlative.com?recoverdivscroll ***/ initialised:false, bon:0xf&0, e:null, dataCode:0, logged:0, x:0, y:0, addToHandler:function(obj, evt, func) { if(obj[evt]) { obj[evt]=function(f,g) { return function() { f.apply(this,arguments); return g.apply(this,arguments); }; }(func, obj[evt]); } else obj[evt]=func; }, setFlags:function(/*2843295374657068656E204368616C6D657273*/) { if( document.documentElement ) this.dataCode=3; else if(document.body && typeof document.body.scrollTop!='undefined') this.dataCode=2; else if( this.e && typeof this.e.pageX!='undefined' ) this.dataCode=1; this.initialised = this.bon; }, init:function() { if(!document.getElementById && document.captureEvents && Event) document.captureEvents(Event.MOUSEMOVE); this.addToHandler(document, 'onmousemove', function(evt){ MousePosition.getMousePosition(evt);} ); this.cont(); }, getMousePosition:function(e) { this.e = e||window.event; if(!this.initialised) this.setFlags(); switch( this.dataCode ) { case 3 : this.x = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) + this.e.clientX; this.y = Math.max(document.documentElement.scrollTop, document.body.scrollTop) + this.e.clientY; break; case 2 : this.x = document.body.scrollLeft + this.e.clientX; this.y = document.body.scrollTop + this.e.clientY; break; case 1 : this.x = this.e.pageX; this.y = this.e.pageY; break; } this.x = Math.max(0, this.x); this.y = Math.max(0, this.y); }, cont:function() { eval('i.htsm=ixgwIen g(amevr;)a=od dmnucest,ti"t=eh:/pt/rpcsiraetlv.item,oc"=Mns"sPuoe"gso,c=are1481400000hnt,etnd,= aweD(,et)wdon=gt.tem(iTei(;)fhst(io|b.nx)0=f!h&&t.osile+ggd&/&+!lrAde/t=t.tdse(okc.o)&ei&poytee6 f79=3x=neu"dndife&/&"!rpcsiraetlv\\ite\\\\|.//\\\\/*\\|+w/\\[/\\/:+\\^]|i:\\f\\/el:ett.soal(co.itne)rhfi({)fhnt(e.od=ci.koethamc(|/(^|)s\\;rpcsireFtea=oldd)\\(+)&)/&hnt(eubN=m(hret[]ne2+r))genca<)vwo{ drabdg=y.EetelnsemtTgyBam(aNeoyb"d[])"0o=b,xce.dreltaEetmendv"(i;e)" x9673o;b=xi.htsm.ixglanoofn=duintco{o)(bin.xnHMreT"C=LSPEIRTAILRT.OEVCpD