
//TODO: add client side caching
var d = YAHOO.util.Dom;
var objFilter = null;

function showTooltip(obj) {
    var theLi = d.getAncestorByTagName(obj, "li")
    var theDiv = d.getElementsByClassName("description", "div", theLi)
    var theDivLeft = d.getElementsByClassName("descriptionLeft", "div", theLi)

    if (theDiv.length > 0) {
        d.removeClass(theDiv[0], "hide")
    }
    if (theDivLeft.length > 0) {
        d.removeClass(theDivLeft[0], "hide")
    }
}

function hideTooltip(obj) {
    var theLi = d.getAncestorByTagName(obj, "li")
    var theTooltip = d.getElementsByClassName("description", "div", theLi);
    var theTooltipLeft = d.getElementsByClassName("descriptionLeft", "div", theLi);

    if (theTooltip.length > 0) {
        d.addClass(theTooltip[0], "hide")
    }
    if (theTooltipLeft.length > 0) {
        d.addClass(theTooltipLeft[0], "hide")
    }
}

/**
* TODO: check if this can be removed?? If used rename appropriately
*/
function toggleTooltips(obj, bShow) {
    if (bShow) {
        d.removeClass(obj, "hide");
    } else {
        d.addClass(obj, "hide");
    }
}

function toggle(obj) {
    objFilter.doToggle(obj);
}
