moving onclick event for the accordion out of html and into js