Move js into template-specific file