var b_IE = navigator.userAgent.indexOf('MSIE') > -1;
var move = false;
var hintX;
var hintY;
var hintOffsetX = 15;
var hintOffsetY = 10;
if (window.innerHeight != null) {
        getWinSz = function (b_hight) { return b_hight ? innerHeight : innerWidth; }
        getWinSc = function (b_hight) { return b_hight ? pageYOffset : pageXOffset; }
} else {
        getWinSz = function (b_hight) { return document.body[b_hight ? 'clientHeight' : 'clientWidth']; };
        getWinSc = function (b_hight) { return document.body[b_hight ? 'scrollTop' : 'scrollLeft']; };
}
getSize = function (b_hight) {
        return b_hight ? document.getElementById("hint").style.pixelHeight : document.getElementById("hint").style.pixelWidth;
};
document.onmousemove = b_IE || window.opera
? function () {
        hintX = event.clientX + document.body.scrollLeft;
        hintY = event.clientY + document.body.scrollTop;
        if (move!=false) moveHint();
        return true;
}
: function (e) {
        hintX = e.pageX;
        hintY = e.pageY;
        if (move!=false) moveHint();
        return true;
};
var divtext = "?????... ???? ???????? ??????? ????????? ????.";
document.write ('<div id="hint" align="left" style="visibility:hidden;position:absolute;top:0px;left:0px;width:500px;">'+divtext+'</div>');

function ShowHint (inforum,intopic) {
        if (document.layers) return;
        HideHint();
        window.frames['hidden_frame'].location.href = 'hints.php?inforum='+inforum+'&intopic='+intopic;
        document.getElementById("hint").style.visibility = "visible";
        moveHint();
        move=true;
}

function HideHint () {
        if (document.getElementById("hint").style.visibility == "visible" ) {
                document.getElementById("hint").style.visibility = "hidden";
                document.getElementById("hint").innerHTML= divtext;
                move = false;
        }
}

function moveHint () {
        var n_x = hintX + hintOffsetX;
        var n_y = hintY + hintOffsetY;
        var n_w = getSize(false), n_h = getSize(true);
        var n_win_w = getWinSz(false), n_win_h = getWinSz(true);
        var n_win_l = getWinSc(false), n_win_t = getWinSc(true);
        if (n_x + n_w > n_win_w + n_win_l) n_x = n_win_w + n_win_l - n_w-25;
        if (n_x < n_win_l) n_x = n_win_l;
        if (n_y + n_h > n_win_h + n_win_t) n_y = n_win_h + n_win_t - n_h;
        if (n_y < n_win_t) n_y = n_win_t;
        document.getElementById("hint").style.left = n_x;
        document.getElementById("hint").style.top = n_y;
}
