function fNav(sens, txt) {
	zonetxt = (sens == 'prec') ? "fPrecTxt" : "fSuivTxt";
	document.getElementById(zonetxt).innerHTML = (document.getElementById(zonetxt).innerHTML == "") ? txt : "";
}

function fNav2(sens, txt) {
	zonetxt = (sens == 'prec') ? "fPrecTxt2" : "fSuivTxt2";
	document.getElementById(zonetxt).innerHTML = (document.getElementById(zonetxt).innerHTML == "") ? txt : "";
}

function lib_bwcheck(){	//Browsercheck (needed)
	this.ver = navigator.appVersion;
//alert("this.ver [" + this.ver + "]");    
	this.agent = navigator.userAgent;
	this.dom = document.getElementById?1:0;
	this.opera5 = (navigator.userAgent.indexOf("Opera") > -1 && document.getElementById) ? 1 : 0;
	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;   //  AD    2007-11-02       Added test for IE7
	this.ie8 = (this.ver.indexOf("MSIE 8") > -1 && this.dom && !this.opera5) ? 1 : 0;   //  AD    2010-03-24       Added test for IE8
//	this.ie4 = (document.all && !this.dom && !this.opera5) ? 1 : 0;
	this.ie = 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.ie6 || this.ie5 || this.ns6 || this.opera5);
	return this;
}

var bw = lib_bwcheck();
// Variables to set:

messages= new Array();
// Write your descriptions in here.
messages[0]="Arboretum de ch&egrave;vreloup";
messages[1]="Galerie de min&eacute;ralogie";
messages[2]="Ecouter";
messages[3]="Plan du lieu";
messages[4]="Information";
messages[5]="Panoramique";


// To have more descriptions just add to the array.

fromX = -1;			// How much from the actual mouse X should the description box appear?
fromY = 21;			// How much from the actual mouse Y should the description box appear?
useFading = 1;		// 1 for a fading effect in windows explorer 5+ and all platforms ns6, 0 for no fading effect.
animation = 1;		// 1 if you want animation, 0 for no animation.
detectiontype = 0;	// 1 for 'smooth' window size detection, 0 for 'flip' window size detection.
delay = 600;		// The time before showing the popup, in milliseconds.


/*** There should be no need to change anything beyond this. ***/

// A unit of measure that will be added when setting the position of a layer.
var px = window.opera ? "" : "px";


// object constructor...
function makeTooltip(obj) {
	this.elm = document.getElementById(obj);
	this.css = this.elm.style;
	this.wref = this.elm;
	this.obj = obj + 'makeTooltip';
	eval(this.obj + '=this');
	this.w = this.elm.offsetWidth;
	this.h = this.elm.offsetHeight;
};
makeTooltip.prototype.measureIt = function() {
	this.w = this.elm.offsetWidth;
	this.h = this.elm.offsetHeight;
};
makeTooltip.prototype.writeIt= function(text){
	this.wref.innerHTML= text;
};

// Mousemove detection
var mouseX = 0, mouseY = 0, setX = 0, setY = 0;
function getMousemove(e) {
	mouseX = bw.ns6 ? e.pageX : bw.ie && bw.win ? (event.clientX-2)+document.body.scrollLeft : event.clientX+document.body.scrollLeft;
	mouseY = bw.ns6 ? e.pageY : bw.ie && bw.win ? (event.clientY-2)+document.body.scrollTop : event.clientY+document.body.scrollTop;
	if (isLoaded && hovering && animation)
		placeIt();
};
function placeIt(texte, haut, gauche, largeur){
/*
	if (detectiontype == 1)
		setX = mouseX+fromX+tooltip.w > screenWscrolled ? screenWscrolled-tooltip.w : mouseX+fromX;
	if (detectiontype == 1)
		setY = mouseY+fromY+tooltip.h > screenHscrolled ? screenHscrolled-tooltip.h : mouseY+fromY;
	if (detectiontype == 0)
		setX = mouseX+fromX+tooltip.w > screenWscrolled ? mouseX-fromX-tooltip.w : mouseX+fromX;
	if (detectiontype == 0)
		setY = mouseY+fromY+tooltip.h > screenHscrolled ? mouseY-fromY-tooltip.h : mouseY+fromY;
	if (setX < 0)
		setX = 0;
	if (setY < 0)
		setY = 0;

	if (num < 2) {
		tooltip.css.height = 28 + px;
		tooltip.css.width = 90 + px;
	} else {
	*/
	//tooltip.css.height= 14+px;

	if (browser == 'Netscape Navigator')
		haut -= 35;
	tooltip.css.width = largeur + px;
/*
	if(num == 5) {
		tooltip.css.borderWidth = 0 + px;
		tooltip.css.backgroundColor = "white";
	}

	}
*/
	tooltip.css.left = gauche + px;
	tooltip.css.top = haut + px;
};

// Main popUp function.///////////++++++++++++++++++++/////////////////
var hovering = false, screenWscrolled = 0, screenHscrolled = 0;
makeTooltip.prototype.showTimer = null;
function popUp(texte, haut, gauche, largeur) {
	if (isLoaded) {
		clearTimeout(tooltip.popTimer);
		dopopOut();
		tooltip.writeIt(texte);
		screenWscrolled = screenW + (bw.ie ? document.body.scrollLeft : pageXOffset);
		screenHscrolled = screenH + (bw.ie ? document.body.scrollTop : pageYOffset);
		hovering = true;

		tooltip.measureIt();
		placeIt(texte, haut, gauche, largeur);
		if (useFading)
			tooltip.showTimer = setTimeout('tooltip.blendIn()', delay);
		if (!useFading)
			tooltip.showTimer = setTimeout('tooltip.css.visibility="visible"', delay);
	}
};


// Hiding routines
makeTooltip.prototype.popTimer = null;
function popOut(){
	if (isLoaded)
		tooltip.popTimer = setTimeout('dopopOut()', 30);
};

function dopopOut(){
	hovering = false;
	clearTimeout(tooltip.showTimer);
	tooltip.css.visibility = 'hidden';
	tooltip.css.borderWidth = 1 + px;
	tooltip.css.backgroundColor = "#dfdfdf";
	clearTimeout(tooltip.fadeTimer);
	tooltip.i = 0;
};

// Measure screensize.
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);
};

// Opacity methods.
makeTooltip.prototype.blendIn = function() {
	if (bw.ie && bw.win) {
		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';
		this.fadeIt();
	}
};
makeTooltip.prototype.step = 8;
makeTooltip.prototype.i = 0;
makeTooltip.prototype.fadeTimer = null;
makeTooltip.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 isLoaded = false;
function popupInit() {
	//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 makeTooltip('divTooltip');
	tooltip.elm.onmouseover = function() {
		clearTimeout(tooltip.popTimer);
	};
	tooltip.elm.onmouseout = dopopOut;

//	document.onmousemove = getMousemove;
	measureScreen();
	onresize = measureScreen;
	tooltip.elm.className = 'normalStyle';
	if (bw.ie && bw.win && !bw.ie4)
		tooltip.css.filter = 'alpha(opacity=100)'; //Preloads the windows filters.
	isLoaded= true;
};

// Initiates page on pageload if the browser is ok.
//if(bw.bw && !isLoaded) onload= popupInit;

function initBul() {
	if (bw.bw && !isLoaded)
		popupInit();
}
