function CodeEditorUtils()
{
}


CodeEditorUtils.decodeHTMLEnts = function (html)
{
    var text = html.replace(/&lt;/g, "<");
    text = text.replace(/&gt;/g, ">");
    text = text.replace(/&amp;/g, "&");
    text = text.replace(/&nbsp;/g, " ");
    return (text);
}


CodeEditorUtils.encodeHTMLEnts = function (text)
{
    var html = text.replace(/&/g, "&amp;");
    html = html.replace(/>/g, "&gt;");
    html = html.replace(/</g, "&lt;");
    html = html.replace(/ /g, "&nbsp;");
    return html;
}


CodeEditorUtils.trim = function (str)
{
    return str.replace(/^\s*|\s*$/g,"");
}


CodeEditorUtils.makeHelpIcon = function (helpText, container, character)
{
	var c = character ? character : "?";
	
	var helpLink = LKDOM.CreateElement("a", null, c, container);

	helpLink.className = "form-help form-help-layout";
	helpLink.href = "javascript:void(0);";
	helpLink.style.fontSize = "9px";
	helpLink.onmouseover = PPSCHelpPopup.formHelpMouseOver;
	helpLink.onmouseout = PPSCHelpPopup.formHelpMouseOut;
	
	LKDOM.CreateElement("div", null, helpText, helpLink);
	
	return helpLink;
}