/****************************************************************** Golem13 (c)2001 Cube Systèmes ******

Objets Browser ........... Objet Browser se chargeant de déterminer le type de client

 Propriétés: ns, ns2, ns3, ns4, ns4up, ns45, nsonly, ns5, ns5up
             ie, ie3, ie4, ie4up, ie5, ie5up, opera, webtv
             js, dom

 Ex: var B = new Browser(); if (B.ie5) { ...
 
********************************************************************************************************/

var B = new Browser();

function Browser() {
	var agt      = navigator.userAgent.toLowerCase(); 
	var is_major = parseInt(navigator.appVersion); 
	var is_minor = parseFloat(navigator.appVersion);
	
	//alert(is_major+', '+ is_minor);
	
	// NETSCAPE	
	var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1));
	this.ns     = is_nav;
	this.ns2    = (is_nav && (is_major == 2));
	this.ns3    = (is_nav && (is_major == 3));
	this.ns4    = (is_nav && (is_major == 4));
	this.ns4up  = (is_nav && (is_major >= 4));
	this.ns45   = (is_nav && (is_major == 4) && (is_minor >= 4.5) && (is_minor < 5));
	this.nsonly = (is_nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)));
	this.ns5    = (is_nav && (is_major == 5));
	this.ns5up  = (is_nav && (is_major >= 5));
	
	// INTERNET EXPLORER
	var is_ie  = (agt.indexOf("msie") != -1);
	this.ie    = is_ie
	this.ie3   = (is_ie && (is_major < 4));
	this.ie4   = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) && (agt.indexOf("msie 5.5")==-1) && (agt.indexOf("msie 6.0")==-1));
	this.ie4up = (is_ie && (is_major >= 4));
	this.ie5   = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) && (agt.indexOf("msie 5.5")==-1) && (agt.indexOf("msie 6.0")==-1));
	this.ie5up = (is_ie && !(this.ie3) && !(this.ie4));
	
	// AUTRES...
	this.opera = (agt.indexOf("opera") != -1); 
	this.webtv = (agt.indexOf("webtv") != -1); 
	
	
	// JAVASCRIPT
	var is_js;
	if (this.ns2 || this.ie3) this.js = 1.0
	else if (this.ns3 || this.opera) this.js = 1.1
	else if ((this.ns4 && (is_minor <= 4.05)) || this.ie4) this.js = 1.2 
	else if ((this.ns4 && (is_minor > 4.05)) || this.ie5) this.js = 1.3 
	else if (this.ns5) this.js = 1.4 
	else if (this.ns && (is_major > 5)) this.js = 1.4 
	else if (this.ie && (is_major > 5)) this.js = 1.3 
	else this.js = 0.0;
	
	// Modele Objet
	if (document.getElementById) this.dom = true;
}

