var isIE = navigator.userAgent.indexOf("MSIE") > -1;
var chelp_id = "chelp_div";
var CAPTION;

function nolPoint() {
    this.x = 0;
    this.y = 0;
}

function overlib(text, nada, title) {
    if (document.getElementById(chelp_id)) nd();
    var p = null;
    if (isIE) p = nolGetPointerLocation(window.event);
    else if (overlib.caller && overlib.caller.caller) {
        var c = overlib.caller.caller
        if (c.arguments && c.length > 0) {
            var p = nolGetPointerLocation(c.arguments[0]);
        }
    }
    if (p != null) {
    	var div = document.createElement("div");
        div.setAttribute("id", chelp_id);
        div.className = "chelp";
        div.style.left = (p.x + 10) + "px";
        div.style.top = (p.y + 10) + "px";
        div.innerHTML = title + "<hr>" + text;
        document.body.appendChild(div);
    }
}

function nd() {
    var el = document.getElementById(chelp_id);
    if (el) document.body.removeChild(el);
}


function nolGetPointerLocation(event) {
    var p = new nolPoint();
	if (isIE) {
		p.x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
		p.y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
	} else {
		p.x = event.clientX + window.scrollX;
		p.y = event.clientY + window.scrollY;
	}
    return p;
}
