// checkver.js



var IEBROWSER = 0;
var FIREFOXBROWSER = 1;
var CHROMEBROWSER = 2;
var nBrowser = -1;


function msieversion()
// return Microsoft Internet Explorer (major) version number, or 0 for others.
// This function works by finding the "MSIE " string and extracting the version number
// following the space, up to the decimal point for the minor version, which is ignored.
{
    var ua = window.navigator.userAgent;
    var msie = ua.indexOf ( "MSIE " )
    if ( msie > 0 )        // is Microsoft Internet Explorer; return version number
        return parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) )
    else
        return 0    // is other browser
}


function CheckBrowser()
{
	if ( msieversion() < 6 )
		return FALSE;
	else
		return TRUE;
}

function BrowserDetect() 
{
	var browser = navigator.appName;
	if (browser=="Microsoft Internet Explorer") this.browser = "ie";
	else if (browser=="Netscape") this.browser = "ns";
	else this.browser = browser;
	this.ie = (this.browser=="ie");
	this.ie3 = (navigator.userAgent.indexOf('MSIE 3') > 0);
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4') > 0);
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5') > 0);
	this.ver = parseInt(navigator.appVersion);
	this.ns = (this.browser=="ns");
	this.ns3 = (this.browser=="ns" && this.ver==3);
	this.ns4 = (this.browser=="ns" && this.ver==4);
	this.ns5 = (this.browser=="ns" && this.ver==5);
	if (this.ie5) this.ver = 5;
	this.bmin = (this.ns3||this.ie3);
}


function GetBrowser()
{
	if (nBrowser == -1)
	{
		var ua = window.navigator.userAgent;

		if (ua.indexOf("MSIE") > 0 ) 
			nBrowser = IEBROWSER;
		else if (ua.indexOf("Firefox") > 0 ) 
			nBrowser = FIREFOXBROWSER;
		else if (ua.indexOf("Chrome") > 0 ) 
			nBrowser = CHROMEBROWSER;
	}

    return nBrowser;    // is other browser
}