// Déclaration des Variable Globales
var IB = new Object;
var posX=0; posY=0;
var xOffset=10; yOffset=10;

//################ FONCTION PERMETTANT D'AFFICHER L'OBJET "BULLE" ###################
function AffBulle(texte, mon_objet)
	{	 
	 if (document.getElementById)
		{
		 var finalPosX = posX - xOffset;
	     
		 if (finalPosX < 0)
		 	finalPosX = 0;
		 
		 contenu="<B><TABLE id='tableau' border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=2 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-1' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE></B>&nbsp;";		 
 		 document.getElementById("bulle").innerHTML = contenu;
		 		 
		 if (navigator.appName == "Microsoft Internet Explorer")
		 	{
		 	 document.getElementById("bulle").style.pixelTop = posY + yOffset - 55;
			 
//alert(xOffset);
		 	 if (finalPosX < screen.availWidth - 400)
			 	document.getElementById("bulle").style.pixelLeft = finalPosX;
			 else
				 document.getElementById("bulle").style.pixelLeft = screen.availWidth - 280;
			}
		 else
		 	{
			 //document.getElementById("bulle").style.top = posY+yOffset;	
			 document.getElementById("bulle").style.top = posY + yOffset - 55 + "px";	
			 //alert(document.getElementById("bulle").style.top);
		 	 //document.getElementById("bulle").style.left = finalPosX+"px";
			 
			 if (finalPosX < screen.availWidth - 300)
			 	document.getElementById("bulle").style.left = finalPosX+"px";
			 else
				 document.getElementById("bulle").style.left = screen.availWidth - 25;
			 
			 
			}
			
		 document.getElementById("bulle").style.zIndex = 10;	

    	 document.getElementById("bulle").style.visibility = "visible";
  		}
	}
	
	
//################ FONCTION PERMETTANT DE CACHER L'OBJET "BULLE" ###################
function HideBulle()
	{
	 if (document.getElementById)
	 	document.getElementById("bulle").style.visibility = "hidden";
	}


//################ FONCTION PERMETTANT DE DÉTECTER LES COORDONNÉES DU CURSEUR ###################
function getMousePos(e)
	{
  	 if (document.all)
	 	{
  		 posX = event.x + document.body.scrollLeft; //modifs CL 09/2001 - IE : regrouper l'évènement
  		 posY = event.y + document.body.scrollTop;
  		}
  	 else
	 	{
  		 posX = e.pageX; //modifs CL 09/2001 - NS6 : celui-ci ne supporte pas e.x et e.y
  		 posY = e.pageY; 
		}
	}


//################ FONCTION PERMETTANT D'INITIALISER L'OBJET "BULLE" ###################
function InitBulle(ColTexte,ColFond,ColContour,NbPixel)
	{
	 IB.ColTexte = ColTexte;
	 IB.ColFond = ColFond;
	 IB.ColContour = ColContour;
	 IB.NbPixel = NbPixel;
	 
	 if (document.getElementById)
	 	{
		 document.onmousemove = getMousePos;
	     document.write("<DIV id='bulle' style='position:absolute;visibility:hidden'></DIV>");
		}
	}