

 

/*
Script by Mike McGrath- http://website.lineone.net/~mike_mcgrath
Featured on JavaScript Kit (http://javascriptkit.com)
For this and over 400+ free scripts, visit http://javascriptkit.com
*/

var nav = (document.layers);

var tmr = null;
var spd =50;
var x = 0;
var x_offset = 5;
var y = 0;
var y_offset = 15;

if(nav) document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = get_mouse; 

function get_mouse(e)
{    
if(nav)	{x=e.pageX;y=e.pageY;}
else if(e){ x=e.clientX+document.body.scrollLeft;y=e.clientY+document.body.scrollTop;}
else{ x=event.clientX+document.body.scrollLeft;y=event.clientY+document.body.scrollTop;}
  x += x_offset;
  y += y_offset;
  beam(1);     
}

function beam(n)
{
	divID="div"+n;
	sparkleDiv=document.getElementById("div"+n);

  if(n<5)
  {
    if(nav)
    { 
      sparkleDiv.top=y;
      sparkleDiv.left=x;
      sparkleDiv.visibility='visible';
    }  
    else
    {
      sparkleDiv.style.top=y;
      sparkleDiv.style.left=x;
      sparkleDiv.style.visibility='visible';
    }
    n++;
    tmr=setTimeout("beam("+n+")",spd);
  }
  else
  {
     clearTimeout(tmr);
     fade(4);
  }   
} 

function fade(n)
{
	sparkleDiv=document.getElementById("div"+n);

  if(n>0) 
  {
    if(nav) sparkleDiv.visibility='hidden';
    else sparkleDiv.style.visibility='hidden'; 
    n--;
    tmr=setTimeout("fade("+n+")",spd);
  }
  else clearTimeout(tmr);
} 

function snapIn(jumpSpaces,position) { 
	var msg = "he had a beard, he was in the goodies.... "; 
  	var out = ""; 
	for (var i=0; i<position; i++) 
	{ 	
		out += msg.charAt(i) 
	} 
	for (i=1;i<jumpSpaces;i++) 	
	{ 
		out += " " 
	} 
	out += msg.charAt(position); 
	window.status = out; 
	if (jumpSpaces <= 1) { position++; if (msg.charAt(position) == ' ') { position++ } jumpSpaces = 100-position } else if 
(jumpSpaces >  3) { jumpSpaces *= .09 } else { jumpSpaces-- } if (position != msg.length) { var cmd = "snapIn(" + jumpSpaces + "," + position + ")"; 
window.setTimeout(cmd,10); } return true }

// -->
