/* Sector27 - Hundenborn + Kiy GmbH, Dorsten - cb
	DHTML, JavaScript, CGI-Programmierung und Webdesign 
	Alle Rechte vorbehalten, (c)2001 by Sector 27 - cb
*/

/* Funktionsbeschreibungen -------------------------------------------------
	nach Einbindung dieser JS-Datei steht automatisch das Objekt app_env.browser.x zur Verfuegung, welches
	unterschiedliche Eigenschaften beschreibt
	app_env.browser.name     								  Name des Browser (op, ge, ns, ie, browser_name);
						.version									      Versionsnummer des Browsers;
						.ns4/ge5/ie4/ie5/ie5_5/ie6/op5	Spezifikation eines definierten Browsers
						.ns										          Spezifikation der Browsergruppe: Netscape 4.x
						.ie										          "        "        "      : IExplorer 4.x,5.x
						.dom										        "        "        "      : IExplorer 6, Netscape 6,Mozilla 0.x
						.dhtml									        Browsergruppe die nicht oben genannt wurde aber die DOM 1/2 Spez. erfuellt
*/

top.app_env=new check_browser();
function check_browser(){this.browser=new init_browser();}

function init_browser(){
	if(!navigator.userAgent.search(/.*Opera.*/))this.name="op";
	else if(!navigator.userAgent.search(/.*Gecko/))this.name="ge";    
	else if(!navigator.appName.search(/Netscape.*/))this.name="ns";
	else if(!navigator.appName.search(/Microsoft Internet Explorer.*/))this.name="ie";
	else this.name=browser_name;

	this.version = parseInt(navigator.appVersion);
	this.ns4=(this.name=="ns"&&this.version==4)?true:false;
	this.ge5=(this.name=="ge"&&this.version==5)?true:false;
	this.ie4=(navigator.userAgent.indexOf('MSIE 4')>0)?true:false;
	this.ie5=(navigator.userAgent.indexOf('MSIE 5.0')>0)?true:false;
	this.ie5_5=(navigator.userAgent.indexOf('MSIE 5.5')>0)?true:false;
	this.ie6=(navigator.userAgent.indexOf('MSIE 6')>0)?true:false;
	this.op5=(this.name=="op"&&this.version>=4&&this.version<6)?true:false;
  	this.op6=(this.name=="op"&&this.version>=6)?true:false;
  
	if(this.ie4)this.version=4;
	if(this.ie5)this.version=5;
	if(this.ie5_5)this.version=5.5;
	if(this.ie6)this.version=6;
	
	this.ns=(this.name=="ns"&&this.version==4)?true:false;
	this.ie=(this.name=="ie"&&this.version>=4 && this.version<6)?true:false;
	this.dom=(this.ge5||this.ie6)?true:false;
	this.dhtml=(!this.dom&&!this.ie&&!this.ns&&document.getElementById)?true:false;
	
	this.status=(this.ns||this.ie||this.dom||this.dhtml)?true:false;
}

