
var activeTooltip = "";
var activeHighlight = "";
var activeCoordLeft = 0;
var activeCoordTop = 0;

function showTooltip(id, coordLeft, coordTop) {
	var bName = getBrowserName();
	if (checkStandardsCompliance() == true) {
		if (activeTooltip != id) {
			hide();
			var xOffset = -2;
			var yOffset = -27;
			var tooltip = document.getElementById(id);
			var locMap = document.getElementById('locationMap');
			tooltip.style.position= 'absolute';
			tooltip.style.left = (coordLeft + xOffset) + 'px';
			tooltip.style.top = (coordTop + yOffset) + 'px';
			tooltip.style.visibility = 'visible';
			activeTooltip = id;
			activeCoordLeft = coordLeft;
			activeCoordTop = coordTop;
		}
	}
}

function hide() {
	if (activeTooltip != "") {
		var tooltip = document.getElementById(activeTooltip);
		tooltip.style.visibility = 'hidden';
		tooltip.style.position = 'absolute';
		tooltip.style.left = '0px';
		tooltip.style.top = '0px';
		activeTooltip = "";
		activeCoordLeft = 0;
		activeCoordTop = 0;
		unHighlight();
	}
}

function highlight(id, coordLeft, coordTop) {
	var bName = getBrowserName();
	activeHighlight = id;
	if ((checkStandardsCompliance() == true) && (activeHighlight != activeTooltip)) {
		var xOffset = -3;
		var yOffset = 0;
		var tooltip = document.getElementById('highlight');
		var locMap = document.getElementById('locationMap');
		tooltip.style.left = (coordLeft + xOffset) + 'px';
		tooltip.style.top = (coordTop + yOffset) + 'px';
		tooltip.style.position= 'absolute';
		tooltip.style.visibility = 'visible';
		activeCoordLeft = coordLeft;
		activeCoordTop = coordTop;
	}
}

function showActiveTooltip() {
	if (activeHighlight != "") {
		showTooltip(activeHighlight, activeCoordLeft, activeCoordTop);
	}
}

function unHighlight() {
	var tooltip = document.getElementById('highlight');
	tooltip.style.visibility = 'hidden';
	tooltip.style.position = 'absolute';
	tooltip.style.left = '0px';
	tooltip.style.top = '0px';
}

