








function BulleBD(owner){
   this.owner=owner;
   this.contentDiv=null;
   this.loadedobjects="";
   this.shadow = null;
   this.ini();
   this.mustMove = false;
  
}


BulleBD.prototype.loadobjs=function(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (this.loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
this.loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}


BulleBD.prototype.setContent=function(content)
  {
    this.contentDiv.innerHTML = content;
	
  };

  
 
BulleBD.prototype.setVisible=function(bVisible)
  {
  if(bVisible)
    this.owner.style.display = "block";
	else
	 this.owner.style.display = "none";
	
  };
  
BulleBD.prototype.getVisible=function()
  {
  if(this.owner.style.display ="block")
    return(true);
	else
	 return(false);
	
  };

BulleBD.prototype.moveTo=function(x,y) {  
	this.owner.style.display = "block";
	var deltaY = this.owner.offsetHeight;
	var deltaX = 23;
	var w = this.contentDiv.offsetWidth+20;
/*
	var wo = 434 * w/300.0;
	var ho = 194 * deltaY/300.0;
	if(this.shadow!=null)
	{
	this.shadow.style.width = wo;
	this.shadow.style.height = ho;
	}
	//this.shadow.setAttribute("height",ho+"px");*/
	
	this.owner.style.position = "absolute";
	this.owner.style.top = 	y-deltaY;
	this.owner.style.left = x-deltaX;
}

BulleBD.prototype.ini=function() {


this.loadobjs("./js/bulleBD/bulle.css");
/*
var d = document.createElement("DIV");


d.setAttribute("position", "absolute");
d.style.top = "0px";
d.style.left = "0px";


var dombre = document.createElement("DIV");
dombre.className = "divOmbre";


document.body.appendChild(dombre);

var d1 = document.createElement("DIV");


d1.setAttribute("position", "absolute");
d1.style.top = "0px";
d1.style.left = "0px";

d1.innerHTML="d";
//document.body.appendChild(d1);


this.owner.appendChild(dombre);
this.owner.appendChild(d);
this.shadow = dombre;
*/

var t = document.createElement("TABLE");
var b = document.createElement("TBODY");
t.setAttribute("cellSpacing","0");
t.setAttribute("cellPadding","0");
t.setAttribute("border","0");
t.appendChild(b);

//top
var tr = document.createElement("TR");

b.appendChild(tr);
//left
var td = document.createElement("TD");
tr.appendChild(td);
td.className= "corneBulle";
var im =  document.createElement("IMG");
im.setAttribute("src","Images/infoBD/tl.gif");
td.appendChild(im);
//middle
td = document.createElement("TD");
tr.appendChild(td);
td.className= "tBulle";
td.setAttribute("colSpan","2");
//right
td = document.createElement("TD");
tr.appendChild(td);
td.className= "corneBulle";
td.parentTable = this;
td.onclick = function(){this.parentTable.owner.style.display="none";this.parentTable.mustMove=false;}
im =  document.createElement("IMG");
im.setAttribute("src","Images/infoBD/tr.gif");
td.appendChild(im);

//middle

tr = document.createElement("TR");
b.appendChild(tr);
//Left
td = document.createElement("TD");
tr.appendChild(td);
td.className= "lBulle";

td = document.createElement("TD");
td.setAttribute("colSpan","2");
tr.appendChild(td);
//content
this.contentDiv = document.createElement("DIV");
this.contentDiv.className = "divCont";
td.appendChild(this.contentDiv);

//right
td = document.createElement("TD");
tr.appendChild(td);
td.className= "rBulle";

//bottom

tr = document.createElement("TR");
b.appendChild(tr);
//left

td = document.createElement("TD");
tr.appendChild(td);
td.className= "corneBulle";
td.setAttribute("vAlign","top");
im =  document.createElement("IMG");
im.setAttribute("src","Images/infoBD/bl.gif");
td.appendChild(im);
td.parentTable = this;
td.onclick = function(){this.parentTable.owner.style.display="none";this.parentTable.mustMove=false;}
//fleche
td = document.createElement("TD");
tr.appendChild(td);
td.className= "fleche";
td.setAttribute("width","93px");
im =  document.createElement("IMG");
im.setAttribute("src","Images/infoBD/fleche.gif");
td.appendChild(im);
td.parentTable = this;
td.onclick = function(){this.parentTable.owner.style.display="none";this.parentTable.mustMove=false;}
// suite
td = document.createElement("TD");
tr.appendChild(td);
td.className= "bBulle";
td.parentTable = this;
td.onclick = function(){this.parentTable.owner.style.display="none";this.parentTable.mustMove=false;}

//bottom right

td = document.createElement("TD");
tr.appendChild(td);
td.setAttribute("vAlign","top");
td.className= "corneBulle";
im =  document.createElement("IMG");
im.setAttribute("src","Images/infoBD/br.gif");
td.appendChild(im);
td.parentTable = this;
td.onclick = function(){this.parentTable.owner.style.display="none";this.parentTable.mustMove=false;}

this.owner.appendChild(t);


};



	