You could probably embed the hash in the template to avoid reimplementing it in JS... which might be better to avoid code duplication? *shrug*