/*

	Example taken from http://www.computerbytesman.com/privacy/supercookiedemo.htm

*/

function getProfile()
{
	document.UserProfile = "" ;
	
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		document.writeln('<OBJECT classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ID=WMP WIDTH=1 HEIGHT=1></OBJECT>');
	}
	else
	{
		document.writeln('<EMBED TYPE="application/x-mplayer2" NAME=WMP WIDTH=2 HEIGHT=2></EMBED><br><br>');
	}
	
	function NSShow()
	{
	
		if(typeof(document.WMP) == "object")
		{
			document.SuperCookie.value = document.WMP.GetClientID();
		}
		else
		{
			document.SuperCookie.value = "None";
		}
		return;
	
	}
	
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		if(typeof(document.WMP) == "object" &&
	   	   typeof(document.WMP.ClientID) == "string")
		{
			 document.SuperCookie = document.WMP.ClientID;
		}
		else
		{
			document.SuperCookie.value = "None";
		}
	}
	else
	{
		setTimeout("NSShow()", 100);
	}
	
	s = screen 
	n = navigator
	
	/*
		before we submit we md5 encode the collected data to ensure the user's privacy...
	
		basically we are not interested the user's details, all we need is some kind of unique
		identifier so we have a better chance of telling two people apart, since you should not
		be supposed to log in with the same name from two different places at the same time...
	*/
	
	document.UserProfile = hex_md5( "{"+s.width+s.height+s.colordepth+"}{"+n.appCodeName+n.appName+n.appVersion+n.mimeTypes+n.platform+n.plugins+n.userAgent+"}{"+document.SuperCookie+"}" ) ;
	
	/* get the md5 of all the info... this is the only part we will be submitting... */
	
	document.write( document.UserProfile );
	
	// see if there's a loginbox on the page...
	lsf = document.forms.loginsnippetform
		
	if ( lsf )
	{
		// ok, there is, add our cookie...
		if ( lsf.profile )
			lsf.profile.value = document.UserProfile ;
	}

	return document.UserProfile ;

}