var g_strBrowser;
var g_bDOMFindID;
var g_bDHTML;
var g_bIE4Pos;
var g_bInvestCalc;
var g_bGetForm;
var g_bInnerHTML;
var g_strWebRoot;

{
    var nMSIEindex = navigator.userAgent.indexOf("MSIE");
    if (nMSIEindex != -1)
    {
        var fVersion = parseFloat(navigator.userAgent.substr(nMSIEindex + 5));
        if (fVersion < 4)
        {
            g_strBrowser = "IE3";
            g_bDOMFindID = false;
            g_bDHTML = false;
            g_bInvestCalc = false;
            g_bGetForm = false;
            g_bInnerHTML = false;
        }
        else if (fVersion < 5)
        {
            g_strBrowser = "IE4";
            g_bDOMFindID = false;
            g_bDHTML = true;
            g_bInvestCalc = false;
            g_bGetForm = false;
            g_bInnerHTML = false;
	    g_IE4Pos = true;	
        }
        else
        {
            g_strBrowser = "IE5";
            g_bDOMFindID = true;
            g_bDHTML = true;
            g_bInvestCalc = true;
            g_bGetForm = true;
            g_bInnerHTML = true;
        }
    }
    else
    {
        if ((navigator.userAgent.indexOf("Mozilla/5") >= 0) &&
            (navigator.userAgent.indexOf("Gecko") >= 0))
        {
            g_strBrowser = "Gecko";
            g_bDOMFindID = true;
            g_bDHTML = true;
            g_bInvestCalc = false;
            g_bGetForm = true;
            g_bInnerHTML = true;
        }
        else
        {
            g_strBrowser = "other";
            g_bDOMFindID = true;
            g_bDHTML = false;
            g_bInvestCalc = false;
            g_bGetForm = true;
            g_bInnerHTML = true;
        }
    }
}

function GetElement(strElementName)
{
    if (g_bDOMFindID)
        return document.getElementById(strElementName);
    else
    {
        var oCollection = document.all(strElementName);
        if (oCollection == null) return null;
        if (oCollection.length != null) return null;
        return oCollection;
    }
}

function SetStatus(strText)
{
    window.status = strText;
}
