function infBulleDisplay() {
	if (document.layers) {
		document.layers[this.name].document.write(this.content);
		document.layers[this.name].document.close();
		document.layers[this.name].top				=	this.posY + this.ydecal;
		document.layers[this.name].left				=	this.posX + this.xdecal;
		document.layers[this.name].visibility		=	"show";
	}
	if (document.all) {
		document.all[this.name].innerHTML			=	this.content;
		document.all[this.name].style.top			=	window.event.clientY + document.body.scrollTop + this.ydecal;
		document.all[this.name].style.left			=	window.event.x + this.xdecal;
		document.all[this.name].style.visibility	=	"visible";
	}
}

function infBulleHide() {
	if (document.layers){
		document.layers[this.name].visibility="hide";
	}
	if (document.all) 	{
		document.all[this.name].style.visibility="hidden";
	}
}

function infBulleMouseListener(event) {
	this.posX	=	event.x;
	this.posY	=	event.y;
}

function setMessage(message,width,imgpath) {
	template 	= 		"<table width=" + width + " border=0 align=\"center\" cellpadding=0 cellspacing=0>"
					+	"<tr valign=\"top\" height=15>"
					+		"<td width=14 height=15>"
					+			"<img src=\""+imgpath+"/infobulle_1.gif\" width=14 height=15>"
					+		"</td>"
					+		"<td width=\"100%\">"
					+			"<img src=\""+imgpath+"/infobulle_2.gif\" width=\"100%\" height=15>"
					+		"</td>"
					+		"<td width=14>"
					+			"<img src=\""+imgpath+"/infobulle_3.gif\" width=14 height=15>"
					+		"</td>"
					+	"</tr>"
					+	"<tr height=\"100%\">"
					+		"<td height=\"100%\">"
					+			"<img src=\""+imgpath+"/infobulle_6.gif\" width=14 height=\"100%\">"
					+		"</td>"
					+		"<td height=\"100%\" bgcolor=\"white\" class=\"info_text\" ><div align=\"left\">"
					+		message
					+		"</div></td>"
					+		"<td height=\"100%\">"
					+			"<img src=\""+imgpath+"/infobulle_7.gif\" width=14 height=\"100%\">"
					+		"</td>"
					+	"</tr>"
					+	"<tr valign=\"top\">"
					+		"<td><img src=\""+imgpath+"/infobulle_8.gif\" width=14 height=15></td>"
					+		"<td width=\"100%\">"
					+			"<img src=\""+imgpath+"/infobulle_9.gif\" width=\"100%\" height=15>"
					+		"</td>"
					+		"<td>"
					+			"<img src=\""+imgpath+"/infobulle_10.gif\" width=14 height=15>"
					+		"</td>"
					+	"</tr>"
					+	"</table>"
	this.content		= template;
}

function infoBulle(message, name, width, alignRight, decalTop, decalLeft, imgpath) {
	
	this.posX			= 0;
	this.posY			= 0;
	if (alignRight) {
		this.xdecal			= decalLeft;
	} else {
		this.xdecal			= -width;	
	}
	this.ydecal			= decalTop;
	this.name			= name;
	this.listener		= infBulleMouseListener;
	this.display 		= infBulleDisplay;
	this.hide    		= infBulleHide;
	this.setMessage		= setMessage;
					
	template 	= 		"<table width=" + width + " border=0 align=\"center\" cellpadding=0 cellspacing=0>"
					+	"<tr valign=\"top\" height=15>"
					+		"<td width=14 height=15>"
					+			"<img src=\""+imgpath+"/infobulle_1.gif\" width=14 height=15>"
					+		"</td>"
					+		"<td width=\"100%\">"
					+			"<img src=\""+imgpath+"/infobulle_2.gif\" width=\"100%\" height=15>"
					+		"</td>"
					+		"<td width=14>"
					+			"<img src=\""+imgpath+"/infobulle_3.gif\" width=14 height=15>"
					+		"</td>"
					+	"</tr>"
					+	"<tr height=\"100%\">"
					+		"<td height=\"100%\">"
					+			"<img src=\""+imgpath+"/infobulle_6.gif\" width=14 height=\"100%\">"
					+		"</td>"
					+		"<td height=\"100%\" bgcolor=\"white\" class=\"info_text\" ><div align=\"left\">"
					+		message
					+		"</div></td>"
					+		"<td height=\"100%\">"
					+			"<img src=\""+imgpath+"/infobulle_7.gif\" width=14 height=\"100%\">"
					+		"</td>"
					+	"</tr>"
					+	"<tr valign=\"top\">"
					+		"<td><img src=\""+imgpath+"/infobulle_8.gif\" width=14 height=15></td>"
					+		"<td width=\"100%\">"
					+			"<img src=\""+imgpath+"/infobulle_9.gif\" width=\"100%\" height=15>"
					+		"</td>"
					+		"<td>"
					+			"<img src=\""+imgpath+"/infobulle_10.gif\" width=14 height=15>"
					+		"</td>"
					+	"</tr>"
					+	"</table>"
					
					
	this.content		= template;
	
	if (document.layers) {
		window.captureEvents(Event.MOUSEMOVE);
		window.onMouseMove=infBullMouseListener;
		document.write("<LAYER name='"+this.name+"' top=0 left=0 visibility='hide'></LAYER>");
	}
	if (document.all) {
		document.write("<DIV id='"+this.name+"' style='position:absolute;top:0;left:0;visibility:hidden'></DIV>");
	}
}
