if (!__mouse_trail__)
{
	var __mouse_trail__ = true;
	var MousePosX = 0;
	var MousePosY = 0;
	function getScrollX() {
		if (window.innerHeight) {
			// NS & Mozila
			return window.pageXOffset;
		} else {
			// IE & Opera
			return document.body.scrollLeft;
		}
	}
	function getScrollY() {
		if (window.innerHeight) {
			// NS & Mozila
			return window.pageYOffset;
		} else {
			// IE & Opera
			return document.body.scrollTop;
		}
	}

	function MoveHandler(e)
	{
		MousePosX = e.pageX;
		MousePosY = e.pageY;  
		return true;
	}

	// just save mouse position for animate() to use
	function MoveHandlerIE(e)
	{
		if (e)
		{
			return MoveHandler(e)
		} else {
			MousePosX = window.event.x+getScrollX();
			MousePosY = window.event.y+getScrollY();  
		}
	}

	if (!document.getElementById)
	{
		document.captureEvents(Event.MOUSEMOVE);
		document.onMouseMove = MoveHandler;
	} else {
		document.onmousemove = MoveHandlerIE;
	}

	function mouseTrail(divArr, name)
	{
		this.points = new Array();
		for (var i=0; i<divArr.length; i++)
		{
			this.points[this.points.length] = new mouseTrailPoint(0,0,divArr[i]);
		}
		this.name=name;
		this.start = mouseTrail_start;
	}
	function mouseTrail_start()
	{
		setInterval("mouseTrailGo('"+this.name+"')",40);
	}
	function mouseTrailPoint(x, y, name)
	{
		this.x = x;
		this.y = y;
		this.obj = getLayer(name);
		this.obj = this.obj.style;
		this.moveTo = mouseTrailPoint_moveTo;
		this.move = mouseTrailPoint_move;
	}
	function mouseTrailPoint_moveTo(dx, dy)
	{
		if (checkPointX(this.x + dx))
		{
			this.x += dx;
		}
		if (checkPointY(this.y + dy))
		{
			this.y += dy;
		}
		this.obj.left = this.x;
		this.obj.top = this.y;
	}
	function checkPointX(x)
	{
		x += 46;
		return (x < document.body.scrollWidth);
	}
	function checkPointY(y)
	{
		y += 46;
		return (y < document.body.scrollHeight);
	}
	function mouseTrailPoint_move(x, y)
	{
		this.x = x;
		this.y = y;
		if (!checkPointX(x))
		{
			this.x = document.body.scrollWidth - 46;
		}
		if (!checkPointY(y))
		{
			this.y = document.body.scrollHeight - 46;
		}
		this.obj.left = this.x;
		this.obj.top = this.y;
	}
	function mouseTrailGo(trailName)
	{
		eval("var trailObj = "+trailName);
		var cntPoints = trailObj.points.length;
		for (var i=0; i<cntPoints; i++)
		{
			if (i==0)
			{
				trailObj.points[i].move(MousePosX+10, MousePosY+10);
			} else {
				var dx = (trailObj.points[i-1].x - trailObj.points[i].x)/2;
				var dy = (trailObj.points[i-1].y - trailObj.points[i].y)/2;
				trailObj.points[i].moveTo(dx,dy);
			}
		}
	}
}