function replaceText(el, text)
{
	if (el != null)
	{
		//clearText(el);
		//var newNode = document.createTextNode(text);
		//el.appendChild(newNode);
		
		// Badd, naughty code, but at least it works with HTML.
		el.innerHTML = text;
	}
}

function clearText(el)
{
	if (el != null)
	{
		if (el.childNodes)
		{
			for(var i = 0; i<el.childNodes.length; i++)
			{
				var child = el.childNodes[i];
				el.removeChild(child);
			}
		}
	}
}

function getText(el)
{
	var text = "";
	if (el != null)
	{
		if (el.childNodes)
		{
			for(var i = 0; i<el.childNodes.length; i++)
			{
				var child = el.childNodes[i];
				if (child.nodeValue != null)
					text = text+child.nodeValue;
			}
		}
	}
}