removed isNaN (for google maps compatibility) and isUndefined duplicate