translation and move javascript out of php code