In html_encode(), escape apostrophes so they can't mess up the embedded JavaScript.