replace all occurrences of &nbsp; not just the first one

hoping this fixes http://manage.dimagi.com/default.asp?120829
Interesting. I thought these were equivalent, but on looking it up on MDN I find:

> To perform a global search and replace, either include the `g` switch in the regular expression or if the first parameter is a string, include `g` in the `flags` parameter.

Note that the `flags` parameter is non-standard, so the only true way is to use a regexp as done here. Nice catch Cory.