
$(document).ready(function() {
    $('#ctext').one('focus',function() {
        $('#ctext').parent().after('<div><label for="comment-preview">Comment Preview</label>:</div><div id="comment-preview"></div>');
    });
    var $comment = '';
    $('#ctext').keyup(function() {
        $comment = $(this).val();
        $comment = $comment.replace(/<\/?[^>]+>/g,"").replace(/\n\n+/g, '<br /><br />');
        $('#comment-preview').html($comment);
    });
});
