// JavaScript Document

function browser(){
	/*
	firefox=false;
	ie7=false;
	ie6=false;
	netscape=false;
	opera=false;
	safari=false;
	windows=false;
	macintosh=false;
	linux=false;
	*/
	this.user_agent=navigator.userAgent;
	this.version=navigator.appVersion;
	
	if(navigator.userAgent.indexOf('Firefox')!=-1){
		this.firefox=true;
		this.navigateur='Firefox';
		this.hauteurDoc=window.innerHeight;
		this.largeurDoc=window.innerWidth-15;
	}
	if(navigator.userAgent.indexOf('MSIE 5')!=-1){
		this.ie5=true;
		this.navigateur='Internet Explorer 5';
		this.hauteurDoc=document.body.clientHeight;
		this.largeurDoc=document.body.clientWidth;
	}
	
	if(navigator.userAgent.indexOf('MSIE 6.0')!=-1){
		this.ie6=true;
		this.navigateur='Internet Explorer 6';
		this.hauteurDoc=document.body.clientHeight;
		this.largeurDoc=document.body.clientWidth;
	}
	if(navigator.userAgent.indexOf('MSIE 7')!=-1){
		this.ie7=true;
		this.navigateur='Internet Explorer 7';
		this.hauteurDoc=document.body.clientHeight;
		this.largeurDoc=document.body.clientWidth;
	}
	if(navigator.userAgent.indexOf('Netscape')!=-1){
		this.netscape=true;
		this.navigateur='Netscape';
		this.hauteurDoc=window.innerHeight;
		this.largeurDoc=window.innerWidth-15;
	}
	if(navigator.userAgent.indexOf('Opera')!=-1){
		this.opera=true;
		this.navigateur='Opera';
		this.hauteurDoc=window.innerHeight;
		this.largeurDoc=window.innerWidth-15;
	}
	if(navigator.userAgent.indexOf('Safari')!=-1){
		this.safari=true;
		this.navigateur='Safari';
		this.hauteurDoc=window.innerHeight;
		this.largeurDoc=window.innerWidth-15;
	}
	if(navigator.userAgent.indexOf('Win')!=-1){
		this.windows=true;
		this.os='Windows';
	}
	if(navigator.userAgent.indexOf('Mac')!=-1){
		this.macintosh=true;
		this.os='Macintosh';
	}
	if(navigator.userAgent.indexOf('Linux')!=-1){
		this.linux=true;
		this.os='Linux';
	}
}

browser.getMouseX=function(e){
	if(this.ie7 || this.ie6 || this.ie5){
		return event.offsetX;
	}else{
		return e.layerX;
	}
}

browser.getMouseY=function(e){
	if(this.ie7 || this.ie6 || this.ie5){
		return event.offsetY;
	}else{
		return e.layerY;
	}
}

requAjax=function(){
	 try
     {
          return new ActiveXObject("Microsoft.XMLHTTP");
     }
     catch(Error)
     {
          try
          {
               return new ActiveXObject("MSXML2.XMLHTTP");
          }
          catch(Error)
          {
               try
               {
                    return new XMLHttpRequest();
               }
               catch(Error)
               {
                    return alert("Impossible de créer l'objet XMLHttpRequest");
               }
          }
     }
/*
	try{
		return new ActiveXObject("Microsoft.XMLHTTP");
	}catch(e){
		try{
			return new XMLHttpRequest();
		}catch(e){
			document.write('Désolé, l\'Ajax n\'est pas supporté par votre configuration.');
		}
	}
*/
}

/*
browser.requAjax=function(){
	if(this.ie){
		return new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		return new XMLHttpRequest();
	}
}
*/