// JavaScript Document
var position='';
var textGlobal='';
function GetId(id)
{
return document.getElementById(id);
}

var i=false; // La variable i nous dit si la bulle est visible ou non

function move_bulle(e) {
	var positionMemo=position;
		if (navigator.appName!="Microsoft Internet Explorer") { // Si on est pas sous IE
		  if(e.pageX+210>document.body.clientWidth){
				position='gauche';
				GetId("curseur").style.left=e.pageX-205+"px";  
		  }else{
				position='droite';
				GetId("curseur").style.left=e.pageX+5+"px";
		  }
		  GetId("curseur").style.top=e.pageY-5-GetId("curseur").clientHeight+"px";
		} else { // Modif proposé par TeDeum, merci à  lui
			  if(event.x+210>document.documentElement.clientWidth){
				  position='gauche';
				  GetId("curseur").style.left=(-20)+event.x+document.documentElement.scrollLeft-200+"px";
			  }else{
				  position='droite';
				  GetId("curseur").style.left=20+event.x+document.documentElement.scrollLeft+"px";
			  }
		  	GetId("curseur").style.top=(-5)-GetId("curseur").clientHeight+event.y+document.documentElement.scrollTop+"px";
		}
		if(positionMemo!=position){
			changeCote();	
		}
}


function montre_bulle(text) {
	if(i==false) {
		i=true;
		GetId("curseur").style.visibility="visible";
		GetId("infobulle_contenu").innerHTML = text;
	}
}


function changeCote(){
		if(position=='gauche'){
			GetId("curseur").innerHTML='<table cellpadding="0" cellspacing="0" width="199"><tr><td colspan="2" width="199"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td width="181" id="infobulle_contenu" style="background-color:#FFFFFF; border-top:solid 1 px #CCCCCC; border-right:solid 1 px #CCCCCC; border-left:solid 1px #CCCCCC;"><img src="/back/charte/spacer.gif" width="1" height="1"/></td><td width="18">&nbsp;</td></tr></table></td></tr><tr><td valign="top" width="174"><table cellpadding="0" cellspacing="0" border="0" width="174"><tr><td valign="top" width="174"><table cellpadding="0" cellspacing="0" border="0" width="174"><tr><td height="9" width="174" style="background-color:#FFFFFF; border-bottom:solid 1px #CCCCCC; border-right:solid 1 px #CCCCCC;" valign="top"><img src="/back/charte/spacer.gif" width="174" height="9"/></td></tr></table></td><td width="25" height="19" valign="bottom" align="left"><img src="/back/charte/bulle2.gif" width="25" height="19"/></td></tr></table></td></tr></table>';
		}else{
			GetId("curseur").innerHTML='<table cellpadding="0" cellspacing="0" width="199"><tr><td colspan="2" width="199"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td width="18">&nbsp;</td><td width="181" id="infobulle_contenu" style="background-color:#FFFFFF; border-top:solid 1 px #CCCCCC; border-right:solid 1 px #CCCCCC; border-left:solid 1px #CCCCCC;"><img src="/back/charte/spacer.gif" width="1" height="1"/></td></tr></table></td></tr><tr><td width="25" height="19" valign="bottom" align="left"><img src="/back/charte/bulle.gif" width="25" height="19"/></td><td valign="top" width="174"><table cellpadding="0" cellspacing="0" border="0" width="174"><tr><td height="9" width="174" style="background-color:#FFFFFF; border-bottom:solid 1px #CCCCCC; border-right:solid 1 px #CCCCCC;" valign="top"><img src="/back/charte/spacer.gif" width="174" height="9"/></td></tr></table></td></tr></table>';
		}
}

function cache_bulle() {
	if(i==true) {
	GetId("curseur").style.visibility="hidden";
	i=false;
	}
}