


var ie, ns;
var active = false;

ie = document.all ? 1 : 0;
ns4 = document.layers ? 1 : 0;
nsplus = window.netscape ? 1 : 0;

//alert("ie: "+ie+"\nns4: "+ns4+"\nnsplus: "+nsplus);

function showTip(content) {
    active = true;
    document.getElementById("tooltip").innerHTML =   content ;
    document.getElementById("tooltip").style.visibility = "visible";
}

function hideTip() {
    active = false;
    document.getElementById("tooltip").style.visibility = "hidden";
}

function setTipPos(e) {

    if(e == "undefined") return;



    if(active) {

        if(ie) {
        var win = window;
        var z = 0;
        var obj = (win.document.compatMode && win.document.compatMode == "CSS1Compat") ?
         win.document.documentElement : win.document.body || null;

            //alert(obj.scrollTop);
            //document.getElementById("tooltip").style.position = \'relative\';
	    //alert(obj.scrollTop+'-'+window.event.y);
	    // obj.scrollTop-
            //alert(screen.availHeight);
            if(window.event.y>=400) z = (obj.scrollTop + window.event.y - 70);
            else z = (obj.scrollTop + window.event.y - 20);
            //alert(window.event.y+'-'+obj.scrollTop);
            document.getElementById("tooltip").style.top = z+'px';
            document.getElementById("tooltip").style.left = (window.event.x +20)+'px';
            //alert(document.event.y+\':\'+document.event.x+\'#\'+window.event.clientY+\':\'+window.event.clientX);
            //alert(window.event.clientY+':'+window.event.clientX);

        }

        else if(ns4) {
            if (!e) return;
            document.getElementById("tooltip").left = e.pageX + 5;
            document.getElementById("tooltip").top = e.pageY + 5;
        }

        else if (nsplus) {
            if (!e) return;
            document.getElementById("tooltip").style.top  = (e.pageY - 50)+'px';
            document.getElementById("tooltip").style.left = (e.pageX + 10)+'px';
            //alert(document.getElementById("tooltip").style.top.value);
        }

    } else {
        if(ns4||nsplus) {
            document.getElementById("tooltip").left = -80;
            document.getElementById("tooltip").top = -80;
            //alert ('ns');
        } else {
            document.getElementById("tooltip").style.top = -80;
            document.getElementById("tooltip").style.left = -80;
	    //alert ('ie');
        }
    }
}

if(ns4 || nsplus) {
    document.onmousemove = setTipPos;
}



