register js functions