/* $Id: tooltip.js,v 1.6 2004/09/07 03:58:47 leth Exp $
   $Source: /home/leth/cvs/projects/lethweb/tooltip.js,v $

   Text Link/Image Map Tooltip Script- 
   Original version © Dynamic Drive (www.dynamicdrive.com)
   For full source code, and 100's more DHTML scripts
   Visit http://www.dynamicdrive.com
   Modified by Jim Leth
*/

if (!document.layers&&!document.all&&!document.getElementById)
    event="test"

function showtip(current, e, text, link) {
    if (document.all||document.getElementById) {
        current.title=text
    } else if (document.layers) {
        document.tooltip.document.write('<layer bgcolor="lightyellow" style="font-family:times; border: 1px">' + text + '</layer>')
        document.tooltip.document.close()
        document.tooltip.left=Math.min(e.pageX-10, window.innerWidth-document.tooltip.layers[0].clip.width-10)
        document.tooltip.top=e.pageY+10
        document.tooltip.visibility="show"
    }
    if (link.indexOf("/") == 0 || link.indexOf(":/") != -1) {
        /* Absolute URL */
        status=link
    } else {
        /* Relative URL */
        status=window.location.href.substring(0,window.location.href.lastIndexOf("/"))+'/'+link
    }
}

function hidetip() {
    if (document.layers)
        document.tooltip.visibility="hidden"
}
