Removing Dojo substitute function and replacing with generic javascript
version.