patched the div id to support nested models, added escaping to apostrofe in javascript block inside quote