function getObject(elementId)
{
	if (document.all)
    {
        return document.all[elementId];
    }
    else if (document.getElementById)
    {
        return document.getElementById(elementId);
    }
    else if (document.layers)
    {
        return document.layers[elementId];
    }
}

function getObjectsByTagAndClass(tag, cls)
{
    var array = document.getElementsByTagName(tag);
    var output = new Array();
    var matches = 0;
    for (var i = 0; i < array.length; i++)
    {
        var parts = array[i].className.split(' ');
        for (var j = 0; j < parts.length; j++)
        {
            if (parts[j] == cls)
            {
                output[matches++] = array[i];
            }
        }
    }
    return output;
}

function getTargetFromEvent(e)
{
    if (!e)
        var e = window.event;
    if (e.target)
        var tg = e.target;
    else if (e.srcElement)
        var tg = e.srcElement;
    while (tg.nodeType != 1)
        tg = tg.parentNode;
    return tg;
}

function getBrowserWidth()
{
    if (window.innerWidth)
        return window.innerWidth;
    else if (document.body.clientWidth)
        return document.body.clientWidth;
    else
        return  - 1;
}

function getBrowserHeight()
{
    return document.documentElement.clientHeight;
}

function getBodyHeight()
{
    if (document.body.clientHeight)
        return document.body.clientHeight;
    else
        return  - 1;
}

function getObjectHeight(i)
{
    return i.offsetHeight;
}