var n = (document.layers) ? 1 : 0; var inside = 0; var our_obj = 0; var was_cursor_init = 0;

function cursorInit(){
        maper = new marker('hint');
        if (n) document.captureEvents(Event.MOUSEMOVE);
        document.onmousemove = move;
        was_cursor_init = 1;
}
function b_moveIt(x,y){
        this.x = x; this.y = y;
        lay.left = this.x; lay.top = this.y;
}
function marker(obj){
        lay = (n)?eval('document.'+obj):eval('document.getElementById("'+obj+'").style');
        this.x = (n)?lay.left:lay.pixelLeft; this.y = (n)?lay.top:lay.pixelTop;
        this.moveIt = b_moveIt; return this;
}
function move(e){
        our_obj = e;
    var event = event || window.event;
        if (inside == 1)
    {
                x = n ? e.pageX : event ? event.x+document.body.scrollLeft : e.clientX+document.body.scrollLeft;
                y = n ? e.pageY : event ? event.y+document.body.scrollTop : e.clientY+document.body.scrollTop;
                maper.moveIt(x-15, y+15);
        }
}
function Show(ai,ui){        inside = 1;
        if ( was_cursor_init == 0 ) cursorInit(); if (our_obj != 0) move(our_obj);
    var ntext='Всего: '+ai+'.'
    if (ui>-1)
      ntext='Жамкай мышге.<br><br>'+ntext+'<br>У вас: '+ui+'.'
        if (n) {
                document.layers["hint"].document.open();
                document.layers["hint"].document.writeln(ntext);
                document.layers["hint"].document.close();
                document.layers["hint"].visibility = "visible";
        } else {
                document.getElementById("hint").innerHTML = ntext;
                document.getElementById("hint").style.visibility = "visible";
        }
}
function Out(){
        if ( was_cursor_init == 0 ) cursorInit(); inside = 0;
        lay.visibility = "hidden";
}

onload=cursorInit;

