/* 

// Based on code by:
// 1. os-n-browser.js
//    by Antony Gaitatzis, 2002
// 2. Learn Advanced JavaScript Programming,
//    by Yehuda Shiran and Tomer Shiran, 1997
// 3. developer.*****.com, 2000
// 4. IFILM, 2005
// 5. WebMonkey, 2002
// 6. MustardLab, 2003

// To work in: IE6, IE5, IE4, NS3, NS6, Mozilla, Op5, Kon
// To not fully/always work in: IE3, NS2

*/

var detectableWithVB = false;
var pluginFound = false;

function whichBrowser() 
{

	if(navigator.userAgent.indexOf("Firefox") != -1)
	{
	  return("Firefox ");
	}
	else if (navigator.appName == "Netscape") {
		if (navigator.userAgent.indexOf("Netscape") < 0) {
			if (navigator.userAgent.indexOf("Gecko") > 0) {
				start = navigator.userAgent.indexOf("rv:") + 3
				end = navigator.userAgent.indexOf(")", start)				
				version = navigator.userAgent.substring(start, end)
				is_gecko = true
				return("Mozilla ")
			}		
			start = "Mozilla/".length;
			end = navigator.userAgent.indexOf(" ", start);
			version = parseFloat(navigator.userAgent.substring(start, end));
		} else {
			if (navigator.userAgent.indexOf("7.0") > 0) {
				version = "7.0";								
			}
			else {
				start = navigator.userAgent.indexOf("Netscape") + "Netscape".length + 2;
				end = navigator.userAgent.length;
				version = parseFloat(navigator.userAgent.substring(start, end));
			}
		}
		return("Netscape Navigator " + version);
	}
	else if (navigator.appName == "Microsoft Internet Explorer") {
		start = navigator.userAgent.indexOf("MSIE ") + "MSIE ".length
		if (navigator.userAgent.indexOf(";", start) > 0) {
			end = navigator.userAgent.indexOf(";", start)
		} else {
			end = navigator.userAgent.indexOf(")", start)
		}
		version = parseFloat(navigator.userAgent.substring(start, end))
		return("Internet Explorer " + version)
	}
	else if (navigator.appName == "Opera") {
		start = navigator.userAgent.indexOf("/") + 1
		end = navigator.userAgent.indexOf(" ")
		version = navigator.userAgent.substring(start, end)
		return("Opera " + version)
	}
	return("Untested - may not work properly")
}

function whichOS()
{
	if ((navigator.platform) == "Win32") {
		if (navigator.userAgent.indexOf("Windows NT 5.1") > 0) {
			is_winxp = true;
			return("Windows XP")
		}
		if (navigator.userAgent.indexOf("Windows NT 5.0") > 0) {
			is_win2k = true;
			return("Windows 2000")
		}
		if ((navigator.userAgent.indexOf("Windows NT 4.0") > 0) || (navigator.userAgent.indexOf("WinNT") > 0))  {
			is_winNT = true;
			return("Windows NT 4.0")
		}
		if (navigator.userAgent.indexOf("Win 9x 4.90") > 0) {
			is_winme = true;
			return("Windows ME")
		}
		if ((navigator.userAgent.indexOf("Windows 98") > 0) || (navigator.userAgent.indexOf("Win98") > 0)) {
			is_win98 = true;
			return("Windows 98")
		}
		if ((navigator.userAgent.indexOf("Windows 95") > 0) || (navigator.userAgent.indexOf("Win95") > 0)) {
			is_win95 = true;
			return("Windows 95")
		}
	}
	if ((navigator.platform) == "Win16") {
			is_win16 = true;
			return("16-bit Windows (3.x / pre-95)")
	}
	if ((navigator.userAgent.indexOf("Mac") > 0)) {
		is_mac = true;
		return ("Apple")
	}
	return ("Undetected - may not work properly")
}