//Positie tooltip vanuit cursor
var offsetfrommouse=[-22,-145];

//duration in seconds image should remain visible. 0 for always.
var displayduration=0;

// maximum image size.
var currentimageheight = 1000;

if (document.getElementById || document.all){
	document.write('<div id="trailimageid">');
	document.write('</div>');
}

function gettrailobj(){
	if (document.getElementById && document.getElementById("trailimageid"))
		return document.getElementById("trailimageid").style
	else if (document.all)
		return document.all.trailimagid.style
}

function gettrailobjnostyle(){
	if (document.getElementById && document.getElementById("trailimageid"))
		return document.getElementById("trailimageid")
	else if (document.all)
		return document.all.trailimagid
}


function truebody(){
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


function showtrail(imagename){
	document.onmousemove=followmouse;

	//hoogte,breedte van de animatie.
	var width = 200;
	var height = 100;

	//Hier wordt de html voor de tooltip opgebouwd.
	var newHTML = '';
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);

	extra1 = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">';
	extra2 = '</object>';

	temp = 	'<div style="width:'+width+'px;height:'+height+';>'+extra1+'<embed'
	+'		src="'+imagename+'"'
	+'		width="'+width+'"'
	+'		height="'+height+'"'
	+'		allowscriptaccess="sameDomain"'
	+'		allowfullscreen="false"'
	+'		wmode="transparent"'
	+'		/>'+extra2+'</div>';

	newHTML = newHTML + '<div align="center">';
	newHTML = newHTML += temp;
	newHTML = newHTML + '</div>';

	gettrailobjnostyle().innerHTML = newHTML;
}


function hidetrail()
{
	gettrailobj().visibility="hidden"
	gettrailobjnostyle().innerHTML=""
	document.onmousemove=""
	gettrailobj().left="-500px"
}



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)

	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"
	gettrailobj().visibility="visible";
}
