Javascript functions for reference.