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.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom &&!this.opera5)?1:0;
	this.ie8=(this.ver.indexOf("MSIE 8")>-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.ie7||this.ie8
	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.ie8 ||this.ie7 || 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] = "<table border='1' cellpadding='2' id='table2' bgcolor='#FFFFFF' style='border-collapse: collapse' bordercolor='#D1CEA1' cellspacing='0'><tr><td width='134' class='form'><p align='center' class='form'><b>Nom de la salle</b></td><td align='center' valign='top' width='48' class='form'><b>Surface<br>(en m²)</b></td><td align='center' valign='top' width='48' class='form'><b>Classe<br></b><img border='0' src='../images/Pictos/CapaClasse.gif' width='30' height='30'></td><td align='center' valign='top' width='48' class='form'><b>Conférence<br></b><img border='0' src='../images/Pictos/CapaSurf.gif' width='25' height='31'></td><td align='center' valign='top' width='48' class='form'><b>en U<br></b><img border='0' src='../images/Pictos/CapaU.gif' width='25' height='31'></td><td align='center' valign='top' width='48' class='form'><b>Banquet<br></b><img border='0' src='../images/Pictos/CapaBanquet.gif' width='44' height='32'></td><td align='center' valign='top' width='49' class='form'><b>Cocktail<br></b><img border='0' src='../images/Pictos/CapaCocktail.gif' width='24' height='29'></td></tr><tr><td width='134' class='form'>L'ILE</td><td align='center' width='48' class='form'>85</td><td align='center' width='48' class='form'>85</td><td align='center' width='48' class='form'>70</td><td align='center' width='48' class='form'>45</td><td align='center' width='48' class='form'>80</td><td align='center' width='49' class='form'>-</td></tr><tr><td width='134' class='form'>L'ESTUAIRE</td><td align='center' width='48' class='form'>60</td><td align='center' width='48' class='form'>60</td><td align='center' width='48' class='form'>50</td><td align='center' width='48' class='form'>35</td><td align='center' width='48' class='form'>50</td><td align='center' width='49' class='form'>-</td></tr><tr><td width='134' class='form'>GARONNE</td><td align='center' width='48' class='form'>60</td><td align='center' width='48' class='form'>60</td><td align='center' width='48' class='form'>50</td><td align='center' width='48' class='form'>35</td><td align='center' width='48' class='form'>50</td><td align='center' width='49' class='form'>-</td></tr><tr><td width='134' class='form'>LE MARAIS</td><td align='center' width='48' class='form'>25</td><td align='center' width='48' class='form'>25</td><td align='center' width='48' class='form'>20</td><td align='center' width='48' class='form'>10</td><td align='center' width='48' class='form'>24</td><td align='center' width='49' class='form'>-</td></tr><tr><td width='134' class='form'>L'ENSEMBLE</td><td align='center' width='48' class='form'>230</td><td align='center' width='48' class='form'>230</td><td align='center' width='48' class='form'>70</td><td align='center' width='48' class='form'>-</td><td align='center' width='48' class='form'>200</td><td align='center' width='49' class='form'>300</td></tr><tr><td width='134' class='form'>SALLE DE PROJECTION</td><td align='center' width='48' class='form'>80</td><td align='center' width='48' class='form'>80</td><td align='center' width='48' class='form'>70</td><td align='center' width='48' class='form'>40</td><td align='center' width='48' class='form'>-</td><td align='center' width='49' class='form'>-</td></tr><tr><td width='134' class='form'>SOUS COMMISSION 1</td><td align='center' width='48' class='form'>35</td><td align='center' width='48' class='form'>35</td><td align='center' width='48' class='form'>15</td><td align='center' width='48' class='form'>15</td><td align='center' width='48' class='form'>-</td><td align='center' width='49' class='form'>-</td></tr><tr><td width='134' class='form'>SOUS COMMISSION 2</td><td align='center' width='48' class='form'>35</td><td align='center' width='48' class='form'>35</td><td align='center' width='48' class='form'>15 </td><td align='center' width='48' class='form'>15</td><td align='center' width='48' class='form'>-</td><td align='center' width='49' class='form'>-</td></tr><tr><td width='134' class='form'>TERRASSE</td><td align='center' width='48' class='form'>&nbsp;350</td><td align='center' width='48' class='form'>-</td><td align='center' width='48' class='form'>-</td><td align='center' width='48' class='form'>-</td><td align='center' width='48' class='form'>-</td><td align='center' width='49' class='form'>350 </td></tr><tr><td width='134' class='form'>LA GRANGE</td><td align='center' width='48' class='form'>270</td><td align='center' width='48' class='form'>270</td><td align='center' width='48' class='form'>200</td><td align='center' width='48' class='form'>-</td><td align='center' width='48' class='form'>240</td><td align='center' width='49' class='form'>-</td></tr></table>"


// variables modifiables

//PGauche= -180   				// Gauche de la fenetre par rapport à la souris
//PHaut=-231  				// 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 replaceChars(entry) {
out = "&#quot;"; // replace this
add = "'"; // with this
temp = "" + entry; // temporary holder

while (temp.indexOf(out)>-1) {
pos= temp.indexOf(out);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out.length), temp.length));
}
return;
}



function AfficheTexte(chaine)
{

//chaine = replaceChars(chaine);

//alert(chaine);

	if(EstInitialise)
	{
		clearTimeout(tooltip.popTimer);
		doCacheTexte();
		if (bw.ns4)
		{
			var text= '<span class="StyleNetscape4">' + (CentrerNS4?'<center>':"") + chaine + (CentrerNS4?'</center>':"") + '</span>';
			tooltip.writeIt(text);
		}
		if (!bw.ns4) tooltip.writeIt(chaine);
		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);
 }
};


CreationFenetre.prototype.popTimer= null;
function CacheTexte()
{
	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)'; 
	EstInitialise= true;
};

// Initialise la fenetre
if(bw.bw &&!EstInitialise) onload= InitialiseFenetre; preloadImages();