moving common js functions in a separate file
refactor customer page with external js functions