fix the jstable

move all the windows.onload code to the same place