	var SEP = '|';

// browser detection

	ua = navigator.userAgent.toLowerCase();
	opera = ua.indexOf("opera") >= 0;
	ie = ua.indexOf("msie") >= 0 && !opera;
	iemac = ie && ua.indexOf("mac") >= 0;
	moz = ua.indexOf("mozilla") && !ie && !opera;
	os = navigator.platform;

function fme(){
alert('test');
}

// misc. functions

	function activeXDetect(componentClassID) {
	   componentVersion = document.body.getComponentVersion('{'+componentClassID+'}','ComponentID');
	   return (componentVersion != null) ? componentVersion : false;
	}

	// this method is not used.
	function extractVersions(s) {
		extractedVersions = "";
	    // remove all but 0-9 and '.', '_', ',' separators.
		for (var i = 0; i < s.length; i++) {
			charAtValue = s.charAt(i);
			if ((charAtValue >= '0' && charAtValue <= '9') || charAtValue == '.' || charAtValue == '_' || charAtValue == ',')
				extractedVersions += charAtValue;
		}
		return extractedVersions;
    }

	function stripIllegalChars(value) {
		t = "";
		//first we need to escape any "\n" or "/" or "\"
		value = value.toLowerCase();
		for (i = 0; i < value.length; i++) {
			if (value.charAt(i) != '\n' && value.charAt(i) != '/' && value.charAt(i) != "\\")
			{
				t += value.charAt(i);
			}
			else if (value.charAt(i) == '\n')
			{
				t += "n";
			}
		}
		return t;
	}
	
	function stripFullPath(tempFileName, lastDir) {
		fileName = tempFileName;

		//anything before the last lastDir will be lost
		filenameStart = 0;
		filenameStart = fileName.lastIndexOf(lastDir);

		if (filenameStart < 0)
			return tempFileName;
		filenameFinish = fileName.length;
		
		fileName = fileName.substring(filenameStart + lastDir.length, filenameFinish);

		return fileName;
	}	

// fingerprinting functions

	function fingerprint_browser () {
		t = ua +SEP+ navigator.appVersion +SEP+ navigator.platform;
		if (ie) {
			t += SEP + navigator.appMinorVersion +SEP+ navigator.cpuClass +SEP+ navigator.browserLanguage;
			t += SEP + ScriptEngineBuildVersion();
		} else if (moz) {
			t += SEP + navigator.language;
		}
		return t;
	}
	
	function fingerprint_display () {
		t = "";
		if (self.screen) {
			t += screen.colorDepth +SEP+ screen.width +SEP+ screen.height +SEP+ screen.availHeight;
		}
		return t;
	}
	
	function fingerprint_software () {
		t = "";
		isFirst = true;
		if (navigator.plugins.length > 0) {
			// since opera will give the full path of the file, we will
			// just extract the filenames, ignoring descripton and length since filenames are distinguished enough
			temp = "";
			lastDir = "Plugins";
			for (i = 0; i < navigator.plugins.length; i++) {
				plugin = navigator.plugins[i];
				if (isFirst==true) {
					temp += stripFullPath(plugin.filename, lastDir);
					isFirst=false;
				} else {
					temp += SEP + stripFullPath(plugin.filename, lastDir);
				}
			}
			t = stripIllegalChars(temp);
		}
		else if (navigator.mimeTypes.length > 0) {
			for (i = 0; i < navigator.mimeTypes.length; i++) {
				mimeType = navigator.mimeTypes[i];
				if (isFirst==true) {
					t += mimeType.type;
					isFirst=false;
				} else {
					t += SEP + mimeType.type;
				}
			}
		}
		else if (ie) {
			components = new Array(
				"7790769C-0471-11D2-AF11-00C04FA35D02", // Address Book
				"89820200-ECBD-11CF-8B85-00AA005B4340", // Windows Desktop Update NT
				"283807B5-2C60-11D0-A31D-00AA00B92C03", // DirectAnimation
				"4F216970-C90C-11D1-B5C7-0000F8051515", // DirectAnimation Java Classes
				"44BBA848-CC51-11CF-AAFA-00AA00B6015C", // DirectShow
				"9381D8F2-0288-11D0-9501-00AA00B911A5", // Dynamic HTML Data Binding
				"4F216970-C90C-11D1-B5C7-0000F8051515", // Dynamic HTML Data Binding for Java
				"5A8D6EE0-3E18-11D0-821E-444553540000", // Internet Connection Wizard
				"89820200-ECBD-11CF-8B85-00AA005B4383", // Internet Explorer 5 Browser
				"08B0E5C0-4FCB-11CF-AAA5-00401C608555", // Internet Explorer Classes for Java
				"45EA75A0-A269-11D1-B5BF-0000F8051515", // Internet Explorer Help
				"DE5AED00-A4BF-11D1-9948-00C04F98BBC9", // Internet Explorer Help Engine
				"22D6F312-B0F6-11D0-94AB-0080C74C7E95", // Windows Media Player
				"44BBA842-CC51-11CF-AAFA-00AA00B6015B", // NetMeeting NT
				"3AF36230-A269-11D1-B5BF-0000F8051515", // Offline Browsing Pack
				"44BBA840-CC51-11CF-AAFA-00AA00B6015C", // Outlook Express
				"CC2A9BA0-3BDD-11D0-821E-444553540000", // Task Scheduler
				"08B0E5C0-4FCB-11CF-AAA5-00401C608500", // Microsoft virtual machine
				"D27CDB6E-AE6D-11CF-96B8-444553540000", // Flash
				"2A202491-F00D-11CF-87CC-0020AFEECF20"  // Shockwave
				);
	
			document.body.addBehavior("#default#clientCaps")
			for (i = 0; i < components.length; i++) {
				ver = activeXDetect(components[i]);
				if (ver) {
					if (isFirst==true) {
						t += ver;
						isFirst=false;
					} else {
						t += SEP + ver;
					}
				}
				else {
					t += SEP + "null";
				}
			}
		}
		return t;
	}

// fingerprint communiation
// 3/28/2011 - LNM Modification to utilize jquery selectors
	
	function post_fingerprints() {
		
		$("#fp_browser").val(fingerprint_browser());
		$("#fp_screen").val(fingerprint_display());
		$("#fp_software").val(fingerprint_software());

		return true;
	}
