var ToolTip = {
    init:function()
    {
        $$(".toolTip").each(function(e){
            e.observe('mouseover', ToolTip.showToolTip.bindAsEventListener(this, e));
            e.observe('mouseout', ToolTip.hideToolTip.bindAsEventListener(this,e));
        });
    },

    showToolTip:function(e,elem)
    {
        elem = $(elem);
        var str = elem.firstChild.innerHTML;
        var tt = $("toolTip");
        tt.select("span")[0].innerHTML = str;
        var pos = elem.cumulativeOffset();
        tt.style.left = pos[0] - (tt.getWidth()/2) + elem.getWidth()/2 + "px";
        if (Prototype.Browser.IE6 || Prototype.Browser.IE7)
            tt.style.top = pos[1] - 40 + "px";
        else if(Prototype.Browser.IE8)
            tt.style.top = pos[1] - 55 + "px";
        else
            tt.style.top = pos[1] - 40 + "px";

        tt.setOpacity(0.9);
        tt.show();
    },

    hideToolTip:function(e,elem)
    {
        $("toolTip").hide();
    }
};
