var timerID;
var featureDescriptions = Array();

function offsetCalc(calcObject, axis) {
	var thisOffset;
	eval("thisOffset=calcObject.offset" + axis);
	if (calcObject.offsetParent) {
		return thisOffset + offsetCalc(calcObject.offsetParent, axis);
	} else {
		// Mac IE work-around -- adds XXpx, compensating for css body margin-top
		if (axis=="Top" && navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.indexOf("Macintosh")!=-1) {
			return thisOffset + 0;
		} else {
			return thisOffset;
}	}	}

function tooltipOpen(featureId) {
	timerID=setTimeout("tooltipDisplay('" + featureId + "')",750);
}

function tooltipDisplay(featureId) {
	popup = document.getElementById("popupContainer");
	popText = document.getElementById("popupText");
	targetFeature = document.getElementById(featureId);
	featureX=offsetCalc(targetFeature, "Left") + 12;
	featureY=offsetCalc(targetFeature, "Top") + 12;
	popText.innerHTML=featureDescriptions[featureId];
	popup.style.left=featureX + "px";
	popup.style.top=featureY + "px";
	popup.style.visibility="visible";
}

function tooltipClose() {
	clearTimeout(timerID);
	popup = document.getElementById("popupContainer");
	popup.style.visibility="hidden";	
}
