$(document).ready(function() {
	// Build regular expressions to find Windows version and .Net 2 framework
	var winVer  = new RegExp("(?:\\(|; )Windows NT ([0-9]\\.[0-9])(?:\\)|;)");
	var dotNet2 = new RegExp("(?:\\(|; )\\.NET CLR 2\\.0\\.[0-9]+(?:\\)|;)");
	
	// See if this is Windows NT, and fetch the version number into winRes[1]
	var winRes = winVer.exec(navigator.userAgent);
	
	var haveDotNet2 = false;
	
	if(winRes != null && parseFloat(winRes[1]) >= 6)
	{
		// User is running an NT version of Windows equal to or later than Vista
		// From this, make the assumption that they have the .Net framework v2
		// installed (as it came as part of the OS), or should understand what it
		// is if they have uninstalled it for some reason.
		haveDotNet2 = true;
	}
	else if(dotNet2.exec(navigator.userAgent) != null)
	{
		// User is running an earlier OS than Vista, but their user agent
		// indicates that they have the .Net framework v2 installed
		haveDotNet2 = true;
	}
	
	if(haveDotNet2)
	{
		// Hide the message about .Net 2 being required and its download link
		$("#dotnetreqmsg").hide();
	}
});
