            // position of the tooltip relative to the mouse in pixel //
            var offsetx = 8;
            var offsety =  12;
            var toolTipTimmer = 0;

            function findPos(obj) {
                var curleft = curtop = 0;
            
                if (obj.offsetParent) {
                    do {
                        curleft += obj.offsetLeft;
                        curtop += obj.offsetTop;
                    } while (obj = obj.offsetParent);
                    
                }
                return [curleft,curtop];
            }


            function newelement(newid)
            { 
                if(document.createElement)
                { 
                    var el = document.createElement('div'); 
                    el.id = newid;     
                    with(el.style)
                    { 
                        display = 'none';
                        position = 'absolute';
                    } 
                    el.innerHTML = '&nbsp;'; 
                    document.body.appendChild(el); 
                } 
            } 
            var ie5 = (document.getElementById && document.all); 
            var ns6 = (document.getElementById && !document.all); 
            var ua = navigator.userAgent.toLowerCase();
            var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);
            
            function getmouseposition(e)
            {
                if(document.getElementById)
                {
                    var iebody=(document.compatMode && 
                        document.compatMode != 'BackCompat') ? 
                            document.documentElement : document.body;
                    pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset);
                    pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
                    mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false;
                    mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false;
                    
                    var winWidth,winHeight;
                    if (self.innerHeight) // all except Explorer
                    {
                        winWidth = self.innerWidth;
                        winHeight = self.innerHeight;
                    }
                    else if (document.documentElement && document.documentElement.clientHeight)
                        // Explorer 6 Strict Mode
                    {
                        winWidth = document.documentElement.clientWidth;
                        winHeight = document.documentElement.clientHeight;
                    }
                    else if (document.body) // other Explorers
                    {
                        winWidth = document.body.clientWidth;
                        winHeight = document.body.clientHeight;
                    }

                    var lixlpixel_tooltip = document.getElementById('tooltip');
                    if (mousex > (winWidth / 2)) {
                        lixlpixel_tooltip.style.left = (mousex-pagex-(offsetx / 2)-lixlpixel_tooltip.offsetWidth) + 'px';
                    } else {
                        lixlpixel_tooltip.style.left = (mousex+pagex+offsetx) + 'px';
                    }
                    if (mousey > (winHeight / 2)) {
                        lixlpixel_tooltip.style.top = (mousey-pagey-(offsety / 2)-lixlpixel_tooltip.offsetHeight) + 'px';
                    } else {
                        lixlpixel_tooltip.style.top = (mousey+pagey+offsety) + 'px';
                    }
                }
            }
            function tooltip(tipObject)
            {
                var tip = tipObject.getAttribute('tooltip');
                if(!document.getElementById('tooltip')) newelement('tooltip');
                var lixlpixel_tooltip = document.getElementById('tooltip');
                
                //tipObject.appendChild(lixlpixel_tooltip.parentNode.removeChild(lixlpixel_tooltip));
                
                lixlpixel_tooltip.innerHTML = tip;
                lixlpixel_tooltip.style.display = 'block';
                
                    var winWidth,winHeight;
                    if (self.innerHeight) // all except Explorer
                    {
                        winWidth = self.innerWidth;
                        winHeight = self.innerHeight;
                    }
                    else if (document.documentElement && document.documentElement.clientHeight)
                        // Explorer 6 Strict Mode
                    {
                        winWidth = document.documentElement.clientWidth;
                        winHeight = document.documentElement.clientHeight;
                    }
                    else if (document.body) // other Explorers
                    {
                        winWidth = document.body.clientWidth;
                        winHeight = document.body.clientHeight;
                    }
                    
                    var objPos = findPos(tipObject);

                    var lixlpixel_tooltip = document.getElementById('tooltip');
                    if (tipObject.offsetLeft > (winWidth / 2)) {
                        lixlpixel_tooltip.style.left = ((lixlpixel_tooltip.offsetWidth * -1) + objPos[0] + tipObject.offsetWidth ) + 'px';
                    } else {
                        lixlpixel_tooltip.style.left = objPos[0] + 'px';
                    }
                    if (tipObject.offsetTop > (winHeight / 2)) {
                        lixlpixel_tooltip.style.top = ((lixlpixel_tooltip.offsetHeight + 8) * -1) + objPos[1] + 'px';
                    } else {
                        lixlpixel_tooltip.style.top = objPos[1] + (tipObject.offsetHeight + 8) + 'px';
                    }
                
                /*
                getmouseposition();
                document.onmousemove = getmouseposition;
                */
            }
            function exit()
            {
                try {
                    document.getElementById('tooltip').style.display = 'none';
                } catch(e) {}                    
            }        
            
            function setTooltipTimer(tipObject) {
                toolTipTimmer = setTimeout(function(){tooltip(tipObject)},500);
            }
            
            function exitTooltipTimer() {
                clearTimeout(toolTipTimmer);
                exit();
            }
        
        
            function setTooltips(theElement) {
                for (var i = 0; i < theElement.childNodes.length; i++) {
                    setTooltips(theElement.childNodes[i]);
                }
                try {
                if (theElement.getAttribute('tooltip')) {
                    //theElement.style.borderBottom = '1px solid #eee';
                    /*
                    theElement.onmouseover = tooltip;
                    theElement.onmouseout = exit;
                    */
                    theElement.onmouseover = function(){setTooltipTimer(theElement)};
                    theElement.onmouseout = exitTooltipTimer;
                    //alert(theElement.getAttribute('tooltip'));
                }
                } catch(e) {}
            }
            
            addLoadEvent(function(){setTooltips(document.body)});
            
            
