

var thedoc = top.document;
var tooltip;
var lasttext;

var eventX = null;
var eventY = null;


function showToolTip(evt,text,x,y,w) {

	// req ie 5.5+
	if (navigator.userAgent.indexOf('MSIE') > 0) isIE = true; else isIE = false;

	if (text.length == 0) return true;
	
	if (!(tooltip)) {
		if (isIE) {
			tooltip = window.createPopup();
			bod = tooltip.document.body;
		} else {
			tooltip = document.createElement('DIV'); //new Div('hello');
			document.body.appendChild(tooltip);
			bod = tooltip;
		}
		if (isIE) {
			bod.scroll = "no";
			bod.leftMargin = "0";
			bod.topMargin = "0";
			bod.rightMargin = "0";
			bod.bottomMargin = "0";
		}
		bod.className = "tooltip"
		bod.style.cssText = "position:fixed; padding:2px 4px; margin-bottom:2px; background:#FFFFE7; border:1px solid black; font-size:8pt; color:#000000; font-family:arial";

	} else if (isIE) {
		bod = tooltip.document.body;
	} else {
		bod = tooltip;
	}
	
	bod.innerHTML = text;
	
	if (isIE) {
		divX = top.screenLeft + evt.clientX + 6 + x; 
		divY = top.screenTop + evt.clientY + 12 + y; 
		tooltip.show(divX, divY, w, bod.scrollHeight)	;
	} else {
		tooltip.style.left = evt.clientX + 6 + 'px';
		tooltip.style.top = evt.clientY + 12 + 'px';
		tooltip.style.visibility = 'visible';
	}

}

function hideToolTip() {
	if (!(tooltip)) return;
	if (isIE) 
		tooltip.hide();
	else
		tooltip.style.visibility = 'hidden';
}


