/* Several functions to display the correct styles depending on the client browser */

function setOverflow(control, value)
{
	control.style.overflow = value;
}

function IsNotInternetExplorer()
{
	return (navigator.appName != 'Microsoft Internet Explorer');
}

function HTMLEncode(str)
{
	while(str.indexOf('\n') != -1)
	{
		str = str.replace('\n', '<br />');
	}
	
	return str;
}

function HTMLDecode(str)
{

	while(str.indexOf('<br />') != -1)
	{
		str = str.replace('<br />', '\n');
	}
	while(str.indexOf('<p>') != -1)
	{
		str = str.replace('<p>', '');
	}
	while(str.indexOf('&nbsp;') != -1)
	{
		str = str.replace('&nbsp;', '');
	}
	while(str.indexOf('</p>') != -1)
	{
		str = str.replace('</p>', '\n');
	}
	
	return str;
}

function showFloatingDiv(divId, moveY, moveX, e)
{

	var objDiv = document.getElementById(divId);
	
	if(document.all) //is IE
	{
		objDiv.style.top = (event.clientY + moveY + document.documentElement.scrollTop) + 'px';
		objDiv.style.left = (event.clientX + moveX + document.documentElement.scrollLeft) + 'px';
	}
	else //is Mozilla or Gecko-based browser
	{
		objDiv.style.top = (e.pageY + moveY) + 'px';
		objDiv.style.left = (e.pageX + moveX) + 'px';
	}
	
	objDiv.style.position = 'absolute';
	objDiv.style.display = 'block';
}

function HideFloatingDiv(divId)
{
	document.getElementById(divId).style.display='none';
}