function detectBrowser(path) {
	if (document && document.getElementById) {
		var location = document.getElementById('location');
		if (location.value == null || location.value == "") {
			location.value = getOpenerLocation();
		}
		document.getElementById('cookieEnabled').value = getCookieEnabled();
		if (PluginDetect.getVersion) {
			document.getElementById('flashVersion').value = PluginDetect.getVersion('Flash');
			document.getElementById('shockwaveVersion').value = PluginDetect.getVersion('Shockwave');
			document.getElementById('quickTimeVersion').value = PluginDetect.getVersion('QuickTime');
			document.getElementById('windowsMediaVersion').value = getPluginVersion('WindowsMediaPlayer');
			document.getElementById('javaVersion').value = PluginDetect.getVersion('Java',path + 'getJavaInfo.jar');
		}
		document.getElementById('cdfVersion').value = getCDFVersion();
		document.getElementById('unityVersion').value = getUnityVersion();
		if (screen && screen.width && screen.height) {
			document.getElementById('screenWidth').value = screen.width;
			document.getElementById('screenHeight').value = screen.height;
			if (screen.colorDepth) {
				document.getElementById('colorDepth').value = screen.colorDepth;
			}
		}
	}
	return true;
}
function getOpenerLocation() {
	try {
		if (window.opener && window.opener.document && window.opener.document.location) {
			return window.opener.document.location;
		}
	} catch(e) {
	}
	return null;
}
function getCookieEnabled() {
	if (typeof document.cookie == "undefined" || typeof navigator == "undefined" || !navigator.cookieEnabled) {
		return false;
	} else {
		return true;
	}
}
function getPluginVersion(plugin) {
	var x = PluginDetect.getVersion(plugin);
	if (x == null) {
		return PluginDetect.isMinVersion(plugin,0) >=0 ? "enabled" : null;
	} else {
		return x;
	}
}
function getCDFVersion() {
	if (typeof ActiveXObject != 'undefined') {
		// IE compatible browsers
		try {
			var control = new ActiveXObject("Mathematica.Control");
			if (control) {
				if (typeof control.version != 'undefined') {
					return control.version;
				} else {
					return true;
				}
			}
		} catch (x) {
		}
	} else if (navigator.mimeTypes && navigator.mimeTypes["application/vnd.wolfram.cdf"]) {
		var plugin = navigator.mimeTypes["application/vnd.wolfram.cdf"].enabledPlugin;
		if (plugin) {
			if (typeof plugin.version != 'undefined') {
				return plugin.version;
			} else {
				return true;
			}
		}
	}
	return null;
}
function getUnityVersion() {
	if (typeof ActiveXObject != 'undefined') {
		// IE compatible browsers
		try {
			var control = new ActiveXObject("UnityWebPlayer.UnityWebPlayer.1");
			if (control) {
				if (typeof control.GetPluginVersion != 'undefined') {
					return control.GetPluginVersion();
				} else {
					return true;
				}
			}
		} catch (e) {
		}
	} else if (navigator.mimeTypes && navigator.mimeTypes["application/vnd.unity"]) {
		var plugin = navigator.mimeTypes["application/vnd.unity"].enabledPlugin;
		if (plugin) {
			if (typeof plugin.version != 'undefined') {
				return plugin.version;
			} else {
				return true;
			}
		}
	}
	return null;
}