// permet de rendre visible / invisible un élément
// dont l'id est commentdiv
// visible vaut visible ou hidden
// -------------------------------------------------
function SetVisibility(parentDivName,commentDivName,visible,width,offsetT,offsetL)
{
	parentref = document.getElementById(parentDivName);
	commentref = document.getElementById(commentDivName);

	commentref.style.width = width;
	commentref.style.top = parentref.offsetTop + offsetT;
	commentref.style.left = parentref.offsetLeft + offsetL;
	commentref.style.visibility = visible;
}



// Permet de connaître la position d'un élément sur l'écran
function getCumulativeOffset(oObj){
	oObj = $(oObj);
    var valTop = 0, valLeft = 0;
    var oReturn = {left: 0, top: 0};
    do {
        valTop += oObj.offsetTop  || 0;
        valLeft += oObj.offsetLeft || 0;
        oObj = oObj.offsetParent;
    } while (oObj);
    oReturn.left = valLeft;
    oReturn.top = valTop;
    return oReturn;
}

// Fait apparaître l'élément caché commentDivName
		//	Le positionne par rapport à l'élément parentDivId avec LEFT et TOP
		//	Lui assigne une largeur WIDTH
		//	Le remplit avec le contenu TEXTE
function display_layer( parentDivId, commentDivName, width, offsetTop, offsetLeft )	{

	$(commentDivName).style.top = ( getCumulativeOffset( parentDivId ).top + offsetTop ) + 'px';
	$(commentDivName).style.left = ( getCumulativeOffset( parentDivId ).left + offsetLeft ) + 'px';
	$(commentDivName).style.width = width + 'px';
	
	$(commentDivName).style.visibility = 'visible';
}
