broke javascript functions into external files