if (typeof(BrowserUtils)== "undefined")
{
    // class definition BEGIN
    var BrowserUtils = 
    {
        // fields region
        Version: "1.0.0",
        IsInitialized : false,
        // OS properties
        IsOsWindows : false,
        IsOsLinux : false,
        IsOsUnix : false,
        IsOsMac : false,
        IsUnknownOS : false,
        // Browser types
        IsNetscape4 : false,
        IsNetscape6 : false,
        IsNetscape6Plus : false,
        IsNetscape7 : false,
        IsNetscape8 : false,
        IsMozilla : false,
        IsFirefox : false,
        IsSafari : false,
        IsIE : false,
        IsIEMac : false,
        IsIE5Mac : false,
        IsIE4Mac : false,
        IsIE5Win : false,
        IsIE55Win : false,
        IsIE6Win : false,
        IsIE4Win : false,
        IsOpera : false,
        IsOpera4 : false,
        IsOpera5 : false,
        IsOpera6 : false,
        IsOpera7 : false,
        IsOpera8 : false,
        IsKonqueror : false,
        IsOmniWeb : false,
        IsCamino : false,
        IsUnknownBrowser : false,
        // DHTML features
        UpLevelDom : false,
        AllCollection : false,
        Layers : false,
        Focus : false,
        StandardMode : false,
        HasImagesArray : false,
        HasAnchorsArray : false,
        DocumentClear : false,
        AppendChild : false,
        InnerWidth : false,
        HasComputedStyle : false,
        HasCurrentStyle : false,
        HasFilters : false,
        HasStatus : false,
        // browser info - internal use only
        Name : "",
        Codename : "",
        BrowserVersion : "",
        Platform : "",
        JavaEnabled : false,
        ScreenWidth : 0,
        ScreenHeight : 0,
        AgentString : "",
        // methods region
        
        // this is the public initialization method that sets up the required
        // detected variables
        Init : function()
        {
            if(window.navigator)
            {
	            this.AgentString = navigator.userAgent.toLowerCase();
	            this.Name = navigator.appName;
                this.Codename = navigator.appCodeName;
                this.BrowserVersion = navigator.appVersion.substring(0,4);
                this.Platform = navigator.platform;
                this.JavaEnabled = navigator.javaEnabled();
                this.ScreenWidth = screen.width;
                this.ScreenHeight = screen.height;
            }
            // we call the init functions here
            this.InitOs();
            this.InitFeatures();
            this.InitBrowser();
            this.IsInitialized = true;
        },
        CancelIe : function()
        {
            this.IsIE = this.IsIE6Win = this.IsIE55Win = this.IsIE5Win = this.IsIE4Win = this.IsIEMac = this.IsIE5Mac = this.IsIE4Mac = false;
        },
        CancelOpera : function()
        {
            this.IsOpera4 = this.IsOpera5 = this.IsOpera6 = this.IsOpera7 = false;
        },
        CancelMozilla : function()
        {
            this.IsFirefox = this.IsMozilla = this.IsNetscape7 = this.IsNetscape6Plus = this.IsNetscape6 = this.IsNetscape4 = false;
        },
        InitOs : function()
        {
            if((this.AgentString.indexOf("win") != -1))
            {
                this.IsOsWindows = true;
            }
            else if((this.AgentString.indexOf("mac") != -1)||(navigator.appVersion.indexOf("mac") != -1))
            {
                this.IsOsMac = true;
            }
            else if((this.AgentString.indexOf("linux") != -1))
            {
                this.IsOsLinux = true;
            }
            else if((this.AgentString.indexOf("x11") != -1))
            {
                this.IsOsUnix = true;
            }
            else
            {
                this.IsUnknownBrowser = true;
            }
        },
        InitFeatures : function()
        {
            if((document.getElementById && document.createElement))// || (document.getElementById && document.createElement && document.all)
            {
                this.UpLevelDom = true;
            }
            if(document.all)
            {
                this.AllCollection = true;
            }
            if(document.layers)
            {
                this.Layers = true;
            }
            if(window.focus)
            {
                this.Focus = true;
            }
            if(document.compatMode && document.compatMode == "CSS1Compat")
	        {
	            this.StandardMode = true;
	        }
            if(document.images)
            {
                this.HasImagesArray = true;
            }
            if(document.anchors)
            {
                this.HasAnchorsArray = true;
            }
            if(document.clear)
            {
                this.DocumentClear = true;
            }
            if(document.appendChild)
            {
                this.AppendChild = true;
            }
            if(window.innerWidth)
            {
                this.InnerWidth = true;
            }
            if(window.getComputedStyle)
            {
                this.HasComputedStyle = true;
            }
            if(document.documentElement && document.documentElement.currentStyle)
            {
                this.HasCurrentStyle = true;
            }
            else if(document.body && document.body.currentStyle)
            {
                this.HasCurrentStyle = true;
            }
            if(document.body && document.body.filters)
            {
                this.HasFilters = true;
            }
            if (typeof(window.status) != "undefined") 
            {
                this.HasStatus = true;
            }
        },
        InitBrowser : function()
        {
	        if(this.AllCollection || (navigator.appName == "Microsoft Internet Explorer"))
	        {
	            this.IsIE = true;
	            if (this.IsOsWindows)
	            {
		            if(this.UpLevelDom)
		            {
			            if ((navigator.appVersion.indexOf("MSIE 6") > 0)||(document.getElementById && document.compatMode))
			            {
				            this.IsIE6Win = true;
			            }
			            else if ((navigator.appVersion.indexOf("MSIE 5.5") > 0)&& document.getElementById && !document.compatMode)
			            {
				            this.IsIE55Win = true;
				            this.IsIE6Win = true;
			            }
			            else if (document.getElementById && !document.compatMode && typeof(window.opera)=="undefined")
			            {
				            this.IsIE5Win = true;
			            }
		            }
		            else
		            {
			            this.IsIE4Win = true;
		            }
	            }
	            else if (this.IsOsMac)
	            {
		            this.IsIEMac = true;
		            if(this.UpLevelDom)
		            {
			            this.IsIE5Mac = true;
		            }
		            else
		            {
			            this.IsIE4Mac = true;
		            }
	            }
	        }
	        if (this.AgentString.indexOf('opera') != -1 && typeof(window.opera)== "undefined")
	        {
		        this.IsOpera4 = true;
		        this.IsOpera = true;
		        this.CancelIe();
	        }
	        else if (typeof(window.opera)!="undefined" && !typeof(window.print)=="undefined")
	        {
		        this.IsOpera5 = true;
		        this.IsOpera = true;
		        this.CancelIe();
	        }
	        else if (typeof(window.opera)!="undefined" && typeof(window.print)!="undefined" && typeof(document.childNodes)=="undefined" )
	        {
		        this.IsOpera6 = true;
		        this.IsOpera = true;
		        this.CancelIe();
	        }
	        else if (typeof(window.opera)!="undefined" && typeof(document.childNodes)!="undefined" )
	        {
		        this.IsOpera7 = true;
		        this.IsOpera = true;
		        this.CancelIe();
	        }
	        if (this.IsOpera7 && (this.AgentString.indexOf('8.') != -1))
	        {
                this.CancelIe();
	            this.CancelOpera();
		        this.IsOpera8 = true;
		        this.IsOpera = true;
	        }
	        if (this.AgentString.indexOf( "firefox/" ) != -1 )
	        {
	            this.CancelIe();
	            this.CancelOpera();
	            this.IsMozilla = true;
		        this.IsFirefox = true;
	        }
	        else if (navigator.product == "Gecko" && window.find)
	        {   //Netscape 6+, Mozilla and other Gecko
		        this.CancelIe();
	            this.CancelOpera();
		        this.IsMozilla = true;
	        }
	        if (navigator.vendor && navigator.vendor.indexOf("Netscape") != -1 && navigator.product == "Gecko" && window.find)
	        {   //Netscape 6+, Mozilla and other Gecko
		        this.CancelIe();
	            this.CancelOpera();
		        this.IsNetscape6Plus = true;
		        this.IsMozilla = true;
	        }
	        if (navigator.product == 'Gecko' && !window.find)
	        {   //Netscape 6, Mozilla 0.9- and reduced Gecko 
	            this.CancelIe();
	            this.CancelOpera();
		        this.IsNetscape6 = true;
	        }
	        if ((navigator.vendor && navigator.vendor.indexOf("Netscape") != -1 && navigator.product == 'Gecko' && window.find)||(this.AgentString.indexOf("netscape/7") != -1||this.AgentString.indexOf("netscape7") != -1))
	        {   //Netscape 7+, Mozilla 1+ and advanced Gecko
	            this.CancelIe();
	            this.CancelOpera();
	            this.CancelMozilla();
	            this.IsMozilla = true; 
		        this.IsNetscape7 = true;
	        }
	        if ((navigator.vendor && navigator.vendor.indexOf("Netscape") != -1 && navigator.product == 'Gecko' && window.find)||(this.AgentString.indexOf("netscape/8") != -1||this.AgentString.indexOf("netscape8") != -1))
	        {   //Netscape 8+, Mozilla 1+ and advanced Gecko
	            this.CancelIe();
	            this.CancelOpera();
	            this.CancelMozilla();
	            this.IsMozilla = true; 
		        this.IsNetscape8 = true;
	        }
	        if (navigator.vendor && navigator.vendor == "Camino")
	        {
	            this.CancelIe();
	            this.CancelOpera();
		        this.IsCamino = true;
		        this.IsMozilla = true;
	        }
	        if (((navigator.vendor && navigator.vendor == 'KDE')||(document.childNodes)&&(!document.all)&&(!navigator.taintEnabled)))//(this.AgentString.indexOf("Konqueror")!=-1)||
	        {
	        this.CancelIe();
	        this.CancelOpera();
	        this.IsKonqueror = true;
	        }
	        if ((document.childNodes)&&(!document.all)&&(!navigator.taintEnabled)&&(navigator.accentColorName))
	        {
	        this.CancelIe();
	        this.CancelOpera();
	        this.IsOmniWeb = true;
	        }
	        else if (document.layers && navigator.mimeTypes['*'] )
	        {
	        this.CancelIe();
	        this.CancelOpera();
	        this.IsNetscape4 = true;
	        }
	        if((document.childNodes)&&(!document.all)&&(!navigator.taintEnabled)&&(!navigator.accentColorName))//this.IsOsMac && this.UpLevelDom && (parseInt(navigator.productSub)>=20020000)&& (navigator.vendor.indexOf("Apple Computer")!=-1)
	        {
		        this.CancelIe();
	            this.CancelOpera();
	            this.IsSafari = true;
	        }
	        else
	        {
	        IsUnknownBrowser = true;
	        }
        },
        // prints the detected browsers for test comparison
        DebugBrowser: function()
        {
            var BrowserString = "IsNetscape4 " + this.IsNetscape4 + "\n";
            BrowserString += "IsNetscape6 " + this.IsNetscape6 + "\n";
            BrowserString += "IsNetscape6Plus " + this.IsNetscape6Plus + "\n";
            BrowserString += "IsNetscape7 " + this.IsNetscape7 + "\n";
            BrowserString += "IsNetscape8 " + this.IsNetscape8 + "\n";
            BrowserString += "IsMozilla " + this.IsMozilla + "\n";
            BrowserString += "IsFirefox " + this.IsFirefox + "\n";
            BrowserString += "IsSafari " + this.IsSafari + "\n";
            BrowserString += "IsIE " + this.IsIE + "\n";
            BrowserString += "IsIEMac " + this.IsIEMac + "\n";
            BrowserString += "IsIE5Mac " + this.IsIE5Mac + "\n";
            BrowserString += "IsIE4Mac " + this.IsIE4Mac + "\n";
            BrowserString += "IsIE5Win " + this.IsIE5Win + "\n";
            BrowserString += "IsIE55Win " + this.IsIE55Win + "\n";
            BrowserString += "IsIE6Win " + this.IsIE6Win + "\n";
            BrowserString += "IsIE4Win " + this.IsIE4Win + "\n";
            BrowserString += "IsOpera " + this.IsOpera + "\n";
            BrowserString += "IsOpera4 " + this.IsOpera4 + "\n";
            BrowserString += "IsOpera5 " + this.IsOpera5 + "\n";
            BrowserString += "IsOpera6 " + this.IsOpera6 + "\n";
            BrowserString += "IsOpera7 " + this.IsOpera7 + "\n";
            BrowserString += "IsOpera8 " + this.IsOpera8 + "\n";
            BrowserString += "IsKonqueror " + this.IsKonqueror + "\n";
            BrowserString += "IsOmniWeb " + this.IsOmniWeb + "\n";
            BrowserString += "IsCamino " + this.IsCamino + "\n";
            BrowserString += "IsUnknownBrowser " + this.IsUnknownBrowser + "\n";
            alert(BrowserString);
        },
        // prints the detected operating systems for test comparison
        DebugOS: function()
        {
            var OsString = "IsOsWindows " + this.IsOsWindows + "\n";
            OsString += "IsOsLinux " + this.IsOsLinux + "\n";
            OsString += "IsOsUnix " + this.IsOsUnix + "\n";
            OsString += "IsOsMac " + this.IsOsMac + "\n";
            OsString += "IsUnknownOS " + this.IsUnknownOS + "\n";
            alert(OsString);
        },
        // prints the detected features for test comparison
        DebugFeatures: function()
        {
            var FeaturesString = "UpLevelDom " + this.UpLevelDom + "\n";
            FeaturesString += "AllCollection " + this.AllCollection + "\n";
            FeaturesString += "Layers " + this.Layers + "\n";
            FeaturesString += "Focus " + this.Focus + "\n";
            FeaturesString += "StandardMode " + this.StandardMode + "\n";
            FeaturesString += "HasImagesArray " + this.HasImagesArray + "\n";
            FeaturesString += "HasAnchorsArray " + this.HasAnchorsArray + "\n";
            FeaturesString += "DocumentClear " + this.DocumentClear + "\n";
            FeaturesString += "AppendChild " + this.AppendChild + "\n";
            FeaturesString += "InnerWidth " + this.InnerWidth + "\n";
            FeaturesString += "HasComputedStyle " + this.HasComputedStyle + "\n";
            FeaturesString += "HasCurrentStyle " + this.HasCurrentStyle + "\n";
            FeaturesString += "HasFilters " + this.HasFilters + "\n";
            FeaturesString += "HasStatus " + this.HasStatus + "\n";
            alert(FeaturesString);
        }
    }
BrowserUtils.Init();
}