 /**
  * BrowserInfo() - Object
  * @author nobs
  *
  * created 07.02.2009 
  */

 var DHTML = false, DOM = false, MS = false, IE=false, NS = false, OP = false, FF=false, EXOT=false;
 var engineName="",engineVersion="-1";

 function getBrowserName()
	{
	if (navigator.appName=="Microsoft Internet Explorer" || navigator.userAgent.indexOf("MSIE")>-1)
		{
		return "MSIE";
		}
	if (navigator.appName=="Opera")
		{
		return "Opera";
		}
	if (navigator.appName=="Netscape" && navigator.userAgent.indexOf("Netscape/")>-1)
		{
		return "Netscape";
		}
	if ((navigator.appName=="Firefox" || navigator.appName=="Netscape") && navigator.userAgent.indexOf("Firefox/")>-1)
		{
		return "Firefox";
		}
	return "Nothing";
	}
		
 function getBrowserVersion()
	{
	if (navigator.appName=="Microsoft Internet Explorer" || navigator.userAgent.indexOf("MSIE")>-1)
		{
		var ind=navigator.userAgent.indexOf("MSIE");
		if (ind>-1)
			{
			return navigator.userAgent.substr(ind+5,3);
			}
		}
	if (navigator.appName=="Opera")
		{
		var ind=navigator.userAgent.indexOf("Opera/");
		if (ind>-1)
			{
			return navigator.userAgent.substr(ind+6,3);
			}
		}
	if (navigator.appName=="Netscape" && navigator.userAgent.indexOf("Netscape/")>-1)
		{
		var ind=navigator.userAgent.indexOf("Netscape/");
		if (ind>-1)
			{
			return navigator.userAgent.substr(ind+9,3);
			}
		}
	if ((navigator.appName=="Firefox" || navigator.appName=="Netscape") && navigator.userAgent.indexOf("Firefox/")>-1)
		{
		var ind=navigator.userAgent.indexOf("Firefox/");
		if (ind>-1)
			{
			return navigator.userAgent.substr(ind+8,3);
			}
		}
	return "Nothing";
	}
	
 function getEngineName()
	{
	if (navigator.userAgent.indexOf("Mozilla")>-1)
		{
		if (navigator.userAgent.indexOf("Gecko")>-1)
			{
			return "Mozilla Gecko";
			}
		else
			{
			return "Mozilla Compatible";
			}
		}
	else
		{
		if (navigator.userAgent.indexOf("Opera")>-1)
			{
			return "Opera";
			}
		}
	return "Nothing";
	}
	
 function getEngineVersion()
	{
	var ind=-1;
	if (navigator.userAgent.indexOf("Mozilla/")>-1)
		{
		ind=navigator.userAgent.indexOf("Mozilla/");
		if (ind>-1)
			{
			return navigator.userAgent.substr(ind+8,3);
			}
		}
	if (navigator.userAgent.indexOf("Opera/")>-1)
		{
		ind=navigator.userAgent.indexOf("Opera/");
		if (ind>-1)
			{
			return navigator.userAgent.substr(ind+6,3);
			}
		}
	return "Nothing";
	}
	
 function getArchitecture()
 	{
 	return navigator.platform;
 	}
 	
 function getPlattformName()
	{
	if (navigator.userAgent.indexOf("Windows NT")>-1)
		{
		return "Windows NT";
		}
	if (navigator.userAgent.indexOf("Windows")>-1)
		{
		return "Windows";
		}
		
	// Laptop für Linux - Mac -> ka
	}

 function getPlattformVersion()
	{
	var ind="-1";
	if (navigator.userAgent.indexOf("Windows NT ")>-1)
		{
		ind=navigator.userAgent.indexOf("Windows NT ");
		return navigator.userAgent.substr(ind+11,3);
		}
	if (navigator.userAgent.indexOf("Windows ")>-1)
		{
		ind=navigator.userAgent.indexOf("Windows ");
		return navigator.userAgent.substr(ind+8,3);
		}
		
	// Laptop für Linux - Mac -> ka
	}
 
 function getLanguage()
 	{// FF - language/browserLanguage is null
 	if (NS || FF)
 		{
 		if (FF)
 			{
 			if (navigator.browserLanguage!="" && null!=navigator.browserLanguage)
 				return navigator.browserLanguage;
 			else
 				return "Nothing";
 			}
 		if (NS)
 			{
 			return navigator.language.substr(0,2);
 			}
 		}
 	else
 		{
 		return navigator.browserLanguage;
 		}
 	}
 	
 function hasCookies()
 	{
 	return navigator.cookieEnabled;
 	}
 
 function hasDOM()
 	{
 	return DOM;
 	}
 	
 function hasDHTML()
 	{
 	return DHTML;
 	}	
 	
 function hasJava()
 	{
 	return navigator.javaEnabled();
 	}
 	
 function getJavaVersion()
 	{
 	if (hasJava())
 		{
 		if (MS)
 			return "search MSIE"; // Packages.java.lang.System.getProperty("java.specification.version");
 		else
 			return Packages.java.lang.System.getProperty("java.specification.version");
 		}
 	else
 		return "";
 	}
  
 function getVersionFloat()
	{
	if (navigator.appName=="Microsoft Internet Explorer" || navigator.userAgent.indexOf("MSIE")>-1)
		{
		var ind=navigator.userAgent.indexOf("MSIE");
		if (ind>-1)
			{
			return parseFloat(navigator.userAgent.substr(ind+5,5));
			}
		}
	if (navigator.appName=="Opera")
		{
		var ind=navigator.userAgent.indexOf("Opera/");
		if (ind>-1)
			{
			return parseFloat(navigator.userAgent.substr(ind+6,5));
			}
		}
	if (navigator.appName=="Netscape" && navigator.userAgent.indexOf("Netscape/")>-1)
		{
		var ind=navigator.userAgent.indexOf("Netscape/");
		if (ind>-1)
			{
			return parseFloat(navigator.userAgent.substr(ind+9,5));
			}
		}
	if ((navigator.appName=="Firefox" || navigator.appName=="Netscape") && navigator.userAgent.indexOf("Firefox/")>-1)
		{
		var ind=navigator.userAgent.indexOf("Firefox/");
		if (ind>-1)
			{
			return parseFloat(navigator.userAgent.substr(ind+8,5));
			}
		}
	return -1.0;
	}

 function initBrowser()
	{
	if (navigator.appName=="Microsoft Internet Explorer" || navigator.userAgent.indexOf("MSIE")>-1)
		{
		IE=true;
		MS=true;
		}
	if (navigator.appName=="Opera")
		{
		OP=true;
		}
	if (navigator.appName=="Netscape" && navigator.userAgent.indexOf("Netscape")>-1)
		{
		NS=true;
		}
	if ((navigator.appName=="Firefox" || navigator.appName=="Netscape") && navigator.userAgent.indexOf("Firefox")>-1)
		{
		FF=true;
		}
	if (document.getElementById) 
		{
		DHTML = true;
		DOM = true;
		}
	if (!(NS || MS || IE || FF || OP))
		{
		EXOT=true;
		}
	}

 function BrowserInfo()
	{
	this.initMe=initBrowser;
	this.initMe();
	
	this.getName=getBrowserName;
	this.getVersion=getBrowserVersion;
	this.getEngineName=getEngineName;
	this.getEngineVersion=getEngineVersion;
	this.getPlattformName=getPlattformName;
	this.getPlattformVersion=getPlattformVersion;
	this.getVersionFloat=getVersionFloat;
	this.getEngineVersionFloat="getEngineVersionFloat";
	this.getArchitecture=getArchitecture;
	this.getLanguage=getLanguage;
	this.getJavaVersion=getJavaVersion;
	
	this.MS=MS;
	this.IE=IE;
	this.NS=NS;
	this.FF=FF;
	this.OP=OP;
	this.EXOT=EXOT;
	
	this.hasCookies=hasCookies;
	this.hasJava=hasJava;
	this.hasAjax=hasAjax;
	this.hasDOM=hasDOM;
	this.hasDHTML=hasDHTML;
	}
