split the common javascript out into a script file