﻿function setVisible(obj, ele) {
    obj = document.getElementById(obj);
    var pos = { x: 0, y: 0 };
    if (ele.id != "close") {
        while ((ele = ele.offsetParent)) {
            pos.x += ele.offsetLeft;
            pos.y += ele.offsetTop;
        }
        if (obj.id == "divPosts") {
            obj.style.left = pos.x - 290 + 'px';
            obj.style.top = pos.y + 30 + 'px';
        }
        else if (obj.id == "divTip") {
            obj.style.left = pos.x - 310 + 'px';//200
            obj.style.top = pos.y + 25 + 'px';//25
        }
        else if (obj.id == "divTipLeft") {
            obj.style.left = pos.x - 25 + 'px'; //200
            obj.style.top = pos.y + 15 + 'px'; //25
        }
        else if (obj.id == "divInfluence") {
            obj.style.left = pos.x - 412 + 'px';
            obj.style.top = pos.y + 180 + 'px';
        }
        else if (obj.id == "divPopularity") {
            obj.style.left = pos.x - 412 + 'px';
            obj.style.top = pos.y + 230 + 'px';
        }
        else if (obj.id == "divEngagement") {
            obj.style.left = pos.x - 412 + 'px';
            obj.style.top = pos.y + 280 + 'px';
        }
        else if (obj.id == "divTrust") {
            obj.style.left = pos.x - 412 + 'px';
            obj.style.top = pos.y + 330 + 'px';
        }
    }
    obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
    obj.style.display = (obj.style.display == 'block') ? 'none' : 'block';
}


