Unified Javascript in between main.js & home.js