var mousePosY = 0;
var mousePosX = 0;

var glossary = function() {
	//for MSIE or W3C-DOM
	if(document.all || document.getElementById) {
		//set the offset of the tooltip-box
		this.innerOffset = 10;
		//the position of the parent-element
		this.correctionTop = 16;
		this.correctionLeft = 55;
		//the width of the tooltip-window
		this.windowWidth = 470;
	}
}

glossary.prototype.show = function(term) {
	//for MSIE or W3C-DOM
	if(document.all || document.getElementById) {
		var termNode = document.getElementById(term);

		//put the glossary-term, where the anchor is
		termNode.style.top = (mousePosY+this.innerOffset-this.correctionTop)+"px";
		termNode.style.left = (mousePosX+this.innerOffset-this.correctionLeft-(this.windowWidth/2))+"px";

		//now we make it visible
		termNode.style.display = "block";
	}
}

glossary.prototype.hide = function(term) {
	//for MSIE or W3C-DOM
	if(document.all || document.getElementById) {
		var termNode = document.getElementById(term);

		//now we make it invisible
		termNode.style.display = "none";

		//put the glossary-term to 0,0
		termNode.style.top = "0px";
		termNode.style.left = "0px";
	}
}

glossary.prototype.captureMouse = function(myEvent) {
	if(window.event) {
		mousePosX = window.event.clientX+document.body.scrollLeft;
		mousePosY = window.event.clientY+document.body.scrollTop;
	}
	else {
		mousePosX = myEvent.pageX;
		mousePosY = myEvent.pageY;
	}
}
