stop javascript from displaying function at the bottom of the page