var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0
var tempY = 0

function getMouseXY(e) {
  if (IE) {
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {
    tempX = e.pageX
    tempY = e.pageY
  }  
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  return true
}


function infobull(id_info,text_info,titre_info,link_info,target_a) {
	document.write('<div style="position: absolute;top:0px;left:0px;visibility: hidden;z-index:9999'+id_info+';" id="'+id_info+'">');
	document.write('  <table border="1" cellpadding="0" style="background-color:#FFFFCC;border-collapse: collapse;" bordercolor="#000000" cellspacing="0">');
	document.write('    <tr><td><p style="margin: 5px;">'+text_info+'</p></td></tr>');
	document.write('  </table>');
	document.write('</div><a ');
	if(link_info)document.write(' href="'+link_info+'" ');
	if(target_a==1)document.write(' target="_blank" ');
	document.write('onMouseOver = "javascript:showTip(\''+id_info+'\');" onMouseOut = "javascript:hideTip(\''+id_info+'\');">'+titre_info+'</a>');
}

function showTip(id){
	obj = document.getElementById(id);

	var thiswidth = obj.style.width;
	if ( thiswidth === '' )	{
		thiswidth = obj.offsetWidth;
	}
	var thisheight = obj.style.height;
	if ( thisheight === '' ) {
		thisheight = obj.offsetHeight;
	}

	obj.style.visibility = "visible";
	
	if ( thiswidth > 500 ) {
		thiswidth = 500;
		obj.style.width = '500';
	}
	XX=((tempX+thiswidth)>document.body.offsetWidth)?document.body.offsetWidth-thiswidth-10:tempX+5;
	//YY=((tempY+75)>document.body.offsetHeight)?document.body.offsetHeight-70:tempY+15;
	YY = tempY+5;
	obj.style.left = XX;
	obj.style.top = YY;
	
}

function confirm_entry(message)
{
	return confirm(message);
}

function hideTip(id){
	document.getElementById(id).style.visibility = "hidden";
}