Duplicated code for the initial loading screen

The code for seting up the initial loading screen (the one with the animated gif) appears in two places (template/cocos2d.js and platform/jsloader.js).
I've put the code in a function so both files call the same function.