 function enableTooltips(id){
    var links,spans, divs, inputs,i,h;
    if(!document.getElementById || !document.getElementsByTagName) return;
    h=document.createElement("span");
    h.id="btc";
    h.style.zIndex=21;
    h.setAttribute("id", "btc");
    h.style.position="absolute";
    document.getElementsByTagName("body")[0].appendChild(h);
    if(id==null){
        links=document.getElementsByTagName("a");
        spans=document.getElementsByTagName("span");
        divs=document.getElementsByTagName("div");
        inputs=document.getElementsByTagName("input");
    }else{
        links=document.getElementById(id).getElementsByTagName("a");
        spans=document.getElementById(id).getElementsByTagName("span");
        divs=document.getElementById(id).getElementsByTagName("div");
        inputs=document.getElementById(id).getElementsByTagName("input");
    }
    for(i=0;i<links.length;i++){
        Prepare(links[i]);
        }
    for(i=0;i<spans.length;i++){
        Prepare(spans[i]);
        }
    for(i=0;i<divs.length;i++){
        Prepare(divs[i]);
        }
    for(i=0;i<inputs.length;i++){
        Prepare(inputs[i]);
        }
    }

    function enableTooltips_for_el(id){
    var element,h;
    if(!document.getElementById || !document.getElementsByTagName) return;
    h=document.createElement("span");
    h.id="btc";
    h.style.zIndex=21;
    h.setAttribute("id", "btc");
    h.style.position="absolute";
    document.getElementsByTagName("body")[0].appendChild(h);
    element=document.getElementById(id);
    Prepare(element);
    }


    function Prepare(el){
    var tooltip,t,tt,s,l,tt;
    tooltip=CreateEl("span","tooltip");
    t=null;//el.getAttribute("title");
    if(t==null || t.length==0)
    {
     tt=el.getAttribute("tt");
     if(tt==null || tt.length==0) return false;
     /*if(tt.length > 30)
     {
        tooltip.style.width = "250px";
     }*/
     t=tt;
     el.removeAttribute("tt");
    }
    /*else
    {
        if(t.length > 30)
        {
            tooltip.style.width = "250px";
        }
    }*/
    el.removeAttribute("title");
    s=CreateEl("span","top");
    //s.appendChild(document.createTextNode(t));
    s.innerHTML = t;
    tooltip.appendChild(s);
    setOpacity(tooltip);
    el.tooltip=tooltip;
    el.onmouseover = showTooltip;
    el.onmouseout = hideTooltip;
    el.onmousemove = Locate;
    }

    function showTooltip(e){
    document.getElementById("btc").appendChild(this.tooltip);
    Locate(e);
    }

    function hideTooltip(e){
    var d=document.getElementById("btc");
    if(d.childNodes.length>0) d.removeChild(d.firstChild);
    }

    function setOpacity(el){
    el.style.filter="alpha(opacity:90)";
    el.style.KHTMLOpacity="0.90";
    el.style.MozOpacity="0.90";
    el.style.opacity="0.90";
    }

    function CreateEl(t,c){
    var x=document.createElement(t);
    x.className=c;
    x.style.display="block";
    return(x);
    }

    function Locate(e){
    var posx=0,posy=0;
    if(e==null) e=window.event;
    if(e.pageX || e.pageY){
        posx=e.pageX; posy=e.pageY;
        }
    else if(e.clientX || e.clientY){
        if(document.documentElement.scrollTop){
            posx=e.clientX+document.documentElement.scrollLeft;
            posy=e.clientY+document.documentElement.scrollTop;
            }
        else{
            posx=e.clientX+document.body.scrollLeft;
            posy=e.clientY+document.body.scrollTop;
            }
        }
    //document.getElementById("btc").style.top=(posy+10)+"px";
    //document.getElementById("btc").style.left=(posx-20)+"px";
    var wWidth = 0, wHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
      //Non-IE
      wWidth = window.innerWidth;
      wHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      wWidth = document.documentElement.clientWidth;
      wHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
      //IE 4 compatible
      wWidth = document.body.clientWidth;
      wHeight = document.body.clientHeight;
    }

    var btc = document.getElementById("btc");
    var btcWidth = btc.clientWidth;
    var btcHeight = btc.clientHeight;

    var dx = posx+btcWidth-wWidth;
    var dy = posy+btcHeight-wHeight;
    var dy2 = posy-(btcHeight+20);
    if (dx >= 0)
        posx-=dx;
    if (dy >= 0 && Math.abs(dy2)<dy)
        posy=dy2;

    btc.style.left=(posx-20)+"px";
    btc.style.top=(posy+10)+"px";

    }