Added javascript support in the templates. Extended selecting distribution email addresses.