function DetectIt () {

	this.detect = navigator.userAgent.toLowerCase();
	this.OS;
	this.browser;
	this.version;
	this.thestring;
	
	this.checkIt = detectIt_checkIt;
	
	if (this.checkIt('konqueror'))	{
		this.browser = "Konqueror";
		this.OS = "Linux";
	}
	
	else if (this.checkIt('safari')) this.browser = "safari";
	else if (this.checkIt('omniweb')) this.browser = "omniweb";
	else if (this.checkIt('opera')) this.browser = "opera";
	else if (this.checkIt('webtv')) this.browser = "webtv";
	else if (this.checkIt('icab')) this.browser = "icab";
	else if (this.checkIt('msie')) this.browser = "ie";
	else if (this.checkIt('firefox')) this.browser = "firefox";
	else if (!this.checkIt('compatible'))	{
		this.browser = "netscape";
		this.version = this.detect.charAt(8);
	}
	
	else this.browser = "An unknown browser";
	
	if (!this.version) this.version = this.detect.charAt(this.place + this.thestring.length);
	
	if (!this.OS)	{
		if (this.checkIt('linux')) this.OS = "linux";
		else if (this.checkIt('x11')) this.OS = "unix";
		else if (this.checkIt('mac')) this.OS = "mac"
		else if (this.checkIt('win')) this.OS = "windows"
		else this.OS = "an unknown operating system";
	}

}

function detectIt_checkIt(string)	{
	place = this.detect.indexOf(string) + 1;
	this.thestring = string;
	return place;
}

detect = new DetectIt();

