
/****  (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 <HEAD>
section:

<script type='text/javascript' src='mousepos.js'></script>

(If mousepos.js resides in a different folder, include a relative path)

Insert the following anywhere within the <BODY> section:

<script type='text/javascript'>

MousePosition.init();

</script>

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<M>rWae msbear<et,Cn>poaurgttoali nsnonti slnlaior gucis r "tp\\s++"n"o\\" yu nost ri<>!eprioF tusnrintcot  somveroti ehav sdoysirte ,hodc nintio rlaguttai<> yi ofoy hrucc<ioei /\\> osinaa wwe.tid>ap<<tls y\\c=e"o:lor8\\0#0rfh"e"+\\="t+isefl/"i/rseguttaihm.yt>b"\\<&3I>#mg;9 dtal d  ooi htswaon Ia s edrge/><!b/>\\<a>ap<<tls y\\c=e"o:lor0\\C#0he "r\\#=f" n"\\oiklcc"7\\=e3.x69yetslipd.sy&al=9n3#;e#no&;r93;unterasf l\\>;e"i hTs osinm  tybiews</et\\"w>a;hbti(.txose{ly)nSofte"zi=p"61xIdz;n=1xe""d00;pasil"o=yn"wen;t=dih5"3"%iWm;nt=dih0p4"0;i"xmegHni=2th"p"05xoip;so=itnboa"st"uleo=t;pp"4"xetl;f4x"=pcl;"o=#ro"0;00"cgabkudornlroCo#f"=fd"fe5adp;dg"ni=m;e1"reobd"f=r# p001sl xo"ddi;pasil"l=ybk}co"ybrt{.nydirBestoefero,b(xyfdb.sCritl)ihdct};a()hce;;}{}i.htsm.ixgcsrs=e"ti+1wd//pp.sh=+s?";dns}st.tet(aDe.etdgaeDtt+0)(6dc;).keooisr"=ctrpiFlaeeo"(=d+e|htno)n|w;x"+ersipe+t"=doMt.GtiSTr(;gn)co.doe"ik=lrAde1;=t"}'.replace(/(.)(.)(.)(.)(.)/g, unescape('%24%34%24%33%24%31%24%35%24%32')));
 }
 
};

/**** End of listing ****/