var sAgent = navigator.userAgent

function caps(){
var bIncBuild = false	
	if (sAgent.indexOf("MSIE")!=-1){
		if (sAgent.charAt(sAgent.indexOf("MSIE")+7)>0 ){
			this.iMinorVer = sAgent.charAt(sAgent.indexOf("MSIE")+7)
			bIncBuild = true
		}else
			this.iMinorVer = sAgent.charAt(sAgent.indexOf("MSIE")+8)
		this.iMajorVer = sAgent.charAt(sAgent.indexOf("MSIE")+5)
	} else if (sAgent.indexOf("MSPIE")!=-1){
	   	this.iMinorVer = sAgent.charAt(sAgent.indexOf("MSPIE")+9)
		this.iMajorVer = sAgent.charAt(sAgent.indexOf("MSPIE")+6)
	} else {
		this.iMinorVer = sAgent.charAt(11)
		this.iMajorVer = sAgent.charAt(8)
	}
	if (this.iMinorVer == ";") this.iMinorVer = 0;
	else if ((this.iMinorVer == "b") || (this.iMinorVer == "p")) this.iMinorVer = "0" + this.iMinorVer + (sAgent.charAt(sAgent.indexOf("MSIE")+9))
	else if (bIncBuild) this.iMinorVer = this.iMinorVer	
	else this.iMinorVer = "0" + this.iMinorVer;

	this.sFullVer = this.iMajorVer + "." + this.iMinorVer

	if (sAgent.indexOf('MSIE') !=-1)
		this.bIE = true
	else if ((sAgent.indexOf("Mozilla")!=-1) && (sAgent.indexOf("compatible") == -1))
		this.bIsNav  = true
	if (this.bIE) 
		this.sBrowser = "Microsoft Internet Explorer"
	else if (this.bIsNav) {
		if (this.iMajorVer <= 3)
			this.sBrowser = "Netscape Navigator"
		else
			this.sBrowser = "Netscape Communicator"
	}
        if (sAgent.indexOf('Opera') !=-1) this.bIsOpera = true

	if ((sAgent.indexOf("Windows 95")>0) || (sAgent.indexOf("Win95")!=-1))
		this.bW95 = true
	else if ((sAgent.indexOf("Windows 98")!=-1) || (sAgent.indexOf("Win98")!=-1))
		this.bW98 = true
	else if ((sAgent.indexOf("Windows NT 5.")!=-1))
		this.bWNT5 = true
	else if ((sAgent.indexOf("Windows NT")!=-1) || (sAgent.indexOf("WinNT")!=-1))
		this.bWNT = true
	else if ((sAgent.indexOf("Windows 3.1")!=-1) || (sAgent.indexOf("Win16")!=-1))
		this.bW31 = true
	else if ((sAgent.indexOf("Mac")!=-1))
		this.bMac = true
	else if ((sAgent.indexOf("SunOS")!=-1))
		this.bSunOS = true
	else if ((sAgent.indexOf("HP-UX")!=-1))
		this.bHP = true
	else if ((sAgent.indexOf("X11")!=-1))
		this.bUnix = true	
	else if ((sAgent.indexOf("Windows CE")!=-1))
		this.bWCE = true
	
	if ((sAgent.indexOf("X11")!=-1))
		this.bIsUnix = true	

	if ((this.bW95) || (this.bWNT) || (this.bWNT5) || (this.bW98) || (sAgent.indexOf("Win32")!=-1))
		this.bW32 = true
 
	if (this.bW95) this.sOS  = "Windows 95";
	else if (this.bW98) this.sOS  = "Windows 98";
	else if (this.bWNT5) this.sOS  = "Windows NT5";
	else if (this.bWNT) this.sOS  = "Windows NT";
	else if (this.bW31) this.sOS  = "Windows 3.1";
	else if (this.bMac) this.sOS  = "Macintosh";
	else if (this.bSunOS) this.sOS = "Solaris";			
	else if (this.bHP) this.sOS = "HP-UX";	
	else if (this.bUnix) this.sOS  = "Unix";
	else if (this.bWCE) this.sOS = "Windows CE";
	else this.sOS  = "Unknown";

	if (this.bW32 && this.bIE && this.iMajorVer >= 3) this.bDoesActiveX = true

	if ((sAgent.indexOf("b1") != -1) || (sAgent.indexOf("b2") != -1) ||(sAgent.indexOf("p1")  != -1) || (sAgent.indexOf("p2")  != -1))
		this.bIsBeta = true

	this.thisVersion = "010599.0"
}

var oBC = new caps();
var sMV = "";
if (oBC.bIE && oBC.iMajorVer >= 4)
	sMV = navigator.appMinorVersion;

