Cursor Trail

10:58:00 PM |

<script language="JavaScript">
<!--
/* Cursor Trail - Configurable and self contained

This script provides a "cursor trail" for newer browsers. It is
ignored by  by non compatible browsers.  The effect may be customized
by changing the values of configurable variables.

You may use the JavaScript source code on your own personal web page
provided that the copyright information remains in the source code.

To use the script:
1) Set values of Configurable Variables as needed.

2) Place the script somewhere in your HTML document, preferably
in the HEAD section.

Copyright (c) by: Robert N Bovara All Rights Reserved.
*/
////////////////////////////////////////////////
////
/// Start  Configurable Variables
//
////////////////////////////////////////////////

 var ObLth=5 // number of objects to use
 var ObXOff=20 // horizontal offset
 var ObYOff=40 // vertical offset
 var XDst=0 // horiz spacing between objects or radius
 var YDst=0 // vert spacing between objects
 var Opt=0 // 0='normal';1='rotating'
 var Obval='O' // text char for text trail; ignored when INam contains value
 var tsize=8 // initial font size
 var tszchg=2 // amt of change to font size
 var twgt=800 // initial font weight
 var twgtchg=100 // amt of font weight change
 var tcolr=new Array() // font colors for text trail
 for (i=0; i<(ObLth); i++){ // ensure font colors initialized
  tcolr[i]="dodgerblue" // aka "#1e90ff" or "rgb(30,144,255)"
 }

 var INam="" // prefix of image names for pic trail or empty for text
 var ITyp="gif" // image type for pic trail, e.g. gif, jpg

//////////////////////////////////////////////
////
/// End  Configurable Variables
//
//////////////////////////////////////////////

var agnt=navigator.userAgent.toLowerCase()
var webTV = (agnt.indexOf("webtv") != -1);
var hotjava=(agnt.indexOf("hotjava") != -1)
var opera=(agnt.indexOf("opera") != -1)
var layr= (document.layers&&!hotjava)
var doc_all=(document.all&&!webTV)
var itsa5 = (document.getElementById&&parseInt(navigator.appVersion)>=5) ? true : false;
var Lvl=(opera?0:(doc_all?2:(itsa5?3:(layr?1:0))));
var strtWidth
var strtHeight

if (Lvl>0) {
 if (ObLth<1) ObLth=1
 var pi=Math.PI
 var HIDE = (layr) ? 'hide' : 'hidden';
 var SHOW = (layr) ? 'show' : 'visible';
 var ObLst=new Array()
 var pnt = new Array();
 var ssize=tsize
 pnt[0] = 0;
 document.write("<STYLE ID='jsid4cursrtrail' TYPE='text\/css'><\/style>")
 for (i=0; i<(ObLth); i++){
  tszpt=tsize+"pt"
  if (layr) {
   eval("document.ids.Crs"+i+".position='absolute';")
   eval("document.ids.Crs"+i+".visibility='hidden';")
   eval("document.ids.Crs"+i+".fontFamily='verdana,Tahoma,arial,helvetica,sans-serif';")
   eval("document.ids.Crs"+i+".fontSize=tszpt;")
   eval("document.ids.Crs"+i+".color=tcolr[i];")
   eval("document.ids.Crs"+i+".fontWeight=twgt;")
  }
  else if (doc_all){
   document.styleSheets["jsid4cursrtrail"].addRule ("body", "overflow:scroll;");
   document.styleSheets["jsid4cursrtrail"].addRule ("#Crs"+i, "position:absolute;");
   document.styleSheets["jsid4cursrtrail"].addRule ("#Crs"+i, "visibility:hidden;");
   document.styleSheets["jsid4cursrtrail"].addRule ("#Crs"+i, "font-family:verdana,Tahoma,arial,helvetica,sans-serif;");
   document.styleSheets["jsid4cursrtrail"].addRule ("#Crs"+i, "font-size:" + tszpt);
   document.styleSheets["jsid4cursrtrail"].addRule ("#Crs"+i, "color:" + tcolr[i]);
   document.styleSheets["jsid4cursrtrail"].addRule ("#Crs"+i, "font-weight:" + twgt);
  }
 if (INam!="") Obval="<img src='"+INam+i+"."+ITyp+"' border=0>"
 var Style=""
 if(Lvl>1) Style="position:absolute;visibility:hidden;overflow:hidden;"
 document.writeln("<div id='Crs"+i+"' style='"+Style+";'>"+Obval+"<\/div>")
 pnt[i+1] = parseFloat(pnt[i] + ((2 * pi) / ObLth));
 if (500<twgt) twgt-=twgtchg
 tsize+=tszchg
 }
 var ptr=0
 var delay=100
 if (Opt!=0) delay=10
 var hptr=ObLth
 var Xloc=0
 var Yloc=0
 var moving
 var hiding
 var XSign=1
 var YSign=1
 var savX=XDst
 var savY=YDst
 if (XDst<0) XSign=-1
 if (YDst<0) YSign=-1
}

function GetEm(e){
 moving=true
 if (hiding) clearTimeout(hiding);
 Xloc=(doc_all?event.clientX+document.body.scrollLeft:(Lvl>2?e.clientX+window.scrollX:e.pageX));
 Yloc=(doc_all?event.clientY+document.body.scrollTop:(Lvl>2?e.clientY+window.scrollY:e.pageY));
 if (XDst!=savX) XDst+=.5*XSign
 if (YDst!=savY) YDst+=.5*YSign
 hptr=ObLth
 hiding=setTimeout("HidEm()",600)
}

function MovEm(){
 if (ObLth<=ptr) ptr=0
 if (doc_all) ObLst[ptr].width=document.body.clientWidth
 if (Opt==0) {
  ObLst[ptr].left=Xloc+ObXOff+(XDst*(ObLth-ptr))
  ObLst[ptr].top=Yloc+ObYOff+(YDst*(ObLth-ptr))
 }
 else {
  pnt[ptr]+=.1
  ObLst[ptr].left=Xloc+ObXOff+0+(XDst * Math.cos(pnt[ptr]))
  ObLst[ptr].top=Yloc+ObYOff+0+(YDst * Math.sin(pnt[ptr]))
 }
 if (moving) ObLst[ptr].visibility=SHOW
 ptr++
 setTimeout("MovEm()",delay)
 moving=false
}

function HidEm(){
 if (moving) {
  hiding=setTimeout("HidEm()",600)
  return
 }
 if (XDst!=0) XDst-=(.5*XSign)
 if (YDst!=0) YDst-=(.5*YSign)
 if (XDst==0&&YDst==0) {
  hptr--
  if (hptr<0) {return}
  ObLst[hptr].visibility=HIDE
 }
 hiding=setTimeout("HidEm()",10)
}

function NNlode(){
 if (self.innerWidth!= strtWidth||self.innerHeight!=strtHeight) {
  window.location.reload()
 }
}

function StartEm() {
 if (Lvl>0) {
  tsize=ssize
  for (i=0; i<(ObLth); i++){
   eval("var Crs"+i+" =(doc_all?document.all.Crs"+i+".style:(itsa5?document.getElementById('Crs"+i+"').style:(layr?document.Crs"+i+":'')));")
   ObLst[i]=eval("Crs"+i)
   ObLst[i].zIndex=1999+i
   if (Lvl>2){
    tszpt=tsize+"pt"
    ObLst[i].fontFamily="verdana,Tahoma,arial,helvetica,sans-serif"
    ObLst[i].fontSize=tszpt
    ObLst[i].fontWeight=twgt
    ObLst[i].color=tcolr[i]
    if (500<twgt) twgt-=twgtchg
    tsize+=tszchg
   }
  }
  if(layr) {
   if (parent.frames.length!=0) {
    strtWidth = self.innerWidth;
    strtHeight = self.innerHeight;
    self.onresize=NNlode
   }
   document.captureEvents(Event.MOUSEMOVE)
  }
  document.onmousemove=GetEm
  MovEm()
 }
}
window.onload=StartEm
// -->
</script>