function DetecteNavigateur()
{ 
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom &&!this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom &&!this.opera5)?1:0;
	this.ie4=(document.all &&!this.dom &&!this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5)?1:0; 
	this.ns4=(document.layers &&!this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new DetecteNavigateur()
// Texte ‡ afficher

Affichage=new Array()
Affichage[0] = "Texte du premier exemple<br>sgsdgsdgsdgd<br>"
Affichage[1] = "Texte du second exemple"
Affichage[2] = "Texte du troisieme exemple"

// variables modifiables

PGauche= -1   				// Gauche de la fenetre par rapport ‡ la souris
PHaut= 21   				// Haut de la fenetre par rapport ‡ la souris
CentrerNS4= 0  				// Centrer sous NS 4
ApparitionProgressive= 1 	// 1 fait apparaitre la fenetre progressivement
Deplacement= 1  			// 1 La fenÍtre se dÈplace avec la souris
DetectionType= 1 			// 1 for 'smooth' window size detection, 0 for 'flip' window size detection.
DelaisApparition= 1   		// temps d'apparition de la fenetre en ms

// ne jamais modifier ce qui suit

var px = bw.ns4||window.opera?"":"px";

if(document.layers)
{ 
 	scrX= innerWidth; 
	scrY= innerHeight;
 	onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} };
}

function CreationFenetre(obj)
{								
 	this.elm= document.getElementById? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
 	this.css= bw.ns4?this.elm:this.elm.style;
 	this.wref= bw.ns4?this.elm.document:this.elm;
	this.obj= obj+'CreationFenetre'; eval(this.obj+'=this');
	this.w= bw.ns4? this.elm.clip.width: this.elm.offsetWidth;
	this.h= bw.ns4? this.elm.clip.height: this.elm.offsetHeight;
};

CreationFenetre.prototype.measureIt= function(){
	this.w= bw.ns4? this.elm.clip.width: this.elm.offsetWidth;
	this.h= bw.ns4? this.elm.clip.height: this.elm.offsetHeight;
};

CreationFenetre.prototype.writeIt= function(text){
	if (bw.ns4) {this.wref.write(text); this.wref.close()}
	else this.wref.innerHTML= text;
};

var GaucheSouris=0
var HautSouris=0
var PlaceGauche=0
var PlaceHaut=0

function DetecteMouvementSouris(e)
{
	GaucheSouris= (bw.ns4||bw.ns6)? e.pageX: bw.ie&&bw.win&&!bw.ie4? (event.clientX-2)+document.body.scrollLeft: event.clientX+document.body.scrollLeft;
	HautSouris= (bw.ns4||bw.ns6)? e.pageY: bw.ie&&bw.win&&!bw.ie4? (event.clientY-2)+document.body.scrollTop: event.clientY+document.body.scrollTop;
	if (EstInitialise && hovering && Deplacement) PositionneFenetre();
};

function PositionneFenetre()
{
	if (DetectionType==1) PlaceGauche= GaucheSouris+PGauche+tooltip.w > screenWscrolled? screenWscrolled-tooltip.w: GaucheSouris+PGauche;
	if (DetectionType==1) PlaceHaut= HautSouris+PHaut+tooltip.h > screenHscrolled? screenHscrolled-tooltip.h: HautSouris+PHaut;
	if (DetectionType==0) PlaceGauche= GaucheSouris+PGauche+tooltip.w > screenWscrolled? GaucheSouris-PGauche-tooltip.w: GaucheSouris+PGauche;
	if (DetectionType==0) PlaceHaut= HautSouris+PHaut+tooltip.h > screenHscrolled? HautSouris-PHaut-tooltip.h: HautSouris+PHaut;
	if (PlaceGauche<0) PlaceGauche= 0;
	if (PlaceHaut<0) PlaceHaut= 0;
	tooltip.css.left= PlaceGauche+px;
	tooltip.css.top= PlaceHaut+px;
};

var hovering=false, screenWscrolled=0, screenHscrolled=0;
CreationFenetre.prototype.showTimer= null;

function OTT(num,var1,var2,var3,var4,var5,var6,var7,var8)
{
if(var1 =='3'){
var var4='';
if (window.getSelection)
	{
		var4 = window.getSelection();
	}
	else if (document.getSelection)
	{
		var4 = document.getSelection();
	}
	else if (document.selection)
	{
		var4 = document.selection.createRange().text;
	}
	else return;
}

 if(tiptexte = file('/ad/js/tiptexte.php?var1='+ var1 +'&var2='+ var2 +'&var3='+ var3 +'&var4='+ var4 +'&var5='+ var5 +'&var6='+ var6 +'&var7='+ var7 +'&var8='+ var8 +'&num='+ escape(num)))
  {
var tiptexte
}

if(var1 == '1'){
	if(EstInitialise)
	{
		clearTimeout(tooltip.popTimer);
		doCacheTexte();
		if (bw.ns4)
		{
			var text= '<span class="StyleNetscape4">' + (CentrerNS4?'<center>':"") + tiptexte + (CentrerNS4?'</center>':"") + '</span>';
			tooltip.writeIt(text);
		}
		if (!bw.ns4) 
			tooltip.writeIt(tiptexte);
		screenWscrolled= screenW + (bw.ie?document.body.scrollLeft:pageXOffset);
		screenHscrolled= screenH + (bw.ie?document.body.scrollTop:pageYOffset);
		hovering= true;
		
		/* I'm using a timeout for ie4 here, because it doesn't store the measurements quickly enough. Does anybody know why this happens? */
		if (bw.ie4) setTimeout('tooltip.measureIt(); PositionneFenetre();', DelaisApparition/2);
		else { tooltip.measureIt(); PositionneFenetre(); }
		if (ApparitionProgressive) tooltip.showTimer= setTimeout('tooltip.blendIn()', DelaisApparition);
		if (!ApparitionProgressive) tooltip.showTimer= setTimeout('tooltip.css.visibility="visible"', DelaisApparition);
 }
}

if(var1 == '2'){
document.getElementById('numbox').innerHTML = tiptexte;
}
if(var1 == '3'){
document.getElementById('numbox').innerHTML = tiptexte;
}
};



CreationFenetre.prototype.popTimer= null;
function HTT()
{
	if (EstInitialise) tooltip.popTimer= setTimeout('doCacheTexte()', 30)
};

function doCacheTexte()
{
	hovering= false;
	clearTimeout(tooltip.showTimer);
	tooltip.css.visibility= 'hidden';
	clearTimeout(tooltip.fadeTimer);
	tooltip.i= 0;
};

var scrollbarWidth= bw.ns6&&bw.win?14:bw.ns6&&!bw.win?16:bw.ns4?16:0;
function measureScreen() 
{
	tooltip.css.top= 0+px;
	tooltip.css.left= 0+px;
	screenW= (bw.ie?document.body.clientWidth:innerWidth) - scrollbarWidth;
	screenH= (bw.ie?document.body.clientHeight:innerHeight);
};


CreationFenetre.prototype.blendIn= function()
{
	if (bw.ie && bw.win &&!bw.ie4) {
		this.css.filter= 'blendTrans(duration=0.5)';
		this.elm.filters.blendTrans.apply();
		this.css.visibility= 'visible';
		this.elm.filters.blendTrans.play();
	}
	else {
		this.css.visibility= 'visible';
		if (!bw.ns4) this.fadeIt();
	}
};
CreationFenetre.prototype.step= 8;
CreationFenetre.prototype.i= 0;
CreationFenetre.prototype.fadeTimer= null;
CreationFenetre.prototype.fadeIt= function()
{
	this.i+= this.step;
	//this.css.filter= 'alpha(opacity='+this.i+')';
	this.css.MozOpacity= this.i/100;
	if (this.i<100) this.fadeTimer= setTimeout(this.obj+'.fadeIt()', 40);
	else this.i= 0;
};

// Init function...
var EstInitialise= false;
function InitialiseFenetre(){
	//Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!!
	bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false
	if (bw.opera5) bw.ns6 = 0
	
	//Extending the browsercheck to add windows platform detection.
	bw.win= (navigator.userAgent.indexOf('Windows')>-1)

	tooltip= new CreationFenetre('DivFenetre');
	tooltip.elm.onmouseover= function(){ clearTimeout(tooltip.popTimer); if(bw.ns4){setTimeout('clearTimeout(tooltip.popTimer)',20)}; };
	tooltip.elm.onmouseout= doCacheTexte;
	if (bw.ns4) document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove= DetecteMouvementSouris;
	measureScreen();
	if (!bw.ns4) onresize= measureScreen;
	if (!bw.ns4) tooltip.elm.className= 'StyleNormal';
	if (bw.ie && bw.win &&!bw.ie4) tooltip.css.filter= 'alpha(opacity=100)'; //Preloads the windows filters.
	EstInitialise= true;
};

function file(fichier)
     {
     if(window.XMLHttpRequest) // FIREFOX
          xhr_object = new XMLHttpRequest();
     else if(window.ActiveXObject) // IE
          xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
     else
          return(false);
     xhr_object.open("GET", fichier, false);
     xhr_object.send(null);
     if(xhr_object.readyState == 4) return(xhr_object.responseText);
     else return(false);
     }