Javascript : Dynamically Selecting a Method / Property