access newDocument template from js