General JavaScript functions for Geo