move javascript to js file