
var infoBulleDisplayed = false;

function highlightCell(item, event, text)
{
	color = '#FFC9DA';
//	item.style.border = '1px solid '+color;

	if(text && event)
		infoBulle(event, item, text);
		
}

function outlightCell(item, event)
{
	color = '#CC0033';
//	item.style.border = '1px solid '+color;
	
	if(event)
		infoBulle(event, item, '');
}

function goto(url)
{
	window.location.href = url;
}

function infoBulle(event, item, text)
{
	a = $('infoBulle');

	mouseX = event.clientX;
	mouseY = event.clientY;
	
	tolerance = 1;

	w = Element.getDimensions(item).width - tolerance;
	h = Element.getDimensions(item).height - tolerance;
	
	coord = Position.cumulativeOffset(item);
	itemLeft = coord[0] + tolerance;
	itemTop = coord[1] + tolerance;
	
	isInItem = (mouseX >  itemLeft+tolerance && mouseX < itemLeft+w-tolerance && mouseY > itemTop+tolerance && mouseY < itemTop+h-tolerance);
	
	if(!isInItem)
	{
		infoBulleDisplayed = false;
		$('infoBulle').style.display = 'none';
	}
	else if(!infoBulleDisplayed && text && text != '')
	{
		infoBulleDisplayed = true;
		
		html = '<div>'+text+'</div>';
		
		a.innerHTML = html;
		a.style.top = itemTop+100+'px';
		a.style.left = itemLeft+100+'px';
		a.style.display = 'inline';
		a.style.position = 'absolute';
		a.style.zIndex = 5;
		a.style.backgroundColor = '#FFFFFF';
		a.style.width = '170px';
		a.style.padding = '5px';
		a.style.border = '2px solid #ccc';
	}
}

