// JavaScript Document
var offsetfrommouse=[-312,-38] //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var left_offsetfrommouse=[10,-38] //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0 //duration in seconds image should remain visible. 0 for always.

function gettrailobj(){
	if (document.getElementById)
		return document.getElementById(trailimageid).style
	else if (document.all)
		return document.all.trailimagid.style
}

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

function hidetrail(){
	gettrailobj().visibility="hidden"
	gettrailobj().display='none';
	document.onmousemove=""
}

function left_showtrail(){
	gettrailobj().display='block';
	var left_offsetfrommouse=[(gettrailobj().height)*-1,5];
	gettrailobj().visibility="visible"
	document.onmousemove=left_followmouse;
}

function left_followmouse(e){
	var xcoord=left_offsetfrommouse[0]
	var ycoord=left_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)
	
		gettrailobj().display=""
		gettrailobj().left=xcoord+"px"
		gettrailobj().top=ycoord+"px"
}
function showtrail(){
	gettrailobj().display='block';
	var offsetfrommouse=[(gettrailobj().height)*-1,5];
	gettrailobj().visibility="visible"
	document.onmousemove=followmouse;
}

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)
	if (xcoord+trailimageid[1]+3>docwidth || ycoord+trailimageid[2]> docheight)
		gettrailobj().display="none"
	else 
		gettrailobj().display=""
		gettrailobj().left=xcoord+"px"
		gettrailobj().top=ycoord+"px"
}

function info(title, description){
	document.getElementById('NoteCardTitle').innerHTML = title;
	document.getElementById('NoteCardDesc').innerHTML = description;
}

function Leftinfo(title, description){
	document.getElementById('LeftNoteCardTitle').innerHTML = title;
	document.getElementById('LeftNoteCardDesc').innerHTML = description;
}
