var w3c = (document.getElementById&&!document.all)?1:0; 
var ie = (document.all)?1:0;
var actif=0;

function PhotoOver(){
actif=1;
}
function PhotoOut(){
actif=0;
}

function deplacer(e) {
if (actif==1){
curX = (w3c) ? e.pageX : event.x + ietruebody().scrollLeft;
curY = (w3c) ? e.pageY : event.y + ietruebody().scrollTop;

winwidth = ie && !window.opera ? ietruebody().clientWidth : window.innerWidth - 20;
winheight = ie && !window.opera ? ietruebody().clientHeight : window.innerHeight - 20;

var rightedge = ie && !window.opera ? winwidth - event.clientX - xOffset : winwidth - e.clientX - xOffset;
var bottomedge = ie && !window.opera ? winheight - event.clientY - yOffset : winheight - e.clientY - yOffset;

var leftedge = (xOffset < 0) ? xOffset*(-1) : -1000
}
}

document.onmousemove = deplacer; // des que la souris bouge, on appelle la fonction move pour mettre a jour la position de la bulle.

window.onresize = redimensionne; // dès que la fenetre est redimensionnée
window.onscroll = redimensionne;

function ReplaceLaBulle(){
laBulle.style.left ='0px';
if (ie) 
	{
	laBulle.style.width = (winwidth-10)+'px';
	laBulle.style.height = (winheight-10)+'px';
	laBulle.style.top = ietruebody().scrollTop+'px';
	}
	else 
	{
	laBulle.style.width = (winwidth)+'px';
	laBulle.style.height = (winheight+20)+'px';
	laBulle.style.top = (ietruebody().scrollTop)+'px';
	}
}

function ReplaceLeMembre(){
lePopMembre.style.left ='0px';
if (ie) 
	{
	lePopMembre.style.width = (winwidth)+'px';
	lePopMembre.style.height = (winheight)+'px';
	lePopMembre.style.top = ietruebody().scrollTop+'px';
	lePopMembre.style.paddingTop = (mon_curY+211-(ietruebody().scrollTop))+'px'; // 211 = hauteur bannière haut
	lePopMembre.style.paddingLeft = (((winwidth-1000)/2)+mon_curX)+'px'; // 1000 = largeur du site
	//replace en cas de limite droite fenetre atteinte
	if ( (((winwidth-1000)/2)+mon_curX+200) > winwidth)	
		{
		lePopMembre.style.paddingLeft = (((winwidth-1000)/2)+mon_curX-200)+'px'; // 1000 = largeur du site
		}
	}
	else 
	{
	lePopMembre.style.width = (winwidth)+'px';
	lePopMembre.style.height = (winheight+20)+'px';
	lePopMembre.style.top = (ietruebody().scrollTop)+'px';
	lePopMembre.style.paddingTop = (mon_curY-(ietruebody().scrollTop))+'px';
	lePopMembre.style.paddingLeft = (((winwidth-1000)/2)+mon_curX)+'px'; // 1000 = largeur du site
	lePopMembre.style.width = (winwidth-(((winwidth-1000)/2)+mon_curX))+'px';
	lePopMembre.style.height = (winheight+20-mon_curY+(ietruebody().scrollTop))+'px';
	//replace en cas de limite droite fenetre atteinte	
	if ( (((winwidth-1000)/2)+mon_curX+200) > winwidth) 
		{
		lePopMembre.style.paddingLeft = (((winwidth-1000)/2)+mon_curX-200)+'px';
		lePopMembre.style.width = (winwidth-(((winwidth-1000)/2)+mon_curX-200))+'px';
		}
	}
}

function redimensionne(e) {
if (affiche){
	winwidth = ie && !window.opera ? ietruebody().clientWidth : window.innerWidth - 20;
	winheight = ie && !window.opera ? ietruebody().clientHeight : window.innerHeight - 20;
	ReplaceLaBulle();
	}

if (affichemembre){
	winwidth = ie && !window.opera ? ietruebody().clientWidth : window.innerWidth - 20;
	winheight = ie && !window.opera ? ietruebody().clientHeight : window.innerHeight - 20;
	ReplaceLeMembre();
	}
}


var curX;
var curY;

var mon_curX;
var mon_curY;

var winwidth;
var winheight;

var xOffset=6
var yOffset=5

var affiche = false; 
var affichemembre = false; 

if (ie||w3c) {
var laBulle
var lePopMembre
}

function ietruebody(){ // retourne le bon corps...
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function showPopMembre(text) {
if (affiche) hideTooltip();
if (w3c||ie){
lePopMembre = document.all ? document.all["popmembre"] : document.getElementById ? document.getElementById("popmembre") : ""
lePopMembre.innerHTML = text; // fixe le texte dans l'infobulle
if (ie)
	mon_curX=curX;
	else
	mon_curX=curX-((winwidth-1000)/2);
if (ie) 
	mon_curY=curY-ietruebody().scrollTop+10;
	else
	mon_curY=curY+10;
ReplaceLeMembre();
lePopMembre.style.visibility = "visible"; // Si il est cachée (la verif n'est qu'une securité) on le rend visible.
affichemembre = true;
}
}
function hidePopMembre() {
if (w3c||ie){
affichemembre = false;
lePopMembre.style.visibility="hidden" // avoid the IE6 cache optimisation with hidden blocks
lePopMembre.style.backgroundColor = ''
lePopMembre.style.top = '0px';
lePopMembre.style.paddingTop = '0px';
lePopMembre.style.paddingLeft = '0px';		
lePopMembre.style.width = '0px';
lePopMembre.style.height = '0px';
}
}

function showTooltip(text,taille) {
if (affichemembre) hidePopMembre();
if (w3c||ie){
laBulle = document.all ? document.all["bulle"] : document.getElementById ? document.getElementById("bulle") : ""
laBulle.innerHTML = '<div class=\'info\'><table width=100% height=100%><tr><td align=\'center\'><img '+ taille +' src=\'' + text + '\'></td></tr></table></div>'; // fixe le texte dans l'infobulle
ReplaceLaBulle();
laBulle.style.visibility = "visible"; // Si il est cachée (la verif n'est qu'une securité) on le rend visible.
affiche = true;
}
}
function hideTooltip() {
if (w3c||ie){
affiche = false
laBulle.style.visibility="hidden" // avoid the IE6 cache optimisation with hidden blocks
laBulle.style.top = '-100000px'
laBulle.style.backgroundColor = ''
laBulle.style.width = '0px'
laBulle.style.height = '0px'
}
}
