// JavaScript Document
/*

This cool code is for doing the nice mouse overs that follow the curser.

Original script from http://javascriptkit.com/script/script2/simpleimagetrail.shtml
but I've heavily modified it for my own use

*/
var offsetfrommouse=[10,10] //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset

if (document.getElementById || document.all)


function getmousetrailobj(){
if (document.getElementById)
return document.getElementById("mouse")
else if (document.all)
return document.all.mouse
}

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidemousetrail(){
	document.onmousemove="";
	getmousetrailobj().style.visibility="hidden";
	getmousetrailobj().style.width = "1px";
	getmousetrailobj().style.height = "1px";
}

/*
It's better not to leave the width blank because in Opera, the box ends
up spanning across the entire page if the width is set to "auto"
*/
function unhidemousetrail(content, boxwidth, boxheight){
	document.onmousemove=followmouse;
	getmousetrailobj().innerHTML = content;
	//set the width
	if(boxwidth == 0 || boxwidth == null){
		getmousetrailobj().style.width = "";
	} else {
		getmousetrailobj().style.width = boxwidth+"px";
	}
	if(boxheight == 0 || boxheight == null){
		getmousetrailobj().style.height = "auto";
	} else {
		getmousetrailobj().style.height = boxheight+"px";
	}
	
	getmousetrailobj().style.visibility = "visible";

}

function followmouse(e){
	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]
	if (typeof e != "undefined"){
		xcoord+=e.pageX
		ycoord+=e.pageY
	}else if (typeof window.event !="undefined"){
		xcoord+=truebody().scrollLeft+event.clientX
		ycoord+=truebody().scrollTop+event.clientY
	}
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
	
	getmousetrailobj().style.display=""
	getmousetrailobj().style.left=xcoord+"px"
	getmousetrailobj().style.top=ycoord+"px"
}
