
function toggleAlerts(o) 
{
    if (o != null) 
    {
        var p = o;

        if (document.getElementById("AlertsList") != null) {
            var d = "" + document.getElementById("AlertsList").style.display;

            var curleft = curtop = 0;

            if (p.offsetParent) {
                do {
                    curleft += p.offsetLeft;
                    curtop += p.offsetTop;
                }
                while (p = p.offsetParent);
            }

            document.getElementById("AlertsList").style.position = "absolute";
            document.getElementById("AlertsList").style.top = (curtop + 25) + "px";
            document.getElementById("AlertsList").style.left = curleft + "px";

            document.getElementById("AlertsList").style.display = ((d == "block") ? "none" : "block");
            o.className = ((d == "block") ? "" : "active");

            var itemCount = 0;
            for (var i = 0; i < document.getElementById("AlertsList").childNodes.length; i++) {
                if (document.getElementById("AlertsList").childNodes[i].nodeType == 1) {
                    itemCount++;
                }
            }

            if (itemCount >= 5) {
                document.getElementById("AlertsList").style.height = "260px";
            }

            if (d != "block") {
                o.blur();
            }
        }
    }
}

