function collectUserInfo(additional)
{
	var userInfo =
	{
		href: location.href,
		time: (new Date()).getTime(),
		screenWidth: screen.width,
		screenHeight: screen.height,
		colorDepth: screen.colorDepth,
		compatMode: document.compatMode,
		userAgent: navigator.userAgent,
		playerVersion: getPlayerVersion().join('.'),
		scrollX: (typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement.scrollLeft),
		scrollY: (typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement.scrollTop),
		cookie: document.cookie
	};
	if (additional && additional.plugins)
	{
		var plugins = navigator.plugins;
		if (plugins && plugins.length)
		{
			userInfo.plugins = {};
			for (var i = 0; i < plugins.length; i++)
			{
				userInfo.plugins[plugins[i].name] = plugins[i].description;
			}
		}
	}
	if (additional && additional.html)
	{
		var children = document.childNodes;
		userInfo.html = '';
		for (var i = 0; i < children.length; i++)
		{
			try
			{
				userInfo.html += getOuterHTML(children[i]);
			}
			catch (e)
			{
			}
		}
	}
	return userInfo;
}

/**
 * @param {Element} el
 * @return {String}
 */
function getOuterHTML(el)
{
	if (el.outerHTML)
	{
		return el.outerHTML;
	}
	if (el.nodeType == 10)
	{
		return '<!DOCTYPE html PUBLIC "' + el.publicId + '" "' + el.systemId + '">';
	}
	var div = document.createElement('div');
	div.appendChild(el.cloneNode(true));
	return div.innerHTML;
}

/**
 * @return {Array}
 */
function getPlayerVersion()
{
	var playerVersion = [0, 0, 0];
	if (navigator.plugins && navigator.mimeTypes.length)
	{
		var x = navigator.plugins["Shockwave Flash"];
		if (x && x.description)
		{
			playerVersion = x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".");
		}
	}
	else
	{
		var axo = null;
		// do minor version lookup in IE, but avoid fp6 crashing issues see
		// http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try
		{
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}
		catch (e)
		{
			try
			{
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				playerVersion = [6, 0, 21];
				axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			}
			catch (e)
			{
				if (playerVersion[0] == 6)
				{
					return playerVersion;
				}
			}
			try
			{
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			}
			catch (e)
			{
			}
		}
		if (axo != null)
		{
			playerVersion = axo.GetVariable("$version").split(" ")[1].split(",");
		}
	}
	return playerVersion;
}
