var timer;
var htmleditor_loaded_completed=0;

function htmleditor_full_loaded()
{
	if( typeof(document.msgFrm.contentFrm)=="object" )
	{
		if( document.msgFrm.document.Form.fullyLoaded.value=="1" )
			return(1);
		else
			return(0);
	}
	else
		return(0);
}

function setMsg()
{
	if( htmleditor_full_loaded() )
	{
		htmleditor_loaded_completed=1;
		clearTimeout(timer);
		document.msgFrm.contentFrm.document.body.innerHTML=document.form.contents.value;
	}
	else{
		timer=setTimeout("setMsg()",100);
	}
}


function onOK()
{
	if( htmleditor_loaded_completed==1 )
	{
		var Form=document.form;
		Form.contents.value=document.msgFrm.contentFrm.document.body.innerHTML;
	}
	else{
		timer = setTimeout("onOK()",100);
	}
}