Test for and run a dynamically named javascript function