function editorGet(name)
{
	return $(name).contentWindow.document.body.innerHTML;
}

function editorSet(name, txt)
{
	$(name).contentWindow.document.body.innerHTML=txt;
}

function doRichEditCommand(name, func, param)
{
  $(name).contentDocument.execCommand(func, false, param);
}

function setFocus(name)
{
	setTimeout(
	function()
	{
		$(name).contentWindow.focus();
	}, 100);
}

function doInsertLink(name)
{
	var url = prompt("URL:", "http://");
	
	if (url)
		doRichEditCommand(name, "createlink", url);
	
	setFocus(name);
}

function doColor(name, func, color)
{
	doRichEditCommand(name, func, color);
	
	$('popupColor').hidePopup();
	
	setFocus(name);
}