initial working separation of JS from PHP