//Hides container element if it doesn't contain any elements(height is 0).
function HideEmptyElement(elementId)
{
    if (document.getElementById)
    {
        //Get refernce to conatiner
        var container = document.getElementById(elementId);
        //If container is empty we set display property to none.
        if (container != null && container.offsetHeight == 0)
        {
           container.style.display = 'none';
        }
    }
}

// Function to add more than one funtion in the onload event
function addLoadEvent(func){
    var oldonload = window.onload;
    if(typeof window.onload != 'function') window.onload = func;
    else window.onload = function() {
        oldonload();
        func();
    }
}