Added missing files and fixed bug

document onload was set twice for different init functions