function BrowserUtils()
{
    /* const */
    this.OPERA   = 1;
    this.MSIE    = 2;
    this.FIREFOX = 3;
    this.UNKNOWN = 4;

    this.getBrowser = function()
    {
    	switch(navigator.appName)
    	{
    		case 'Microsoft Internet Explorer': return this.MSIE;
    		case 'Netscape':       			   	return this.FIREFOX;
    		case 'Opera':             			return this.OPERA;
    	}
    	return this.UNKNOWN;
    }
    
    this.isBrowser = function(browser)
    {
        return this.getBrowser() == browser;
    }
    
    this.isIE = function()
    {
        return this.isBrowser(this.MSIE);
    }

    this.isOpera = function()
    {
        return this.isBrowser(this.OPERA);
    }
    
    this.isFirefox = function()
    {
        return this.isBrowser(this.FIREFOX);
    }
}
var browser = new BrowserUtils(); // static
