
function html2text( html )
{
    var text = html.replace( /<[^>]*>/g, '' );
    text = text.replace( /&quot;/g, '"' );
    text = text.replace( /&lt;/g, '<' );
    text = text.replace( /&amp;/g, '&' );

    return text;
}

function text2html( text )
{
    var html = text.replace( /&/g,"&amp;");
    html = html.replace( /"/g,"&quot;");
    html = html.replace( /</g,"&lt;");

    return html;
}

