function zp_UserEnv_getVersionOf(token)
{
	eval("var exp = /"+token+"(\\d.*)/");
	exp.exec(this.userAgent);
	return parseFloat(RegExp.$1);
}

function zp_UserEnv()
{

// uebernommene Eigenschaften und Methoden

	this.appCodeName=navigator.appCodeName;
	this.appName=navigator.appName;
	this.appVersion=navigator.appVersion;
	this.cookieEnabled=navigator.cookieEnabled;
	this.language=navigator.language;
	this.platform=navigator.platform;
	this.userAgent=navigator.userAgent;
	this.javaEnabled=navigator.javaEnabled();


	this.getVersionOf=zp_UserEnv_getVersionOf;

	this.MSIEVersion=this.getVersionOf("MSIE ");
	this.GeckoVersion=this.getVersionOf("Gecko\\/");
	this.MozillaVersion=this.getVersionOf("rv:");
	this.NetscapeVersion=this.getVersionOf("Netscape\\/");

// Gecko based

	this.isGeckoBased=false;

	if (this.userAgent.indexOf('Gecko') != -1)
			this.isGeckoBased=true;

// commonAppName

	this.commonAppName=this.appName;	
	
	if
	(
		this.appName=='Netscape' &&
		this.userAgent.indexOf('Netscape') == -1 &&
		this.isGeckoBased
	)
	{
		this.commonAppName="Mozilla";	
	}

// commonAppVersion

	this.commonAppVersion=parseFloat(this.appVersion);
	
	if (this.commonAppName=='Microsoft Internet Explorer')
		this.commonAppVersion=this.MSIEVersion;

	else if (this.commonAppName=='Mozilla')
		this.commonAppVersion=this.MozillaVersion;

	else if
		(
			this.commonAppName=='Netscape' &&
			this.isGeckoBased
		)
		{
			this.commonAppVersion=this.NetscapeVersion;
		}

// commonPlatform

	this.commonPlatform=this.platform;

	// Win32
	if (this.commonPlatform.indexOf('Win')==0)
		this.commonPlatform='Windows';

	// MacPPC
	else if (this.commonPlatform.indexOf('Mac')==0)
		this.commonPlatform='Macintosh';

	// X11-Based 
	else if (this.userAgent.indexOf('X11')!=-1)
		this.commonPlatform='Unix';


	this.availHeight=screen.availHeight;
	this.availWidth=screen.availWidth;
	this.width=screen.width;
	this.height=screen.height;
	this.colorDepth=screen.colorDepth;
	this.pixelDepth=screen.pixelDepth;

}

var zp_userEnv=new zp_UserEnv();

//alert("zp_userEnv.userAgent:"+zp_userEnv.userAgent+"\nzp_userEnv.appName:"+zp_userEnv.appName+"\nzp_userEnv.platform:"+zp_userEnv.platform+"\nzp_userEnv.appVersion:"+zp_userEnv.appVersion);

//alert("zp_userEnv.availHeight:"+zp_userEnv.availHeight+"\nzp_userEnv.availWidth:"+zp_userEnv.availWidth+"\nzp_userEnv.height:"+zp_userEnv.height+"\nzp_userEnv.width:"+zp_userEnv.width+"\nzp_userEnv.colorDepth:"+zp_userEnv.colorDepth+"\nzp_userEnv.pixelDepth:"+zp_userEnv.pixelDepth);

//alert (zp_userEnv.commonAppName+", "+zp_userEnv.commonAppVersion+", "+zp_userEnv.commonPlatform);

