
agropropsActiveHelpBox = null;

function agropropsGetCursorPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    }
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX +
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY +
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
}

function agropropsUpdatePopupWin(e) {
    if (agropropsActiveHelpBox != null) {
        position = agropropsGetCursorPosition(e);
        x = position.x;
        y = position.y;
        agropropsActiveHelpBox.style.left = (x + 20) + "px";
        agropropsActiveHelpBox.style.top  = (y + 10) + "px";
    }
}

function agropropsShowPopupWin(id) {
    agropropsActiveHelpBox = document.getElementById(id);
    agropropsActiveHelpBox.style.display = "block"
}

function agropropsHidePopupWin() {
    agropropsActiveHelpBox.style.display = "none";
    agropropsActiveHelpBox = null;
}

document.onmousemove = agropropsUpdatePopupWin;

