// CREDITS:
// Christmas Cursor Trailer 2
// by Urs Dudli and Peter Gehrig 
// Copyright (c) 2001 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.com
// info@24fun.ch
// 12/3/2001

// IMPORTANT: 
// If you add this script to a script-library or script-archive 
// you have to add a link to http://www.24fun.com on the webpage 
// where this script will be running.

var step=8 
var stepbasic=8
var numberofimages=8
var spacebetweenimgs=32
var x,y
var flag=0
var xpos=new Array()

var ns6=document.getElementById&&!document.all?1:0

for (i=0;i<=8;i++) {
	xpos[i]=-100
}

var ypos=new Array()
for (i=0;i<=numberofimages;i++) {
	ypos[i]=-100
}

function handlerMM(e) {
	x = (document.layers || ns6) ? e.pageX : document.body.scrollLeft+event.clientX
	y = (document.layers || ns6) ? e.pageY : document.body.scrollTop+event.clientY
	flag=1
}

function initiatetracker() {
	if (document.all) {
		for (i=0; i<numberofimages; i++) {
    		var thisspan=eval("span"+(i)+".style")
			thisspan.posLeft=xpos[i]
			thisspan.posTop=ypos[i]
    		thisspan.visibility="visible"
    	}
		makesnake()
	}
    
   if (ns6) {
		for (i=0; i<numberofimages; i++) {
			document.getElementById("span"+i).style.left=xpos[i]
			document.getElementById("span"+i).style.top=ypos[i]
    		document.getElementById("span"+i).style.visibility="visible"
    	}
		makesnake()
	}
	if (document.layers) {
		for (i=0; i<numberofimages; i++) {
    		var thisspan=eval("document.span"+i)
			thisspan.left=xpos[i]
			thisspan.top=ypos[i]
			thisspan.visibility="visible"
		}

    	makesnake()
	}
}

function makesnake() {
	if (flag==1 && document.all) {
    	for (i=numberofimages; i>=1; i--) {
   			xpos[i]=xpos[i-1]+spacebetweenimgs
			ypos[i]=ypos[i-1]
    	}
		xpos[0]=x+stepbasic
		ypos[0]=y
	
		for (i=0; i<numberofimages; i++) {
    		var thisspan = eval("span"+(i)+".style")
    		thisspan.posLeft=xpos[i]
			thisspan.posTop=ypos[i]
    	}
	}
    
    if (flag==1 && ns6) {
    	for (i=numberofimages; i>=1; i--) {
   			xpos[i]=xpos[i-1]+spacebetweenimgs
			ypos[i]=ypos[i-1]
    	}
		xpos[0]=x+stepbasic
		ypos[0]=y
	
		for (i=0; i<numberofimages; i++) {
    		document.getElementById("span"+i).style.left=xpos[i]
			document.getElementById("span"+i).style.top=ypos[i]
    	}
	}
	
	else if (flag==1 && document.layers) {
    	for (i=numberofimages; i>=1; i--) {
   			xpos[i]=xpos[i-1]+spacebetweenimgs
			ypos[i]=ypos[i-1]
    	}
		xpos[0]=x+stepbasic
		ypos[0]=y
	
		for (i=0; i<numberofimages; i++) {
    		var thisspan = eval("document.span"+i)
    		thisspan.left=xpos[i]
			thisspan.top=ypos[i]
    	}
	}
		var timer=setTimeout("makesnake()",30)
}

if (document.layers){
	document.captureEvents(Event.MOUSEMOVE);
}

document.onmousemove=handlerMM;
window.onload=initiatetracker


// Snowflake
// Copyright Peter Gehrig and Urs Dudli
// http://www.24fun.com
// info@24fun.ch
// 12/3/1999
// All rights reserved


var marginbottom
var timer
var i_snow=0

// randomfunction
function randommaker(range) {		
	rand=Math.floor(range*Math.random())
    return rand
}

function initate() {
	if (document.all) {	
		marginbottom = document.body.clientHeight
		var thissnow = eval("document.all.snow"+i_snow+".style")
		thissnow.posLeft=(i_snow*40)-50
		thissnow.posTop=randommaker(marginbottom*2)-marginbottom
		if (i_snow >=24) {
			i_snow=0
			clearTimeout(timer)
			movesnow()
		}
		else {
			i_snow++
			initate()
		}	
	}
}

function movesnow() {
	if (document.all) {	
		for (i=0;i<=24;i++) {
			var thissnow = eval("document.all.snow"+i+".style")
			var rand=Math.floor(24*Math.random())
			thissnow.posLeft+=rand-12
			thissnow.posTop+=rand
			if (thissnow.posTop>=marginbottom){thissnow.posTop=-150}
		}
		timer=setTimeout("movesnow()",100)
	}
}