/* see ../css/tooltip.css */
var tt = null;
var visible = false;
var xOffset = -10;
var yOffset = 18;

var mouseDownX = 0;
var mouseDownY = 0;

// param: event - the mouse event
// return: none
// global: set mouseDownX and mouseDownY
function showPosition(event) {
	if (window.event) {
		x = window.event.clientX;
		y = window.event.clientY;
	} else {
		x = event.clientX;
		y = event.clientY;
	}
	mouseDownX = x;
	mouseDownY = y;
}

// param: divId - id of surrounding of the tooltip div
//        anchorId - id of 'mehr' anchor
// return: none
function toggleTt(divId, anchorId) {
	if(visible == true) {
		tt.style.display = "none";
		visible = false;
	} else {
		// get tooltip
		tt = document.getElementById(divId);
				
		tt.style.left = (mouseDownX + xOffset) + "px";
		tt.style.top 	= (mouseDownY + yOffset) + "px";		
		tt.style.display = "block";
		visible = true;
	}	
}