	
	var browserDetect = {
		init: function () {
			this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
			this.version = this.searchVersion(navigator.userAgent)
				|| this.searchVersion(navigator.appVersion)
				|| "an unknown version";
			this.OS = this.searchString(this.dataOS) || "an unknown OS";
		},
		searchString: function (data) {
			for (var i=0;i<data.length;i++)	{
				var dataString = data[i].string;
				var dataProp = data[i].prop;
				this.versionSearchString = data[i].versionSearch || data[i].identity;
				if (dataString) {
					if (dataString.indexOf(data[i].subString) != -1)
						return data[i].identity;
				}
				else if (dataProp)
					return data[i].identity;
			}
		},
		searchVersion: function (dataString) {
			var index = dataString.indexOf(this.versionSearchString);
			if (index == -1) return;
			return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
		},
		dataBrowser: [
			{ 	string: navigator.userAgent,
				subString: "OmniWeb",
				versionSearch: "OmniWeb/",
				identity: "OmniWeb"
			},
			{
				string: navigator.vendor,
				subString: "Apple",
				identity: "Safari"
			},
			{
				prop: window.opera,
				identity: "Opera"
			},
			{
				string: navigator.vendor,
				subString: "iCab",
				identity: "iCab"
			},
			{
				string: navigator.vendor,
				subString: "KDE",
				identity: "Konqueror"
			},
			{
				string: navigator.userAgent,
				subString: "Firefox",
				identity: "Firefox"
			},
			{
				string: navigator.vendor,
				subString: "Camino",
				identity: "Camino"
			},
			{		// for newer Netscapes (6+)
				string: navigator.userAgent,
				subString: "Netscape",
				identity: "Netscape"
			},
			{
				string: navigator.userAgent,
				subString: "MSIE",
				identity: "Explorer",
				versionSearch: "MSIE"
			},
			{
				string: navigator.userAgent,
				subString: "Gecko",
				identity: "Mozilla",
				versionSearch: "rv"
			},
			{ 		// for older Netscapes (4-)
				string: navigator.userAgent,
				subString: "Mozilla",
				identity: "Netscape",
				versionSearch: "Mozilla"
			}
		],
		dataOS : [
			{
				string: navigator.platform,
				subString: "Win",
				identity: "Windows"
			},
			{
				string: navigator.platform,
				subString: "Mac",
				identity: "Mac"
			},
			{
				string: navigator.platform,
				subString: "Linux",
				identity: "Linux"
			}
		]
	};
	
//	-----------------------------------------------------------------------------------------------------------------------

	var XMLHttp = {
		responseText : null,
		get : function(file,arg,doBefore,doAfter){
			var _this 	= this;
			var xhr 	= new XMLHttpRequest();
			if(doBefore!=null) doBefore();
			xhr.onreadystatechange = function(){
			if(xhr.readyState == 4){
					_this.responseText = xhr.responseText;
					if(doAfter!=null) doAfter();
				}
			}
			xhr.open("GET",file+arg);
			xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			xhr.send(null);	
		},
		post : function(file,arg,doBefore,doAfter){
			var _this 	= this;
			var xhr 	= new XMLHttpRequest();
			if(doBefore!=null) doBefore();
			xhr.onreadystatechange=function(){ 
				if(xhr.readyState == 4 && xhr.status==200){
					_this.responseText = xhr.responseText;
					if(doAfter!=null) doAfter();
				}
			};
			xhr.open("POST", file, true); 
			xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			xhr.send(arg);
		}
	};
	
//	-----------------------------------------------------------------------------------------------------------------------

	var getPosition = {
		findPosX : function(obj) {
			var curleft = 0;
			if(obj.offsetParent)
				while(1) {
					curleft += obj.offsetLeft;
					if(!obj.offsetParent)
						break;
					obj = obj.offsetParent;
				}
				else if(obj.x)
					curleft += obj.x;
			return curleft;
		},
		findPosY: function(obj){
			var curtop = 0;
			if(obj.offsetParent){
				while(1){
					curtop += obj.offsetTop;
					if(!obj.offsetParent) break;	
					obj = obj.offsetParent;
				}
			}else if(obj.y) curtop += obj.y;	
			return curtop;
		},
		getWindowHeight: function(){
			var windowHeight=0;
			if (typeof(window.innerHeight)=='number') {
				windowHeight=window.innerHeight;
			}else{
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}else{
					if (document.body&&document.body.clientHeight) {
						windowHeight=document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		},
		getWindowWidth: function(){
			var windowWidth=0;
			if (typeof(window.innerWidth)=='number') {
				windowWidth = window.innerWidth;
			}else{
				if (document.documentElement && document.documentElement.clientWidth) {
					windowWidth = document.documentElement.clientWidth;
				}else{
					if (document.body&&document.body.clientWidth) {
						windowWidth = document.body.clientWidth;
					}
				}
			}
			return windowWidth;
		}
	};

//	-----------------------------------------------------------------------------------------------------------------------

	var cook = {
		writeCookie: function (nom, valeur){
			var argv=this.writeCookie.arguments;
			var argc=this.writeCookie.arguments.length;
			var expires=(argc > 2) ? argv[2] : null;
			var path=(argc > 3) ? argv[3] : null;
			var domain=(argc > 4) ? argv[4] : null;
			var secure=(argc > 5) ? argv[5] : false;
			document.cookie=nom+"="+escape(valeur)+
			((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
			((path==null) ? "" : ("; path="+path))+
			((domain==null) ? "" : ("; domain="+domain))+
			((secure==true) ? "; secure" : "");
		},
		getCookieVal: function (offset){
			var endstr=document.cookie.indexOf (";", offset);
			if (endstr==-1) endstr=document.cookie.length;
			return unescape(document.cookie.substring(offset, endstr));
		},
		readCookie: function(nom){
			var arg=nom+"=";
			var alen=arg.length;
			var clen=document.cookie.length;
			var i=0;
			while (i<clen){
				var j=i+alen;
				if (document.cookie.substring(i, j)==arg) return this.getCookieVal(j);
				i=document.cookie.indexOf(" ",i)+1;
				if (i==0) break;
			}
			return null;
		},
		delCookie: function(nom){
			date=new Date;
			date.setFullYear(date.getFullYear()-1);
			this.writeCookie(nom,null,date);
		}
	};
	
//	-----------------------------------------------------------------------------------------------------------------------	
	
	function setTooltips(id){
		this.container = typeof(id)=='string' ? document.getElementById(id) : id ;
		this.href = this.container.getElementsByTagName('a');
		this.init();
	};
	setTooltips.prototype.init = function(){
		if(document.getElementById('__tooltip')) document.body.removeChild(document.getElementById('__tooltip'));
		var _this = this;
		for(var i=0;i<this.href.length;i++){
			if(!this.href[i].rel) continue;
			if(this.href[i].parentNode.style.position!='absolute')
				this.href[i].parentNode.style.position = "relative";
			this.href[i].onmouseover = function(){ _this.setTip(this); };
			this.href[i].onmouseout 	= function(){ _this.removeTip(this); };
			this.href[i].onmouseup = function(){ _this.removeTip(this); };
		}
	};
	setTooltips.prototype.setTip = function(current){
		var 	posX = getPosition.findPosX(current),
			posY = getPosition.findPosY(current.parentNode)-current.parentNode.offsetHeight;
		this.tipText = current.rel;
		this.tipContainer = document.createElement('div');
		this.tipContainer.innerHTML = this.tipText;
		this.tipContainer.id = '__tooltip';
		this.tipContainer.className = 
			this.tipText.match(/supprimer/) || this.tipText.match(/quitter/)
			? this.tipContainer.className = '__tooltip __tooltipwarn' 
			: this.tipContainer.className = '__tooltip';
		this.tipContainer.setAttribute(
			'style',
			'top:'+posY+'px;'+
			'left:'+posX+'px;'
		)
		document.body.appendChild(this.tipContainer);
		if((getPosition.findPosX(this.tipContainer)+this.tipContainer.offsetWidth)
			>(getPosition.getWindowWidth())){
			var marge = (getPosition.findPosX(this.tipContainer)+this.tipContainer.offsetWidth)
						-getPosition.getWindowWidth();
			this.tipContainer.style.left = this.tipContainer.offsetLeft-(marge+20)+"px";
		}
	};
	setTooltips.prototype.removeTip = function(current){
		if(document.getElementById('__tooltip'))
			document.body.removeChild(this.tipContainer)
	};