/*--------------------------------------------------------------------------
	LimitTextarea

---------------------------------------------------------------------------*/
function LimitTextarea(
			target,
			limit
			)
{
	var target = document.getElementById(target);
	
	if (target && limit>0)
	{
		target.onkeyup = function()
		{
			if (target.value.length > limit)
			{
				target.value = target.value.substring(0,limit);
			}
		}
	}
}

/*--------------------------------------------------------------------------
	SetHTMLContent
	
---------------------------------------------------------------------------*/

function SetHTMLContent(
			target,
			html_buffer
			)
{
	var target = document.getElementById(target);
	
	target.innerHTML = html_buffer;
}

/*--------------------------------------------------------------------------
	ShowInfo
	HideInfo
	GetMousePos
	
---------------------------------------------------------------------------*/
function ShowInfo(
			target
			)
{
	var target = document.getElementById(target);
	
	target.style.left = '-10000px';
	target.style.top = '-10000px';
	target.style.position = 'absolute';
	target.style.display = 'block';
	
	document.onmousemove = function(evt)
	{
		var obj = GetMousePos(evt);

		/*	
		obj.x += 15;
		obj.y += 15;
		*/
		
		/*PATCH POUR LE SITE THERMOBILE*/
		obj.x -= 5+target.offsetWidth;
		obj.y -= 20;
		/*FIN PATCH*/
		
		target.style.left = obj.x+'px';
		target.style.top = obj.y+'px';
	}
}
function HideInfo(
			target
			) 
{
	var target = document.getElementById(target);
	
	target.style.display = 'none';
	
	document.onmousemove = null;
}
function GetMousePos(
			evt
			)
{
	  if (evt) {
	   return { 
		x:evt.pageX, 
		y:evt.pageY 
	   };
	  }
	 
	  if (event) {
	   var pagebody = document.getElementsByTagName('body')[0];
		
		return { 
		x:window.event.clientX + pagebody.scrollLeft - pagebody.clientLeft, 
		y:window.event.clientY + pagebody.scrollTop  - pagebody.clientTop 
		};
	  }
}
