re-wrote JavaScript templates to use RegEx; added minified JavaScript