function c_browser() {
        var type = null;
        var os = null;
        var dom = null;
        var ie4 = null;
        var ns4 = null;
        var detect = null;
        this.check = function() {
                this.detect = navigator.userAgent.toLowerCase();

                this.dom = (document.getElementById)? true : false;
                this.ie4 = (document.all)? true : false;
                this.ns4 = (document.layers)? true : false;
                this.fnCheck();
        };
        this.fnCheck = function() {
                if (this.fnCheckIt('konqueror')) {
                        this.type = "Konqueror";
                        this.os = "Linux";
                }
                else if (this.fnCheckIt('safari')) this.type = "safari"
                else if (this.fnCheckIt('omniweb')) this.type = "omniweb"
                else if (this.fnCheckIt('opera')) this.type = "opera"
                else if (this.fnCheckIt('webtv')) this.type = "webtv";
                else if (this.fnCheckIt('icab')) this.type = "icab"
                else if (this.fnCheckIt('msie')) this.type = "internet_explorer"
                else if (this.fnCheckIt('firefox')) this.type = "firefox"
                else if (this.fnCheckIt('netscape')) this.type = "netscape_navigator"
                else if (!this.fnCheckIt('compatible')) {
                        this.type = "netscape_navigator"
                } else
                        this.type = "unknown";

                if (this.fnCheckIt('linux')) this.os = "linux";
                else if (this.fnCheckIt('x11')) this.os = "unix";
                else if (this.fnCheckIt('mac')) this.os = "mac"
                else if (this.fnCheckIt('win')) this.os = "windows"
                else this.os = "unknown";
        };
        this.fnCheckIt = function(psString) {
                sPlace = this.detect.indexOf(psString) + 1;
                return sPlace;
        };
}

var browser = new c_browser();
browser.check();

function fnGetElement(psId) {
        if (!psId) {
                return;
        }
        var oId = null;
        if (browser.dom) {
                oId = document.getElementById(psId);
        } else if (browser.ie4) {
                oId = document.all[psId];
        } else if (browser.ns4) {
                oId = document.layers[psId];
        }
        if (oId) {
                return oId;
        } else {
                return;
        }
}



