make purchase tables collapse on startup with javascript