﻿
var offsetfromcursorX=8         //Customize x offset of tooltip -100 for left side
var offsetfromcursorY=-196      //Customize y offset of tooltip -200

var offsetdivfrompointerX=60    //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=-200  //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="images/pointer.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
    var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
    if (ns6||ie){
        if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
        if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
        tipobj.innerHTML=thetext
        enabletip=true
        return false
    }
}

function positiontip(e){
if (enabletip){
    var nondefaultpos=false

    var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
    var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
    
    //Find out how close the mouse is to the corner of the window
    var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
    var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

    var rightedge=ie&&!window.opera? iXpos+offsetfromcursorX : winwidth-iXpos+offsetfromcursorX
    var bottomedge=ie&&!window.opera? iYpos-offsetfromcursorY : winheight-iYpos+offsetfromcursorY

    if (winwidth<800){
        tipobj.style.left=winwidth-500;
        nondefaultpos=true
    }
    else{
        //position the horizontal position of the menu to the right of the link
        tipobj.style.left=iXMain+iXpos+offsetdivfrompointerX+"px"
        pointerobj.style.left=iXMain+iXpos+offsetfromcursorX
    }
    
    //position the vertical position of the menu 2/3 from the center edge of the link
    if (winheight<600){ //for those super blind-ass dipshit low resolution dumb fucks!
        tipobj.style.top=iYpos-(tipobj.offsetHeight/2) //iYpos-tipobj.offsetHeight;
        nondefaultpos=true
    }
    else{
        tipobj.style.top=iYMain+iYpos+offsetdivfrompointerY+"px"
        pointerobj.style.top=iYMain+iYpos+"px"
    }
    
    tipobj.style.visibility="visible"
    if (!nondefaultpos)
        pointerobj.style.visibility="visible"
    else
        pointerobj.style.visibility="hidden"
    }
}

function hideddrivetip(){
    if (ns6||ie){
        enabletip=false
        tipobj.style.visibility="hidden"
        pointerobj.style.visibility="hidden"
        tipobj.style.left="-1000px"
        tipobj.style.backgroundColor=''
        tipobj.style.width=''
    }
}