function TestBrowser()
{
    var MNav = navigator.userAgent.toLowerCase();
    this.Mozilla = false;
    this.Firefox = false;
    this.IE = false;
    this.NS6 = false;
    this.OP = false;
    this.NS = true;
    this.Name = 'Unknown. May be Netscape Navigator.';

    if (MNav.indexOf('opera') != -1)
    {
        this.OP = true;
        this.Name = 'Opera';
        this.NS = false;
        MNav = null;
        return this;
    }

    if (MNav.indexOf('firefox') != -1)
    {
        this.Firefox = true;
        this.Name = 'Firefox';
        this.NS = false;
        MNav = null;
        return this;
    }


    if ((MNav.indexOf('gecko') != -1) && (MNav.substr(MNav.indexOf('gecko') + 6) >= 20020530))
    {
        Mozilla = true;
        this.Name = 'Mozilla';
        this.NS = false;
        MNav = null;
        return this;
    }

    MNav = null;

    if (document.getElementById && !document.all)
    {
        this.NS6 = true;
        this.Name = 'NS6UP';
        this.NS = false;
        return this;
    }
    if (document.all)
    {
        this.IE = true;
        this.Name = 'IE';
        this.NS = false;
        return this;
    }
    return this;
}

// Получить объэкт по его имени
function GetElementByName(name)
{
    var element;
    element = document.getElementById(name);
    if (element == null)
        element = document.all[name];
    return element;
}

// Установить видимость
function SetDisplay(obj, value)
{
    if (obj == null)
        return;

    if (typeof (value) == "boolean")
    {
        if (value)
            obj.style.display = 'block';
        else
            obj.style.display = 'none';
    }
    else
    {
        obj.style.display = value;
    }
}

// Отображается ли элемент
function IsDisplay(obj)
{
    if (obj == null)
        return false;

    return obj.style.display != 'none';
}

// Инвертировать видимость объекта
function InvertDisplay(obj)
{
    if (obj == null)
        return;

    SetDisplay(obj, !IsDisplay(obj));
}